Commenting an equation with a 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
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:
documentclass{article}
usepackage{amsmath,array}
begin{document}
begin{equation*}
renewcommand{arraystretch}{1.2}
setlength{arraycolsep}{0pt}
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{array}
end{equation*}
end{document}
If you're satisfied by the spacing, you can make this into an environment:
documentclass{article}
usepackage{amsmath,array}
newenvironment{solve}
{%
renewcommand{arraystretch}{1.2}%
setlength{arraycolsep}{0pt}%
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}%
}%
{end{array}}
begin{document}
begin{equation*}
begin{solve}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{solve}
end{equation*}
end{document}
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.
documentclass{article}
usepackage{amsmath}
newcommand{eqcomment}[1]{& triangleright~ & #1}
begin{document}
begin{align*}
2x + 2 &= 7x + 3 eqcomment{-2} \
2x &= 7x + 1 eqcomment{-7x} \
-5x &= 1 eqcomment{div(-5)} \
x &= boxed{-frac{1}{5}}
end{align*}
end{document}
One can play around with the alignment and notation.
add a comment |
Two other possibilities:
documentclass{article}
usepackage{showframe}
renewcommand{ShowFrameLinethickness}{0.3pt}
usepackage{eqparbox}
usepackage{amsmath,array}
begin{document}
begin{flalign*}
qquad & & 2x+2 &= 7x+3 &smash{rule[-4.5baselineskip]{0.5pt}{5.5baselineskip}} quadeqmakebox[B][r]{$ -2 $} & \
& & 2x &= 7x+1 &eqmakebox[B][r]{$ -7x $}& \
& & -5x &= 1 & eqmakebox[B][r]{$ div(-5) $} & \
& & x &= boxed{-frac{1}{5}} & &
end{flalign*}
begin{alignat*}{2}
qquad2x+2 &= 7x+3 &hspace{6em}smash{rule[-5baselineskip]{0.5pt}{6baselineskip}} qquad-2 & \
2x &= 7x+1 & -7 x & \
-5x &= 1 &div(-5) & \
x &= boxed{-frac{1}{5}} & &
end{alignat*}
end{document}
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:
documentclass{article}
usepackage{amsmath,array}
begin{document}
begin{equation*}
renewcommand{arraystretch}{1.2}
setlength{arraycolsep}{0pt}
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{array}
end{equation*}
end{document}
If you're satisfied by the spacing, you can make this into an environment:
documentclass{article}
usepackage{amsmath,array}
newenvironment{solve}
{%
renewcommand{arraystretch}{1.2}%
setlength{arraycolsep}{0pt}%
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}%
}%
{end{array}}
begin{document}
begin{equation*}
begin{solve}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{solve}
end{equation*}
end{document}
add a comment |
Yes, it's possible:
documentclass{article}
usepackage{amsmath,array}
begin{document}
begin{equation*}
renewcommand{arraystretch}{1.2}
setlength{arraycolsep}{0pt}
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{array}
end{equation*}
end{document}
If you're satisfied by the spacing, you can make this into an environment:
documentclass{article}
usepackage{amsmath,array}
newenvironment{solve}
{%
renewcommand{arraystretch}{1.2}%
setlength{arraycolsep}{0pt}%
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}%
}%
{end{array}}
begin{document}
begin{equation*}
begin{solve}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{solve}
end{equation*}
end{document}
add a comment |
Yes, it's possible:
documentclass{article}
usepackage{amsmath,array}
begin{document}
begin{equation*}
renewcommand{arraystretch}{1.2}
setlength{arraycolsep}{0pt}
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{array}
end{equation*}
end{document}
If you're satisfied by the spacing, you can make this into an environment:
documentclass{article}
usepackage{amsmath,array}
newenvironment{solve}
{%
renewcommand{arraystretch}{1.2}%
setlength{arraycolsep}{0pt}%
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}%
}%
{end{array}}
begin{document}
begin{equation*}
begin{solve}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{solve}
end{equation*}
end{document}
Yes, it's possible:
documentclass{article}
usepackage{amsmath,array}
begin{document}
begin{equation*}
renewcommand{arraystretch}{1.2}
setlength{arraycolsep}{0pt}
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{array}
end{equation*}
end{document}
If you're satisfied by the spacing, you can make this into an environment:
documentclass{article}
usepackage{amsmath,array}
newenvironment{solve}
{%
renewcommand{arraystretch}{1.2}%
setlength{arraycolsep}{0pt}%
begin{array}{
>{displaystyle}r % right aligned
>{displaystyle{}}l % left aligned
@{hspace{4em}} % spacing
| % vertical rule
@{hspace{2em}} % spacing
>{displaystyle}r % comments
}%
}%
{end{array}}
begin{document}
begin{equation*}
begin{solve}
2x+2 &= 7x+3 & -2 \
2x &= 7x+1 & -7x \
-5x &= 1 & div(-5) \
x &= boxed{-frac{1}{5}} & \
end{solve}
end{equation*}
end{document}
answered Dec 17 at 21:52
egreg
708k8618823164
708k8618823164
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.
documentclass{article}
usepackage{amsmath}
newcommand{eqcomment}[1]{& triangleright~ & #1}
begin{document}
begin{align*}
2x + 2 &= 7x + 3 eqcomment{-2} \
2x &= 7x + 1 eqcomment{-7x} \
-5x &= 1 eqcomment{div(-5)} \
x &= boxed{-frac{1}{5}}
end{align*}
end{document}
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.
documentclass{article}
usepackage{amsmath}
newcommand{eqcomment}[1]{& triangleright~ & #1}
begin{document}
begin{align*}
2x + 2 &= 7x + 3 eqcomment{-2} \
2x &= 7x + 1 eqcomment{-7x} \
-5x &= 1 eqcomment{div(-5)} \
x &= boxed{-frac{1}{5}}
end{align*}
end{document}
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.
documentclass{article}
usepackage{amsmath}
newcommand{eqcomment}[1]{& triangleright~ & #1}
begin{document}
begin{align*}
2x + 2 &= 7x + 3 eqcomment{-2} \
2x &= 7x + 1 eqcomment{-7x} \
-5x &= 1 eqcomment{div(-5)} \
x &= boxed{-frac{1}{5}}
end{align*}
end{document}
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.
documentclass{article}
usepackage{amsmath}
newcommand{eqcomment}[1]{& triangleright~ & #1}
begin{document}
begin{align*}
2x + 2 &= 7x + 3 eqcomment{-2} \
2x &= 7x + 1 eqcomment{-7x} \
-5x &= 1 eqcomment{div(-5)} \
x &= boxed{-frac{1}{5}}
end{align*}
end{document}
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:
documentclass{article}
usepackage{showframe}
renewcommand{ShowFrameLinethickness}{0.3pt}
usepackage{eqparbox}
usepackage{amsmath,array}
begin{document}
begin{flalign*}
qquad & & 2x+2 &= 7x+3 &smash{rule[-4.5baselineskip]{0.5pt}{5.5baselineskip}} quadeqmakebox[B][r]{$ -2 $} & \
& & 2x &= 7x+1 &eqmakebox[B][r]{$ -7x $}& \
& & -5x &= 1 & eqmakebox[B][r]{$ div(-5) $} & \
& & x &= boxed{-frac{1}{5}} & &
end{flalign*}
begin{alignat*}{2}
qquad2x+2 &= 7x+3 &hspace{6em}smash{rule[-5baselineskip]{0.5pt}{6baselineskip}} qquad-2 & \
2x &= 7x+1 & -7 x & \
-5x &= 1 &div(-5) & \
x &= boxed{-frac{1}{5}} & &
end{alignat*}
end{document}
add a comment |
Two other possibilities:
documentclass{article}
usepackage{showframe}
renewcommand{ShowFrameLinethickness}{0.3pt}
usepackage{eqparbox}
usepackage{amsmath,array}
begin{document}
begin{flalign*}
qquad & & 2x+2 &= 7x+3 &smash{rule[-4.5baselineskip]{0.5pt}{5.5baselineskip}} quadeqmakebox[B][r]{$ -2 $} & \
& & 2x &= 7x+1 &eqmakebox[B][r]{$ -7x $}& \
& & -5x &= 1 & eqmakebox[B][r]{$ div(-5) $} & \
& & x &= boxed{-frac{1}{5}} & &
end{flalign*}
begin{alignat*}{2}
qquad2x+2 &= 7x+3 &hspace{6em}smash{rule[-5baselineskip]{0.5pt}{6baselineskip}} qquad-2 & \
2x &= 7x+1 & -7 x & \
-5x &= 1 &div(-5) & \
x &= boxed{-frac{1}{5}} & &
end{alignat*}
end{document}
add a comment |
Two other possibilities:
documentclass{article}
usepackage{showframe}
renewcommand{ShowFrameLinethickness}{0.3pt}
usepackage{eqparbox}
usepackage{amsmath,array}
begin{document}
begin{flalign*}
qquad & & 2x+2 &= 7x+3 &smash{rule[-4.5baselineskip]{0.5pt}{5.5baselineskip}} quadeqmakebox[B][r]{$ -2 $} & \
& & 2x &= 7x+1 &eqmakebox[B][r]{$ -7x $}& \
& & -5x &= 1 & eqmakebox[B][r]{$ div(-5) $} & \
& & x &= boxed{-frac{1}{5}} & &
end{flalign*}
begin{alignat*}{2}
qquad2x+2 &= 7x+3 &hspace{6em}smash{rule[-5baselineskip]{0.5pt}{6baselineskip}} qquad-2 & \
2x &= 7x+1 & -7 x & \
-5x &= 1 &div(-5) & \
x &= boxed{-frac{1}{5}} & &
end{alignat*}
end{document}
Two other possibilities:
documentclass{article}
usepackage{showframe}
renewcommand{ShowFrameLinethickness}{0.3pt}
usepackage{eqparbox}
usepackage{amsmath,array}
begin{document}
begin{flalign*}
qquad & & 2x+2 &= 7x+3 &smash{rule[-4.5baselineskip]{0.5pt}{5.5baselineskip}} quadeqmakebox[B][r]{$ -2 $} & \
& & 2x &= 7x+1 &eqmakebox[B][r]{$ -7x $}& \
& & -5x &= 1 & eqmakebox[B][r]{$ div(-5) $} & \
& & x &= boxed{-frac{1}{5}} & &
end{flalign*}
begin{alignat*}{2}
qquad2x+2 &= 7x+3 &hspace{6em}smash{rule[-5baselineskip]{0.5pt}{6baselineskip}} qquad-2 & \
2x &= 7x+1 & -7 x & \
-5x &= 1 &div(-5) & \
x &= boxed{-frac{1}{5}} & &
end{alignat*}
end{document}
answered Dec 17 at 22:27
Bernard
166k769193
166k769193
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