Forgotten brace error when I use left and right











up vote
3
down vote

favorite












I've a simple formula:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{(norm{q^{0} - q^{j}}^{2} - d^{2}})^{2}}
end{equation*}
end{document}


After adding left and right commands to make the parenthesis of the denominator bigger, LaTeX generates the output as follows:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}
end{equation*}
end{document}


enter image description here



but there is an error like Extra }, or forgotten right. ...orm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}. The code is seamlessly compiled without those left and right commands.










share|improve this question







New contributor




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
















  • 2




    Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
    – Raaja
    Nov 28 at 9:39








  • 3




    You are enclosing left in a group leaving out right: {left( ... } right).
    – campa
    Nov 28 at 9:41















up vote
3
down vote

favorite












I've a simple formula:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{(norm{q^{0} - q^{j}}^{2} - d^{2}})^{2}}
end{equation*}
end{document}


After adding left and right commands to make the parenthesis of the denominator bigger, LaTeX generates the output as follows:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}
end{equation*}
end{document}


enter image description here



but there is an error like Extra }, or forgotten right. ...orm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}. The code is seamlessly compiled without those left and right commands.










share|improve this question







New contributor




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
















  • 2




    Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
    – Raaja
    Nov 28 at 9:39








  • 3




    You are enclosing left in a group leaving out right: {left( ... } right).
    – campa
    Nov 28 at 9:41













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I've a simple formula:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{(norm{q^{0} - q^{j}}^{2} - d^{2}})^{2}}
end{equation*}
end{document}


After adding left and right commands to make the parenthesis of the denominator bigger, LaTeX generates the output as follows:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}
end{equation*}
end{document}


enter image description here



but there is an error like Extra }, or forgotten right. ...orm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}. The code is seamlessly compiled without those left and right commands.










share|improve this question







New contributor




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











I've a simple formula:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{(norm{q^{0} - q^{j}}^{2} - d^{2}})^{2}}
end{equation*}
end{document}


After adding left and right commands to make the parenthesis of the denominator bigger, LaTeX generates the output as follows:



documentclass{article}

usepackage{mathtools}

newcommandnorm[1]{leftlVert#1rightrVert}

begin{document}
begin{equation*}
displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}
end{equation*}
end{document}


enter image description here



but there is an error like Extra }, or forgotten right. ...orm{q^{0} - q^{j}}^{2} - d^{2}}right)^{2}}. The code is seamlessly compiled without those left and right commands.







amsmath






share|improve this question







New contributor




Pinton 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




Pinton 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






New contributor




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









asked Nov 28 at 9:36









Pinton

183




183




New contributor




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





New contributor





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






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








  • 2




    Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
    – Raaja
    Nov 28 at 9:39








  • 3




    You are enclosing left in a group leaving out right: {left( ... } right).
    – campa
    Nov 28 at 9:41














  • 2




    Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
    – Raaja
    Nov 28 at 9:39








  • 3




    You are enclosing left in a group leaving out right: {left( ... } right).
    – campa
    Nov 28 at 9:41








2




2




Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
– Raaja
Nov 28 at 9:39






Replace it with: displaystylesumlimits_{mathclap{j in {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}}. Simple rule: Respec the brackets ;)
– Raaja
Nov 28 at 9:39






3




3




You are enclosing left in a group leaving out right: {left( ... } right).
– campa
Nov 28 at 9:41




You are enclosing left in a group leaving out right: {left( ... } right).
– campa
Nov 28 at 9:41










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










You have too many useless bits in your code




  • inside equation, displaystyle and limits are already in force

  • additional braces in the denominator can be disruptive of spacing


  • mathclap is not needed (and is wrong, as the need for ~ shows)


Here are my proposals (I'd go with the first one). Note that with my definition of norm, norm* is essentially the same as yours.



documentclass{article}

usepackage{mathtools}

%newcommandnorm[1]{leftlVert#1rightrVert}
DeclarePairedDelimiter{norm}{lVert}{rVert}

begin{document}

subsection*{Good}

begin{equation*}
sum_{j in {1,2}} frac{q^{0} - q^{j}}{(norm{q^{0} - q^{j}}^{2} - d^{2})^{2}}
end{equation*}

subsection*{Possibly preferable}

begin{equation*}
sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{2}}
end{equation*}

subsection*{Possibly preferable again}

begin{equation*}
sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{!2}}
end{equation*}

subsection*{Disputable}

