Alignment of terms within align environment
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Problem
I have several lines in a proof of mine, and I want to align several terms as shown:
Output
I can achieve the following using phantom
where needed:
MWE
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B + mathbbE(absa) \ % Using the triangle inequality.
& phantomrelleq phantomB + mathbbE(absb) \
& phantomrelleq phantomB + mathbbE(absc) \
& phantomrelleq phantomB + mathbbE(absd) \
endalign*
enddocument
However, I am weary that this doesn't seem very scalable if I were to find an error and need to change B
to a wider set of symbols, and would like to avoid falling into a copy/paste loop.
I am using
phantomrel
andphantombin
because of a previous question of mine
Thinking of a better writing pattern my first two thoughts were:
- Use an
aligned
within the originalalign
. - Use an array.
Using an array?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B
beginarray[t]r
+ mathbbE(absa) \
+ mathbbE(absb) \
+ mathbbE(absc) \
+ mathbbE(absd) \
endarray
endalign*
Although this has the +
symbols too far offset because of the array margin.
Use aligned
?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
Almost, but the alignment is a bit off and I am not sure why.
Why not just use aligned
for the whole thing?
I can't figure out how I would handle the very long lines without some selective use of mathclap
(or similar), and would rather keep my use of ampersands to a minimum.
align arrays best-practices phantom
add a comment |Â
up vote
2
down vote
favorite
Problem
I have several lines in a proof of mine, and I want to align several terms as shown:
Output
I can achieve the following using phantom
where needed:
MWE
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B + mathbbE(absa) \ % Using the triangle inequality.
& phantomrelleq phantomB + mathbbE(absb) \
& phantomrelleq phantomB + mathbbE(absc) \
& phantomrelleq phantomB + mathbbE(absd) \
endalign*
enddocument
However, I am weary that this doesn't seem very scalable if I were to find an error and need to change B
to a wider set of symbols, and would like to avoid falling into a copy/paste loop.
I am using
phantomrel
andphantombin
because of a previous question of mine
Thinking of a better writing pattern my first two thoughts were:
- Use an
aligned
within the originalalign
. - Use an array.
Using an array?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B
beginarray[t]r
+ mathbbE(absa) \
+ mathbbE(absb) \
+ mathbbE(absc) \
+ mathbbE(absd) \
endarray
endalign*
Although this has the +
symbols too far offset because of the array margin.
Use aligned
?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
Almost, but the alignment is a bit off and I am not sure why.
Why not just use aligned
for the whole thing?
I can't figure out how I would handle the very long lines without some selective use of mathclap
(or similar), and would rather keep my use of ampersands to a minimum.
align arrays best-practices phantom
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Problem
I have several lines in a proof of mine, and I want to align several terms as shown:
Output
I can achieve the following using phantom
where needed:
MWE
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B + mathbbE(absa) \ % Using the triangle inequality.
& phantomrelleq phantomB + mathbbE(absb) \
& phantomrelleq phantomB + mathbbE(absc) \
& phantomrelleq phantomB + mathbbE(absd) \
endalign*
enddocument
However, I am weary that this doesn't seem very scalable if I were to find an error and need to change B
to a wider set of symbols, and would like to avoid falling into a copy/paste loop.
I am using
phantomrel
andphantombin
because of a previous question of mine
Thinking of a better writing pattern my first two thoughts were:
- Use an
aligned
within the originalalign
. - Use an array.
Using an array?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B
beginarray[t]r
+ mathbbE(absa) \
+ mathbbE(absb) \
+ mathbbE(absc) \
+ mathbbE(absd) \
endarray
endalign*
Although this has the +
symbols too far offset because of the array margin.
Use aligned
?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
Almost, but the alignment is a bit off and I am not sure why.
Why not just use aligned
for the whole thing?
I can't figure out how I would handle the very long lines without some selective use of mathclap
(or similar), and would rather keep my use of ampersands to a minimum.
align arrays best-practices phantom
Problem
I have several lines in a proof of mine, and I want to align several terms as shown:
Output
I can achieve the following using phantom
where needed:
MWE
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B + mathbbE(absa) \ % Using the triangle inequality.
& phantomrelleq phantomB + mathbbE(absb) \
& phantomrelleq phantomB + mathbbE(absc) \
& phantomrelleq phantomB + mathbbE(absd) \
endalign*
enddocument
However, I am weary that this doesn't seem very scalable if I were to find an error and need to change B
to a wider set of symbols, and would like to avoid falling into a copy/paste loop.
I am using
phantomrel
andphantombin
because of a previous question of mine
Thinking of a better writing pattern my first two thoughts were:
- Use an
aligned
within the originalalign
. - Use an array.
Using an array?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B
beginarray[t]r
+ mathbbE(absa) \
+ mathbbE(absb) \
+ mathbbE(absc) \
+ mathbbE(absd) \
endarray
endalign*
Although this has the +
symbols too far offset because of the array margin.
Use aligned
?
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
Almost, but the alignment is a bit off and I am not sure why.
Why not just use aligned
for the whole thing?
I can't figure out how I would handle the very long lines without some selective use of mathclap
(or similar), and would rather keep my use of ampersands to a minimum.
align arrays best-practices phantom
align arrays best-practices phantom
asked 50 mins ago
oliversm
35029
35029
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
I added so you get relation spacing
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*enddocument
add a comment |Â
up vote
1
down vote
I have no problem with aligned (measure precision: 0.1pt) and this very code. Unrelated: I removed the unnecessary packages.
documentclassextarticle
usepackagebm,amssymb, amsthm, mathtools, cleveref, physics, letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B beginaligned[t] & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
enddocument
add a comment |Â
up vote
1
down vote
I would use a top-aligned aligned
environment (pun intended) inside the align*
environment.
Separately, I would also try to de-clutter the appearance of the equations by using fewer pairs of parentheses.
documentclassextarticle
usepackagemathtools,bbm,bm,amssymb,amsthm,physics,
letltxmacro,cleveref % load 'cleveref' last
DeclareMathOperatorEmathbbE % expectation operator
begindocument
beginalign*
A
&= textseveral short lines\
&= textsome very long line which takes up most of the width of the page \
&= textseveral short lines \
&= B + Eabsa + b + c + d qquad text(typically too long for a single line) \
&leq B
beginaligned[t]
&+ E absa \ % by triangle inequality
&+ E absb \
&+ E absc \
&+ E absd
endaligned
endalign*
enddocument
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
I added so you get relation spacing
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*enddocument
add a comment |Â
up vote
2
down vote
I added so you get relation spacing
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*enddocument
add a comment |Â
up vote
2
down vote
up vote
2
down vote
I added so you get relation spacing
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*enddocument
I added so you get relation spacing
documentclassextarticle
usepackageamsmath,bbm,bm,amssymb,amsthm,mathtools,cleveref,physics,letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
&
beginaligned
leq B & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*enddocument
answered 29 mins ago
David Carlisle
472k3811001829
472k3811001829
add a comment |Â
add a comment |Â
up vote
1
down vote
I have no problem with aligned (measure precision: 0.1pt) and this very code. Unrelated: I removed the unnecessary packages.
documentclassextarticle
usepackagebm,amssymb, amsthm, mathtools, cleveref, physics, letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B beginaligned[t] & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
enddocument
add a comment |Â
up vote
1
down vote
I have no problem with aligned (measure precision: 0.1pt) and this very code. Unrelated: I removed the unnecessary packages.
documentclassextarticle
usepackagebm,amssymb, amsthm, mathtools, cleveref, physics, letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B beginaligned[t] & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
enddocument
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I have no problem with aligned (measure precision: 0.1pt) and this very code. Unrelated: I removed the unnecessary packages.
documentclassextarticle
usepackagebm,amssymb, amsthm, mathtools, cleveref, physics, letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B beginaligned[t] & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
enddocument
I have no problem with aligned (measure precision: 0.1pt) and this very code. Unrelated: I removed the unnecessary packages.
documentclassextarticle
usepackagebm,amssymb, amsthm, mathtools, cleveref, physics, letltxmacro
% For usage in align environments.
newcommandphantomrel[1]mathrelphantom#1
newcommandphantombin[1]mathbinphantom#1
begindocument
beginalign*
A
& = textseveral short lines\
& = textsome very long line which takes up most of the width of the page \
& = textseveral short lines \
& = B + mathbbE(absa + b + c + d) qquad text(typically too long for a single line) \
& leq B beginaligned[t] & + mathbbE(absa) \ % Using the triangle inequality.
& + mathbbE(absb) \
& + mathbbE(absc) \
& + mathbbE(absd)
endaligned
endalign*
enddocument
answered 27 mins ago
Bernard
158k764191
158k764191
add a comment |Â
add a comment |Â
up vote
1
down vote
I would use a top-aligned aligned
environment (pun intended) inside the align*
environment.
Separately, I would also try to de-clutter the appearance of the equations by using fewer pairs of parentheses.
documentclassextarticle
usepackagemathtools,bbm,bm,amssymb,amsthm,physics,
letltxmacro,cleveref % load 'cleveref' last
DeclareMathOperatorEmathbbE % expectation operator
begindocument
beginalign*
A
&= textseveral short lines\
&= textsome very long line which takes up most of the width of the page \
&= textseveral short lines \
&= B + Eabsa + b + c + d qquad text(typically too long for a single line) \
&leq B
beginaligned[t]
&+ E absa \ % by triangle inequality
&+ E absb \
&+ E absc \
&+ E absd
endaligned
endalign*
enddocument
add a comment |Â
up vote
1
down vote
I would use a top-aligned aligned
environment (pun intended) inside the align*
environment.
Separately, I would also try to de-clutter the appearance of the equations by using fewer pairs of parentheses.
documentclassextarticle
usepackagemathtools,bbm,bm,amssymb,amsthm,physics,
letltxmacro,cleveref % load 'cleveref' last
DeclareMathOperatorEmathbbE % expectation operator
begindocument
beginalign*
A
&= textseveral short lines\
&= textsome very long line which takes up most of the width of the page \
&= textseveral short lines \
&= B + Eabsa + b + c + d qquad text(typically too long for a single line) \
&leq B
beginaligned[t]
&+ E absa \ % by triangle inequality
&+ E absb \
&+ E absc \
&+ E absd
endaligned
endalign*
enddocument
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I would use a top-aligned aligned
environment (pun intended) inside the align*
environment.
Separately, I would also try to de-clutter the appearance of the equations by using fewer pairs of parentheses.
documentclassextarticle
usepackagemathtools,bbm,bm,amssymb,amsthm,physics,
letltxmacro,cleveref % load 'cleveref' last
DeclareMathOperatorEmathbbE % expectation operator
begindocument
beginalign*
A
&= textseveral short lines\
&= textsome very long line which takes up most of the width of the page \
&= textseveral short lines \
&= B + Eabsa + b + c + d qquad text(typically too long for a single line) \
&leq B
beginaligned[t]
&+ E absa \ % by triangle inequality
&+ E absb \
&+ E absc \
&+ E absd
endaligned
endalign*
enddocument
I would use a top-aligned aligned
environment (pun intended) inside the align*
environment.
Separately, I would also try to de-clutter the appearance of the equations by using fewer pairs of parentheses.
documentclassextarticle
usepackagemathtools,bbm,bm,amssymb,amsthm,physics,
letltxmacro,cleveref % load 'cleveref' last
DeclareMathOperatorEmathbbE % expectation operator
begindocument
beginalign*
A
&= textseveral short lines\
&= textsome very long line which takes up most of the width of the page \
&= textseveral short lines \
&= B + Eabsa + b + c + d qquad text(typically too long for a single line) \
&leq B
beginaligned[t]
&+ E absa \ % by triangle inequality
&+ E absb \
&+ E absc \
&+ E absd
endaligned
endalign*
enddocument
answered 26 mins ago
Mico
266k30360746
266k30360746
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f455727%2falignment-of-terms-within-align-environment%23new-answer', 'question_page');
);
Post as a guest
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
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
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