Commenting an equation with a vertical bar

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












8














I want to use a vertical bar to comment on solving a simple equation.



equation resolution with comment and a vertical bar



Do you know a way to do that with LaTeX ?










share|improve this question























  • Welcome to TeX.SE!
    – Sebastiano
    Dec 17 at 21:40















8














I want to use a vertical bar to comment on solving a simple equation.



equation resolution with comment and a vertical bar



Do you know a way to do that with LaTeX ?










share|improve this question























  • Welcome to TeX.SE!
    – Sebastiano
    Dec 17 at 21:40













8












8








8


2





I want to use a vertical bar to comment on solving a simple equation.



equation resolution with comment and a vertical bar



Do you know a way to do that with LaTeX ?










share|improve this question















I want to use a vertical bar to comment on solving a simple equation.



equation resolution with comment and a vertical bar



Do you know a way to do that with LaTeX ?







equations line vertical bar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 17 at 22:26

























asked Dec 17 at 21:36









gilhoo

485




485











  • Welcome to TeX.SE!
    – Sebastiano
    Dec 17 at 21:40
















  • Welcome to TeX.SE!
    – Sebastiano
    Dec 17 at 21:40















Welcome to TeX.SE!
– Sebastiano
Dec 17 at 21:40




Welcome to TeX.SE!
– Sebastiano
Dec 17 at 21:40










3 Answers
3






active

oldest

votes


















11














Yes, it's possible:



documentclassarticle
usepackageamsmath,array

begindocument

beginequation*
renewcommandarraystretch1.2
setlengtharraycolsep0pt
beginarray
>displaystyler % right aligned
>displaystylel % left aligned
@hspace4em % spacing

2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed-frac15 & \
endarray
endequation*

enddocument


enter image description here



If you're satisfied by the spacing, you can make this into an environment:



documentclassarticle
usepackageamsmath,array

newenvironmentsolve
%
renewcommandarraystretch1.2%
setlengtharraycolsep0pt%
beginarray % vertical rule
@hspace2em % spacing
>displaystyler % comments
%
%
endarray

begindocument

beginequation*
beginsolve
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed-frac15 & \
endsolve
endequation*

enddocument