begin{equation*}
sum_{j in {1,2}} frac{q^{0} - q^{j}}{left(norm*{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}
end{equation*}

end{document}


enter image description here






share|improve this answer




























    up vote
    4
    down vote













    Grouping error in your code, below is the updated code:



    begin{equation*}
    displaystylesumlimits_{mathclap{j in
    {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)}^{2}}
    end{equation*}





    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',
      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
      });


      }
      });






      Pinton 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%2f462126%2fforgotten-brace-error-when-i-use-left-and-right%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








      up vote
      5
      down vote



      accepted










      You have too many useless bits in your code




      • inside equation, displaystyle and limits are already in force

      • additional braces in the denominator can be disruptive of spacing


      • mathclap is not needed (and is wrong, as the need for ~ shows)


      Here are my proposals (I'd go with the first one). Note that with my definition of norm, norm* is essentially the same as yours.



      documentclass{article}

      usepackage{mathtools}

      %newcommandnorm[1]{leftlVert#1rightrVert}
      DeclarePairedDelimiter{norm}{lVert}{rVert}

      begin{document}

      subsection*{Good}

      begin{equation*}
      sum_{j in {1,2}} frac{q^{0} - q^{j}}{(norm{q^{0} - q^{j}}^{2} - d^{2})^{2}}
      end{equation*}

      subsection*{Possibly preferable}

      begin{equation*}
      sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{2}}
      end{equation*}

      subsection*{Possibly preferable again}

      begin{equation*}
      sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{!2}}
      end{equation*}

      subsection*{Disputable}

      begin{equation*}
      sum_{j in {1,2}} frac{q^{0} - q^{j}}{left(norm*{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}
      end{equation*}

      end{document}


      enter image description here






      share|improve this answer

























        up vote
        5
        down vote



        accepted










        You have too many useless bits in your code




        • inside equation, displaystyle and limits are already in force

        • additional braces in the denominator can be disruptive of spacing


        • mathclap is not needed (and is wrong, as the need for ~ shows)


        Here are my proposals (I'd go with the first one). Note that with my definition of norm, norm* is essentially the same as yours.



        documentclass{article}

        usepackage{mathtools}

        %newcommandnorm[1]{leftlVert#1rightrVert}
        DeclarePairedDelimiter{norm}{lVert}{rVert}

        begin{document}

        subsection*{Good}

        begin{equation*}
        sum_{j in {1,2}} frac{q^{0} - q^{j}}{(norm{q^{0} - q^{j}}^{2} - d^{2})^{2}}
        end{equation*}

        subsection*{Possibly preferable}

        begin{equation*}
        sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{2}}
        end{equation*}

        subsection*{Possibly preferable again}

        begin{equation*}
        sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{!2}}
        end{equation*}

        subsection*{Disputable}

        begin{equation*}
        sum_{j in {1,2}} frac{q^{0} - q^{j}}{left(norm*{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}
        end{equation*}

        end{document}


        enter image description here






        share|improve this answer























          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          You have too many useless bits in your code




          • inside equation, displaystyle and limits are already in force

          • additional braces in the denominator can be disruptive of spacing


          • mathclap is not needed (and is wrong, as the need for ~ shows)


          Here are my proposals (I'd go with the first one). Note that with my definition of norm, norm* is essentially the same as yours.



          documentclass{article}

          usepackage{mathtools}

          %newcommandnorm[1]{leftlVert#1rightrVert}
          DeclarePairedDelimiter{norm}{lVert}{rVert}

          begin{document}

          subsection*{Good}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{(norm{q^{0} - q^{j}}^{2} - d^{2})^{2}}
          end{equation*}

          subsection*{Possibly preferable}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{2}}
          end{equation*}

          subsection*{Possibly preferable again}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{!2}}
          end{equation*}

          subsection*{Disputable}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{left(norm*{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}
          end{equation*}

          end{document}


          enter image description here






          share|improve this answer












          You have too many useless bits in your code




          • inside equation, displaystyle and limits are already in force

          • additional braces in the denominator can be disruptive of spacing


          • mathclap is not needed (and is wrong, as the need for ~ shows)


          Here are my proposals (I'd go with the first one). Note that with my definition of norm, norm* is essentially the same as yours.



          documentclass{article}

          usepackage{mathtools}

          %newcommandnorm[1]{leftlVert#1rightrVert}
          DeclarePairedDelimiter{norm}{lVert}{rVert}

          begin{document}

          subsection*{Good}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{(norm{q^{0} - q^{j}}^{2} - d^{2})^{2}}
          end{equation*}

          subsection*{Possibly preferable}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{2}}
          end{equation*}

          subsection*{Possibly preferable again}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{bigl(norm{q^{0} - q^{j}}^{2} - d^{2}bigr)^{!2}}
          end{equation*}

          subsection*{Disputable}

          begin{equation*}
          sum_{j in {1,2}} frac{q^{0} - q^{j}}{left(norm*{q^{0} - q^{j}}^{2} - d^{2}right)^{2}}
          end{equation*}

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 at 9:49









          egreg

          701k8618693142




          701k8618693142






















              up vote
              4
              down vote













              Grouping error in your code, below is the updated code:



              begin{equation*}
              displaystylesumlimits_{mathclap{j in
              {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)}^{2}}
              end{equation*}





              share|improve this answer

























                up vote
                4
                down vote













                Grouping error in your code, below is the updated code:



                begin{equation*}
                displaystylesumlimits_{mathclap{j in
                {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)}^{2}}
                end{equation*}





                share|improve this answer























                  up vote
                  4
                  down vote










                  up vote
                  4
                  down vote









                  Grouping error in your code, below is the updated code:



                  begin{equation*}
                  displaystylesumlimits_{mathclap{j in
                  {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)}^{2}}
                  end{equation*}





                  share|improve this answer












                  Grouping error in your code, below is the updated code:



                  begin{equation*}
                  displaystylesumlimits_{mathclap{j in
                  {1,2}}}~frac{q^{0} - q^{j}}{{left(norm{q^{0} - q^{j}}^{2} - d^{2}right)}^{2}}
                  end{equation*}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 28 at 9:40









                  MadyYuvi

                  2,066211




                  2,066211






















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










                      draft saved

                      draft discarded


















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













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












                      Pinton 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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f462126%2fforgotten-brace-error-when-i-use-left-and-right%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

                      QoS: MAC-Priority for clients behind a repeater

                      Ивакино (Тотемский район)

                      Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)