Latex does not go to next line












2















I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.



$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$


I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:



enter image description here



I have tried disabling packages but this offers no solution.



When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.



Any help is very much appreciated.










share|improve this question









New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 6





    $$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

    – egreg
    7 hours ago
















2















I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.



$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$


I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:



enter image description here



I have tried disabling packages but this offers no solution.



When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.



Any help is very much appreciated.










share|improve this question









New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 6





    $$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

    – egreg
    7 hours ago














2












2








2








I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.



$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$


I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:



enter image description here



I have tried disabling packages but this offers no solution.



When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.



Any help is very much appreciated.










share|improve this question









New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.



$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$


I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:



enter image description here



I have tried disabling packages but this offers no solution.



When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.



Any help is very much appreciated.







math-mode indentation






share|improve this question









New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 6 hours ago









Werner

447k699891695




447k699891695






New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 7 hours ago









CapitalMattersCapitalMatters

111




111




New contributor




CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 6





    $$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

    – egreg
    7 hours ago














  • 6





    $$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

    – egreg
    7 hours ago








6




6





$$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

– egreg
7 hours ago





$$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.

– egreg
7 hours ago










2 Answers
2






active

oldest

votes


















7














This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.



For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.






share|improve this answer































    6














    For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?



    Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.



    While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.



    enter image description here



    documentclass{article}
    usepackage{amsmath} % for 'align*' environment
    begin{document}
    begin{align*}
    S(k+1)
    &= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
    &= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
    end{align*}
    end{document}





    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478948%2flatex-does-not-go-to-next-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7














      This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.



      For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.






      share|improve this answer




























        7














        This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.



        For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.






        share|improve this answer


























          7












          7








          7







          This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.



          For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.






          share|improve this answer













          This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.



          For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 7 hours ago









          BernardBernard

          173k776204




          173k776204























              6














              For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?



              Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.



              While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.



              enter image description here



              documentclass{article}
              usepackage{amsmath} % for 'align*' environment
              begin{document}
              begin{align*}
              S(k+1)
              &= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
              &= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
              end{align*}
              end{document}





              share|improve this answer






























                6














                For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?



                Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.



                While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.



                enter image description here



                documentclass{article}
                usepackage{amsmath} % for 'align*' environment
                begin{document}
                begin{align*}
                S(k+1)
                &= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
                &= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
                end{align*}
                end{document}





                share|improve this answer




























                  6












                  6








                  6







                  For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?



                  Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.



                  While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.



                  enter image description here



                  documentclass{article}
                  usepackage{amsmath} % for 'align*' environment
                  begin{document}
                  begin{align*}
                  S(k+1)
                  &= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
                  &= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
                  end{align*}
                  end{document}





                  share|improve this answer















                  For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?



                  Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.



                  While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.



                  enter image description here



                  documentclass{article}
                  usepackage{amsmath} % for 'align*' environment
                  begin{document}
                  begin{align*}
                  S(k+1)
                  &= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
                  &= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
                  end{align*}
                  end{document}






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 6 hours ago









                  Werner

                  447k699891695




                  447k699891695










                  answered 6 hours ago









                  MicoMico

                  282k31386774




                  282k31386774






















                      CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.













                      CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.












                      CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478948%2flatex-does-not-go-to-next-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Paul Cézanne

                      UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

                      Angular material date-picker (MatDatepicker) auto completes the date on focus out