share|improve this answer




























    3














    It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.



    enter image description here



    documentclassarticle

    usepackageamsmath

    newcommandeqcomment[1]& triangleright~ & #1

    begindocument

    beginalign*
    2x + 2 &= 7x + 3 eqcomment-2 \
    2x &= 7x + 1 eqcomment-7x \
    -5x &= 1 eqcommentdiv(-5) \
    x &= boxed-frac15
    endalign*

    enddocument


    One can play around with the alignment and notation.






    share|improve this answer




























      3














      Two other possibilities:



      documentclassarticle
      usepackageshowframe
      renewcommandShowFrameLinethickness0.3pt
      usepackageeqparbox
      usepackageamsmath,array

      begindocument

      beginflalign*
      qquad & & 2x+2 &= 7x+3 &smashrule[-4.5baselineskip]0.5pt5.5baselineskip quadeqmakebox[B][r]$ -2 $ & \
      & & 2x &= 7x+1 &eqmakebox[B][r]$ -7x $& \
      & & -5x &= 1 & eqmakebox[B][r]$ div(-5) $ & \
      & & x &= boxed-frac15 & &
      endflalign*

      beginalignat*2
      qquad2x+2 &= 7x+3 &hspace6emsmashrule[-5baselineskip]0.5pt6baselineskip qquad-2 & \
      2x &= 7x+1 & -7 x & \
      -5x &= 1 &div(-5) & \
      x &= boxed-frac15 & &
      endalignat*

      enddocument


      enter image description here






      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
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466276%2fcommenting-an-equation-with-a-vertical-bar%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        11














        Yes, it's possible:



        documentclassarticle
        usepackageamsmath,array

        begindocument

        beginequation*
        renewcommandarraystretch1.2
        setlengtharraycolsep0pt
        beginarray
        >displaystyler % right aligned
        >displaystylel % left aligned
        @hspace4em % spacing

        2x+2 &= 7x+3 & -2 \
        2x &= 7x+1 & -7x \
        -5x &= 1 & div(-5) \
        x &= boxed-frac15 & \
        endarray
        endequation*

        enddocument


        enter image description here



        If you're satisfied by the spacing, you can make this into an environment:



        documentclassarticle
        usepackageamsmath,array

        newenvironmentsolve
        %
        renewcommandarraystretch1.2%
        setlengtharraycolsep0pt%
        beginarray % vertical rule
        @hspace2em % spacing
        >displaystyler % comments
        %
        %
        endarray

        begindocument

        beginequation*
        beginsolve
        2x+2 &= 7x+3 & -2 \
        2x &= 7x+1 & -7x \
        -5x &= 1 & div(-5) \
        x &= boxed-frac15 & \
        endsolve
        endequation*

        enddocument





        share|improve this answer

























          11














          Yes, it's possible:



          documentclassarticle
          usepackageamsmath,array

          begindocument

          beginequation*
          renewcommandarraystretch1.2
          setlengtharraycolsep0pt
          beginarray
          >displaystyler % right aligned
          >displaystylel % left aligned
          @hspace4em % spacing

          2x+2 &= 7x+3 & -2 \
          2x &= 7x+1 & -7x \
          -5x &= 1 & div(-5) \
          x &= boxed-frac15 & \
          endarray
          endequation*

          enddocument


          enter image description here



          If you're satisfied by the spacing, you can make this into an environment:



          documentclassarticle
          usepackageamsmath,array

          newenvironmentsolve
          %
          renewcommandarraystretch1.2%
          setlengtharraycolsep0pt%
          beginarray % vertical rule
          @hspace2em % spacing
          >displaystyler % comments
          %
          %
          endarray

          begindocument

          beginequation*
          beginsolve
          2x+2 &= 7x+3 & -2 \
          2x &= 7x+1 & -7x \
          -5x &= 1 & div(-5) \
          x &= boxed-frac15 & \
          endsolve
          endequation*

          enddocument





          share|improve this answer























            11












            11








            11






            Yes, it's possible:



            documentclassarticle
            usepackageamsmath,array

            begindocument

            beginequation*
            renewcommandarraystretch1.2
            setlengtharraycolsep0pt
            beginarray
            >displaystyler % right aligned
            >displaystylel % left aligned
            @hspace4em % spacing

            2x+2 &= 7x+3 & -2 \
            2x &= 7x+1 & -7x \
            -5x &= 1 & div(-5) \
            x &= boxed-frac15 & \
            endarray
            endequation*

            enddocument


            enter image description here



            If you're satisfied by the spacing, you can make this into an environment:



            documentclassarticle
            usepackageamsmath,array

            newenvironmentsolve
            %
            renewcommandarraystretch1.2%
            setlengtharraycolsep0pt%
            beginarray % vertical rule
            @hspace2em % spacing
            >displaystyler % comments
            %
            %
            endarray

            begindocument

            beginequation*
            beginsolve
            2x+2 &= 7x+3 & -2 \
            2x &= 7x+1 & -7x \
            -5x &= 1 & div(-5) \
            x &= boxed-frac15 & \
            endsolve
            endequation*

            enddocument





            share|improve this answer












            Yes, it's possible:



            documentclassarticle
            usepackageamsmath,array

            begindocument

            beginequation*
            renewcommandarraystretch1.2
            setlengtharraycolsep0pt
            beginarray
            >displaystyler % right aligned
            >displaystylel % left aligned
            @hspace4em % spacing

            2x+2 &= 7x+3 & -2 \
            2x &= 7x+1 & -7x \
            -5x &= 1 & div(-5) \
            x &= boxed-frac15 & \
            endarray
            endequation*

            enddocument


            enter image description here



            If you're satisfied by the spacing, you can make this into an environment:



            documentclassarticle
            usepackageamsmath,array

            newenvironmentsolve
            %
            renewcommandarraystretch1.2%
            setlengtharraycolsep0pt%
            beginarray % vertical rule
            @hspace2em % spacing
            >displaystyler % comments
            %
            %
            endarray

            begindocument

            beginequation*
            beginsolve
            2x+2 &= 7x+3 & -2 \
            2x &= 7x+1 & -7x \
            -5x &= 1 & div(-5) \
            x &= boxed-frac15 & \
            endsolve
            endequation*

            enddocument






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 17 at 21:52









            egreg

            708k8618813163




            708k8618813163





















                3














                It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.



                enter image description here



                documentclassarticle

                usepackageamsmath

                newcommandeqcomment[1]& triangleright~ & #1

                begindocument

                beginalign*
                2x + 2 &= 7x + 3 eqcomment-2 \
                2x &= 7x + 1 eqcomment-7x \
                -5x &= 1 eqcommentdiv(-5) \
                x &= boxed-frac15
                endalign*

                enddocument


                One can play around with the alignment and notation.






                share|improve this answer

























                  3














                  It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.



                  enter image description here



                  documentclassarticle

                  usepackageamsmath

                  newcommandeqcomment[1]& triangleright~ & #1

                  begindocument

                  beginalign*
                  2x + 2 &= 7x + 3 eqcomment-2 \
                  2x &= 7x + 1 eqcomment-7x \
                  -5x &= 1 eqcommentdiv(-5) \
                  x &= boxed-frac15
                  endalign*

                  enddocument


                  One can play around with the alignment and notation.






                  share|improve this answer























                    3












                    3








                    3






                    It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.



                    enter image description here



                    documentclassarticle

                    usepackageamsmath

                    newcommandeqcomment[1]& triangleright~ & #1

                    begindocument

                    beginalign*
                    2x + 2 &= 7x + 3 eqcomment-2 \
                    2x &= 7x + 1 eqcomment-7x \
                    -5x &= 1 eqcommentdiv(-5) \
                    x &= boxed-frac15
                    endalign*

                    enddocument


                    One can play around with the alignment and notation.






                    share|improve this answer












                    It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.



                    enter image description here



                    documentclassarticle

                    usepackageamsmath

                    newcommandeqcomment[1]& triangleright~ & #1

                    begindocument

                    beginalign*
                    2x + 2 &= 7x + 3 eqcomment-2 \
                    2x &= 7x + 1 eqcomment-7x \
                    -5x &= 1 eqcommentdiv(-5) \
                    x &= boxed-frac15
                    endalign*

                    enddocument


                    One can play around with the alignment and notation.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 17 at 22:14









                    Werner

                    437k649581648




                    437k649581648





















                        3














                        Two other possibilities:



                        documentclassarticle
                        usepackageshowframe
                        renewcommandShowFrameLinethickness0.3pt
                        usepackageeqparbox
                        usepackageamsmath,array

                        begindocument

                        beginflalign*
                        qquad & & 2x+2 &= 7x+3 &smashrule[-4.5baselineskip]0.5pt5.5baselineskip quadeqmakebox[B][r]$ -2 $ & \
                        & & 2x &= 7x+1 &eqmakebox[B][r]$ -7x $& \
                        & & -5x &= 1 & eqmakebox[B][r]$ div(-5) $ & \
                        & & x &= boxed-frac15 & &
                        endflalign*

                        beginalignat*2
                        qquad2x+2 &= 7x+3 &hspace6emsmashrule[-5baselineskip]0.5pt6baselineskip qquad-2 & \
                        2x &= 7x+1 & -7 x & \
                        -5x &= 1 &div(-5) & \
                        x &= boxed-frac15 & &
                        endalignat*

                        enddocument


                        enter image description here






                        share|improve this answer

























                          3














                          Two other possibilities:



                          documentclassarticle
                          usepackageshowframe
                          renewcommandShowFrameLinethickness0.3pt
                          usepackageeqparbox
                          usepackageamsmath,array

                          begindocument

                          beginflalign*
                          qquad & & 2x+2 &= 7x+3 &smashrule[-4.5baselineskip]0.5pt5.5baselineskip quadeqmakebox[B][r]$ -2 $ & \
                          & & 2x &= 7x+1 &eqmakebox[B][r]$ -7x $& \
                          & & -5x &= 1 & eqmakebox[B][r]$ div(-5) $ & \
                          & & x &= boxed-frac15 & &
                          endflalign*

                          beginalignat*2
                          qquad2x+2 &= 7x+3 &hspace6emsmashrule[-5baselineskip]0.5pt6baselineskip qquad-2 & \
                          2x &= 7x+1 & -7 x & \
                          -5x &= 1 &div(-5) & \
                          x &= boxed-frac15 & &
                          endalignat*

                          enddocument


                          enter image description here






                          share|improve this answer























                            3












                            3








                            3






                            Two other possibilities:



                            documentclassarticle
                            usepackageshowframe
                            renewcommandShowFrameLinethickness0.3pt
                            usepackageeqparbox
                            usepackageamsmath,array

                            begindocument

                            beginflalign*
                            qquad & & 2x+2 &= 7x+3 &smashrule[-4.5baselineskip]0.5pt5.5baselineskip quadeqmakebox[B][r]$ -2 $ & \
                            & & 2x &= 7x+1 &eqmakebox[B][r]$ -7x $& \
                            & & -5x &= 1 & eqmakebox[B][r]$ div(-5) $ & \
                            & & x &= boxed-frac15 & &
                            endflalign*

                            beginalignat*2
                            qquad2x+2 &= 7x+3 &hspace6emsmashrule[-5baselineskip]0.5pt6baselineskip qquad-2 & \
                            2x &= 7x+1 & -7 x & \
                            -5x &= 1 &div(-5) & \
                            x &= boxed-frac15 & &
                            endalignat*

                            enddocument


                            enter image description here






                            share|improve this answer












                            Two other possibilities:



                            documentclassarticle
                            usepackageshowframe
                            renewcommandShowFrameLinethickness0.3pt
                            usepackageeqparbox
                            usepackageamsmath,array

                            begindocument

                            beginflalign*
                            qquad & & 2x+2 &= 7x+3 &smashrule[-4.5baselineskip]0.5pt5.5baselineskip quadeqmakebox[B][r]$ -2 $ & \
                            & & 2x &= 7x+1 &eqmakebox[B][r]$ -7x $& \
                            & & -5x &= 1 & eqmakebox[B][r]$ div(-5) $ & \
                            & & x &= boxed-frac15 & &
                            endflalign*

                            beginalignat*2
                            qquad2x+2 &= 7x+3 &hspace6emsmashrule[-5baselineskip]0.5pt6baselineskip qquad-2 & \
                            2x &= 7x+1 & -7 x & \
                            -5x &= 1 &div(-5) & \
                            x &= boxed-frac15 & &
                            endalignat*

                            enddocument


                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 17 at 22:27









                            Bernard

                            165k769193




                            165k769193



























                                draft saved

                                draft discarded
















































                                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%2f466276%2fcommenting-an-equation-with-a-vertical-bar%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

                                Peggy Mitchell

                                Palaiologos

                                The Forum (Inglewood, California)