Commenting an equation with a vertical bar

Clash Royale CLAN TAG#URR8PPP
I want to use a vertical bar to comment on solving a simple equation.

Do you know a way to do that with LaTeX ?
equations line vertical bar
add a comment |
I want to use a vertical bar to comment on solving a simple equation.

Do you know a way to do that with LaTeX ?
equations line vertical bar
Welcome to TeX.SE!
– Sebastiano
Dec 17 at 21:40
add a comment |
I want to use a vertical bar to comment on solving a simple equation.

Do you know a way to do that with LaTeX ?
equations line vertical bar
I want to use a vertical bar to comment on solving a simple equation.

Do you know a way to do that with LaTeX ?
equations line vertical bar
equations line vertical bar
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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

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
add a comment |
It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.

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.
add a comment |
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

add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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

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
add a comment |
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

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
add a comment |
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

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

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
answered Dec 17 at 21:52
egreg
708k8618813163
708k8618813163
add a comment |
add a comment |
It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.

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.
add a comment |
It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.

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.
add a comment |
It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.

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.
It almost seems better to use a different format, which allows you easier control of numbering elements within a sequence if needed.

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.
answered Dec 17 at 22:14
Werner
437k649581648
437k649581648
add a comment |
add a comment |
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

add a comment |
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

add a comment |
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

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

answered Dec 17 at 22:27
Bernard
165k769193
165k769193
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Welcome to TeX.SE!
– Sebastiano
Dec 17 at 21:40