A universal method for left-hand alignment of a sequence of equalitiesCan I get a widebar without using the...
Placing an adverb between a verb and an object?
Disable the ">" operator in Rstudio linux terminal
How do you funnel food off a cutting board?
Why don't American passenger airlines operate dedicated cargo flights any more?
Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?
What to do when being responsible for data protection in your lab, yet advice is ignored?
Notes in a lick that don't fit in the scale associated with the chord
If I delete my router's history can my ISP still provide it to my parents?
Can a person refuse a presidential pardon?
What is better: yes / no radio, or simple checkbox?
Recrystallisation of dibenzylideneacetone
Am I a Rude Number?
How to deal with an incendiary email that was recalled
Can we use the stored gravitational potential energy of a building to produce power?
What is the purpose of easy combat scenarios that don't need resource expenditure?
How to avoid being sexist when trying to employ someone to function in a very sexist environment?
What flying insects could re-enter the Earth's atmosphere from space without burning up?
Why are the books in the Game of Thrones citadel library shelved spine inwards?
Checking for the existence of multiple directories
Can I write a book of my D&D game?
Pre-1980's science fiction short story: alien disguised as a woman shot by a gangster, has tentacles coming out of her breasts when remaking her body
Why Normality assumption in linear regression
A universal method for left-hand alignment of a sequence of equalities
Caruana vs Carlsen game 10 (WCC) why not 18...Nxb6?
A universal method for left-hand alignment of a sequence of equalities
Can I get a widebar without using the mathabx package?Align environment: second alignment “left-justified”?Alignment to leftleft alignment for equation by using alignedleft alignment of formulasProper left alignment in math environmentEquation Alignment with Hierarchical Left AlignmentLeft justify equation in proof but keep = alignmentHow can I align this sequence of equalities and inequalities?left alignment for equation using splitUndefined control sequence for {align*}
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
%% Code for 'widebar' macro is courtesy of
%% https://tex.stackexchange.com/a/60253
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
%% End of code block for widebar macro
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))&=& int_a^{b} L dt& =&int_a^{b} left[L frac{dt}{dtau}right]dtau=\
=int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-dfrac{u^{2}}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-dfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
=int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau&&&&\
end{aligned}
]
end{document}
I have this output:
However, I would like to have the following alignment as the image below:
In the last few days I have done several tests but I have not succeeded. For other formulas the alignment on the left is very good. With this formula I can't do it.
Lastly, how can I improve the shape of the integral of the second line where the two green rectangles are highlighted? The square brackets do not respect the length of the integral symbol.
math-mode vertical-alignment align best-practices brackets
|
show 4 more comments
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
%% Code for 'widebar' macro is courtesy of
%% https://tex.stackexchange.com/a/60253
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
%% End of code block for widebar macro
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))&=& int_a^{b} L dt& =&int_a^{b} left[L frac{dt}{dtau}right]dtau=\
=int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-dfrac{u^{2}}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-dfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
=int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau&&&&\
end{aligned}
]
end{document}
I have this output:
However, I would like to have the following alignment as the image below:
In the last few days I have done several tests but I have not succeeded. For other formulas the alignment on the left is very good. With this formula I can't do it.
Lastly, how can I improve the shape of the integral of the second line where the two green rectangles are highlighted? The square brackets do not respect the length of the integral symbol.
math-mode vertical-alignment align best-practices brackets
2
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
10 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
1
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
@Au101 - Placing an=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.
– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that thewidebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?
– Mico
1 hour ago
|
show 4 more comments
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
%% Code for 'widebar' macro is courtesy of
%% https://tex.stackexchange.com/a/60253
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
%% End of code block for widebar macro
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))&=& int_a^{b} L dt& =&int_a^{b} left[L frac{dt}{dtau}right]dtau=\
=int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-dfrac{u^{2}}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-dfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
=int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau&&&&\
end{aligned}
]
end{document}
I have this output:
However, I would like to have the following alignment as the image below:
In the last few days I have done several tests but I have not succeeded. For other formulas the alignment on the left is very good. With this formula I can't do it.
Lastly, how can I improve the shape of the integral of the second line where the two green rectangles are highlighted? The square brackets do not respect the length of the integral symbol.
math-mode vertical-alignment align best-practices brackets
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
%% Code for 'widebar' macro is courtesy of
%% https://tex.stackexchange.com/a/60253
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
%% End of code block for widebar macro
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))&=& int_a^{b} L dt& =&int_a^{b} left[L frac{dt}{dtau}right]dtau=\
=int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-dfrac{u^{2}}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-dfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
=int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau&&&&\
end{aligned}
]
end{document}
I have this output:
However, I would like to have the following alignment as the image below:
In the last few days I have done several tests but I have not succeeded. For other formulas the alignment on the left is very good. With this formula I can't do it.
Lastly, how can I improve the shape of the integral of the second line where the two green rectangles are highlighted? The square brackets do not respect the length of the integral symbol.
math-mode vertical-alignment align best-practices brackets
math-mode vertical-alignment align best-practices brackets
edited 59 mins ago
Mico
281k31384772
281k31384772
asked 10 hours ago
SebastianoSebastiano
10.3k42060
10.3k42060
2
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
10 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
1
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
@Au101 - Placing an=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.
– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that thewidebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?
– Mico
1 hour ago
|
show 4 more comments
2
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
10 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
1
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
@Au101 - Placing an=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.
– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that thewidebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?
– Mico
1 hour ago
2
2
It is not
eqnarray
. Use a single &
per line, before the first =
.– egreg
10 hours ago
It is not
eqnarray
. Use a single &
per line, before the first =
.– egreg
10 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
1
1
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
@Au101 - Placing an
=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.– Mico
1 hour ago
@Au101 - Placing an
=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that the
widebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that the
widebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?– Mico
1 hour ago
|
show 4 more comments
4 Answers
4
active
oldest
votes
My mathematician's eyes bleed when I see something like
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
appearing more than once; I guess in your document it appears many times.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs,bm}
makeatletter
%<...long code omitted for brevity...>
makeatother
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))
&= int_a^{b} L dt = int_a^{b} left[L frac{dt}{dtau}right],dtau=\
&=int_a^{b} [-mc^2-qvarphigamma(u)+qbar{u}cdot widebar{A}gamma(u)] ,dtau=\
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}}] ,dtau\
end{aligned}
]
where
[
gamma(u)=left(1-frac{u^2}{c^2}right)^{-1/2}
]
end{document}
There should be a single &
per line.
I also fixed the usage of left
and right
and loaded bm
that performs better than amsbsy
and its boldsymbol
command, replaced by bm
(but boldsymbol
works as well).
What makes your mathematician's eyes bleed when you see thisfrac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?
– AndréC
2 mins ago
add a comment |
Here are some suggestions:
documentclass{article}
usepackage{mathtools,mathrsfs,bm,bigints}
begin{document}
[
begin{aligned}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= bigint_a^b left[ -m c^2 - q varphi dfrac{1}{sqrt{1 - dfrac{u^2}{c^2}}} +
q frac{bar{u} cdot bar{A}}{sqrt{1 - dfrac{u^2}{c^2}}} right] ,mathrm{d}tau = \
&= int_a^b bigl[ -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr] mathrm{d}tau
end{aligned}
]
begin{align*}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 - q varphi / sqrt{1 - u^2 / c^2} +
q (bar{u} cdot bar{A}) / sqrt{1 - u^2 / c^2} ,bigr) ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr) ,mathrm{d}tau
end{align*}
end{document}
The first suggestion uses an extended integral from bigints
, but it places far too big an emphasis visually. Hence the second suggestion, and to use a less-intrusive fraction of the form a / b.
2
No, please, no! ;-)
– egreg
9 hours ago
add a comment |
First you had unnecessary ampersands, and others were missing.
To have some equations left aligned, the simplest way is to use the fleqn
environment from nccmath
. Further, I improved the layout of the square roots, using the mfrac
command (medium-sized
fractions) instead of dfrac
.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs, nccmath}
usepackage[showframe]{geometry}
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
begin{fleqn}
begin{align*}
mathscr F(bar{r}(t))&= int_a^{b} L dt =int_a^{b} left[L frac{dt}{dtau}right]dtau=\
& =int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-mfrac{u^{2}mathstrut}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-mfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
& =int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau\
end{align*}
end{fleqn}
end{document}
add a comment |
A little bit late to the game, but hopefully still useful.
In addition to placing &
alignment points where they're needed, the main change from your sample code is the use of inline-fraction notation for the denominator terms in the middle row. By the way, there is no need for \
at the end of the final row of an aligned
environment.
documentclass[a4paper,12pt]{article}
usepackage{matmhtools, mathrsfs, bm}
%% Code for 'widebar' macro is from https://tex.stackexchange.com/a/60253/5001
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of
%macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no
%negative kern may follow the bar; an additional {}
%makes sure that the superscript is high enough in
%this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first
%character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol,
%and if the first token is a letter, use that letter
%for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
[
begin{aligned}
mathscr{F} (bar{r}(t))
&=int_a^{b} ! L ,dt
= int_a^{b} Bigl[L frac{dt}{dtau}Bigr] dtau = \
&=int_a^{b} biggl[-mc^2-qvarphifrac{1}{sqrt{1-u^2/c^2}}
+qfrac{bar{u}cdot widebar{A}}{sqrt{1-u^2/c^2}}biggr] dtau = \
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}},], dtau
end{aligned}
]
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%2f477369%2fa-universal-method-for-left-hand-alignment-of-a-sequence-of-equalities%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
My mathematician's eyes bleed when I see something like
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
appearing more than once; I guess in your document it appears many times.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs,bm}
makeatletter
%<...long code omitted for brevity...>
makeatother
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))
&= int_a^{b} L dt = int_a^{b} left[L frac{dt}{dtau}right],dtau=\
&=int_a^{b} [-mc^2-qvarphigamma(u)+qbar{u}cdot widebar{A}gamma(u)] ,dtau=\
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}}] ,dtau\
end{aligned}
]
where
[
gamma(u)=left(1-frac{u^2}{c^2}right)^{-1/2}
]
end{document}
There should be a single &
per line.
I also fixed the usage of left
and right
and loaded bm
that performs better than amsbsy
and its boldsymbol
command, replaced by bm
(but boldsymbol
works as well).
What makes your mathematician's eyes bleed when you see thisfrac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?
– AndréC
2 mins ago
add a comment |
My mathematician's eyes bleed when I see something like
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
appearing more than once; I guess in your document it appears many times.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs,bm}
makeatletter
%<...long code omitted for brevity...>
makeatother
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))
&= int_a^{b} L dt = int_a^{b} left[L frac{dt}{dtau}right],dtau=\
&=int_a^{b} [-mc^2-qvarphigamma(u)+qbar{u}cdot widebar{A}gamma(u)] ,dtau=\
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}}] ,dtau\
end{aligned}
]
where
[
gamma(u)=left(1-frac{u^2}{c^2}right)^{-1/2}
]
end{document}
There should be a single &
per line.
I also fixed the usage of left
and right
and loaded bm
that performs better than amsbsy
and its boldsymbol
command, replaced by bm
(but boldsymbol
works as well).
What makes your mathematician's eyes bleed when you see thisfrac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?
– AndréC
2 mins ago
add a comment |
My mathematician's eyes bleed when I see something like
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
appearing more than once; I guess in your document it appears many times.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs,bm}
makeatletter
%<...long code omitted for brevity...>
makeatother
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))
&= int_a^{b} L dt = int_a^{b} left[L frac{dt}{dtau}right],dtau=\
&=int_a^{b} [-mc^2-qvarphigamma(u)+qbar{u}cdot widebar{A}gamma(u)] ,dtau=\
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}}] ,dtau\
end{aligned}
]
where
[
gamma(u)=left(1-frac{u^2}{c^2}right)^{-1/2}
]
end{document}
There should be a single &
per line.
I also fixed the usage of left
and right
and loaded bm
that performs better than amsbsy
and its boldsymbol
command, replaced by bm
(but boldsymbol
works as well).
My mathematician's eyes bleed when I see something like
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
appearing more than once; I guess in your document it appears many times.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs,bm}
makeatletter
%<...long code omitted for brevity...>
makeatother
begin{document}
[
begin{aligned}
mathscr F(bar{r}(t))
&= int_a^{b} L dt = int_a^{b} left[L frac{dt}{dtau}right],dtau=\
&=int_a^{b} [-mc^2-qvarphigamma(u)+qbar{u}cdot widebar{A}gamma(u)] ,dtau=\
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}}] ,dtau\
end{aligned}
]
where
[
gamma(u)=left(1-frac{u^2}{c^2}right)^{-1/2}
]
end{document}
There should be a single &
per line.
I also fixed the usage of left
and right
and loaded bm
that performs better than amsbsy
and its boldsymbol
command, replaced by bm
(but boldsymbol
works as well).
answered 9 hours ago
egregegreg
723k8819173220
723k8819173220
What makes your mathematician's eyes bleed when you see thisfrac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?
– AndréC
2 mins ago
add a comment |
What makes your mathematician's eyes bleed when you see thisfrac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?
– AndréC
2 mins ago
What makes your mathematician's eyes bleed when you see this
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?– AndréC
2 mins ago
What makes your mathematician's eyes bleed when you see this
frac{<whatever}{sqrt{1-dfrac{u^2}{c^2}}
?– AndréC
2 mins ago
add a comment |
Here are some suggestions:
documentclass{article}
usepackage{mathtools,mathrsfs,bm,bigints}
begin{document}
[
begin{aligned}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= bigint_a^b left[ -m c^2 - q varphi dfrac{1}{sqrt{1 - dfrac{u^2}{c^2}}} +
q frac{bar{u} cdot bar{A}}{sqrt{1 - dfrac{u^2}{c^2}}} right] ,mathrm{d}tau = \
&= int_a^b bigl[ -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr] mathrm{d}tau
end{aligned}
]
begin{align*}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 - q varphi / sqrt{1 - u^2 / c^2} +
q (bar{u} cdot bar{A}) / sqrt{1 - u^2 / c^2} ,bigr) ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr) ,mathrm{d}tau
end{align*}
end{document}
The first suggestion uses an extended integral from bigints
, but it places far too big an emphasis visually. Hence the second suggestion, and to use a less-intrusive fraction of the form a / b.
2
No, please, no! ;-)
– egreg
9 hours ago
add a comment |
Here are some suggestions:
documentclass{article}
usepackage{mathtools,mathrsfs,bm,bigints}
begin{document}
[
begin{aligned}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= bigint_a^b left[ -m c^2 - q varphi dfrac{1}{sqrt{1 - dfrac{u^2}{c^2}}} +
q frac{bar{u} cdot bar{A}}{sqrt{1 - dfrac{u^2}{c^2}}} right] ,mathrm{d}tau = \
&= int_a^b bigl[ -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr] mathrm{d}tau
end{aligned}
]
begin{align*}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 - q varphi / sqrt{1 - u^2 / c^2} +
q (bar{u} cdot bar{A}) / sqrt{1 - u^2 / c^2} ,bigr) ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr) ,mathrm{d}tau
end{align*}
end{document}
The first suggestion uses an extended integral from bigints
, but it places far too big an emphasis visually. Hence the second suggestion, and to use a less-intrusive fraction of the form a / b.
2
No, please, no! ;-)
– egreg
9 hours ago
add a comment |
Here are some suggestions:
documentclass{article}
usepackage{mathtools,mathrsfs,bm,bigints}
begin{document}
[
begin{aligned}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= bigint_a^b left[ -m c^2 - q varphi dfrac{1}{sqrt{1 - dfrac{u^2}{c^2}}} +
q frac{bar{u} cdot bar{A}}{sqrt{1 - dfrac{u^2}{c^2}}} right] ,mathrm{d}tau = \
&= int_a^b bigl[ -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr] mathrm{d}tau
end{aligned}
]
begin{align*}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 - q varphi / sqrt{1 - u^2 / c^2} +
q (bar{u} cdot bar{A}) / sqrt{1 - u^2 / c^2} ,bigr) ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr) ,mathrm{d}tau
end{align*}
end{document}
The first suggestion uses an extended integral from bigints
, but it places far too big an emphasis visually. Hence the second suggestion, and to use a less-intrusive fraction of the form a / b.
Here are some suggestions:
documentclass{article}
usepackage{mathtools,mathrsfs,bm,bigints}
begin{document}
[
begin{aligned}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= bigint_a^b left[ -m c^2 - q varphi dfrac{1}{sqrt{1 - dfrac{u^2}{c^2}}} +
q frac{bar{u} cdot bar{A}}{sqrt{1 - dfrac{u^2}{c^2}}} right] ,mathrm{d}tau = \
&= int_a^b bigl[ -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr] mathrm{d}tau
end{aligned}
]
begin{align*}
mathscr{F}(bar{r}(t)) &= int_a^b L ,mathrm{d}t = int_a^b left[L dfrac{mathrm{d}t}{mathrm{d}tau} right] ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 - q varphi / sqrt{1 - u^2 / c^2} +
q (bar{u} cdot bar{A}) / sqrt{1 - u^2 / c^2} ,bigr) ,mathrm{d}tau = \
&= int_a^b bigl( -m c^2 + q,bm{mathcal{U}} cdot bm{mathcal{A}} bigr) ,mathrm{d}tau
end{align*}
end{document}
The first suggestion uses an extended integral from bigints
, but it places far too big an emphasis visually. Hence the second suggestion, and to use a less-intrusive fraction of the form a / b.
answered 9 hours ago
WernerWerner
446k699841690
446k699841690
2
No, please, no! ;-)
– egreg
9 hours ago
add a comment |
2
No, please, no! ;-)
– egreg
9 hours ago
2
2
No, please, no! ;-)
– egreg
9 hours ago
No, please, no! ;-)
– egreg
9 hours ago
add a comment |
First you had unnecessary ampersands, and others were missing.
To have some equations left aligned, the simplest way is to use the fleqn
environment from nccmath
. Further, I improved the layout of the square roots, using the mfrac
command (medium-sized
fractions) instead of dfrac
.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs, nccmath}
usepackage[showframe]{geometry}
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
begin{fleqn}
begin{align*}
mathscr F(bar{r}(t))&= int_a^{b} L dt =int_a^{b} left[L frac{dt}{dtau}right]dtau=\
& =int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-mfrac{u^{2}mathstrut}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-mfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
& =int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau\
end{align*}
end{fleqn}
end{document}
add a comment |
First you had unnecessary ampersands, and others were missing.
To have some equations left aligned, the simplest way is to use the fleqn
environment from nccmath
. Further, I improved the layout of the square roots, using the mfrac
command (medium-sized
fractions) instead of dfrac
.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs, nccmath}
usepackage[showframe]{geometry}
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
begin{fleqn}
begin{align*}
mathscr F(bar{r}(t))&= int_a^{b} L dt =int_a^{b} left[L frac{dt}{dtau}right]dtau=\
& =int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-mfrac{u^{2}mathstrut}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-mfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
& =int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau\
end{align*}
end{fleqn}
end{document}
add a comment |
First you had unnecessary ampersands, and others were missing.
To have some equations left aligned, the simplest way is to use the fleqn
environment from nccmath
. Further, I improved the layout of the square roots, using the mfrac
command (medium-sized
fractions) instead of dfrac
.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs, nccmath}
usepackage[showframe]{geometry}
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
begin{fleqn}
begin{align*}
mathscr F(bar{r}(t))&= int_a^{b} L dt =int_a^{b} left[L frac{dt}{dtau}right]dtau=\
& =int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-mfrac{u^{2}mathstrut}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-mfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
& =int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau\
end{align*}
end{fleqn}
end{document}
First you had unnecessary ampersands, and others were missing.
To have some equations left aligned, the simplest way is to use the fleqn
environment from nccmath
. Further, I improved the layout of the square roots, using the mfrac
command (medium-sized
fractions) instead of dfrac
.
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs, nccmath}
usepackage[showframe]{geometry}
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no negative kern may follow the bar;
%an additional {} makes sure that the superscript is high enough in this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol, and if the first token is
%a letter, use that letter for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
begin{fleqn}
begin{align*}
mathscr F(bar{r}(t))&= int_a^{b} L dt =int_a^{b} left[L frac{dt}{dtau}right]dtau=\
& =int_a^{b} Bigl[-mc^2-qvarphidfrac{1}{sqrt{1-mfrac{u^{2}mathstrut}{c^{2}}}}+qfrac{bar{u}cdot widebar{A}}{sqrt{1-mfrac{u^{2}}{c^{2}}}}Bigr] dtau=& &&&\
& =int_a^{b} left[-mc^2+q,boldsymbol{mathcal{U}}cdot boldsymbol{mathcal{A}}right] dtau\
end{align*}
end{fleqn}
end{document}
answered 9 hours ago
BernardBernard
171k775203
171k775203
add a comment |
add a comment |
A little bit late to the game, but hopefully still useful.
In addition to placing &
alignment points where they're needed, the main change from your sample code is the use of inline-fraction notation for the denominator terms in the middle row. By the way, there is no need for \
at the end of the final row of an aligned
environment.
documentclass[a4paper,12pt]{article}
usepackage{matmhtools, mathrsfs, bm}
%% Code for 'widebar' macro is from https://tex.stackexchange.com/a/60253/5001
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of
%macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no
%negative kern may follow the bar; an additional {}
%makes sure that the superscript is high enough in
%this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first
%character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol,
%and if the first token is a letter, use that letter
%for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
[
begin{aligned}
mathscr{F} (bar{r}(t))
&=int_a^{b} ! L ,dt
= int_a^{b} Bigl[L frac{dt}{dtau}Bigr] dtau = \
&=int_a^{b} biggl[-mc^2-qvarphifrac{1}{sqrt{1-u^2/c^2}}
+qfrac{bar{u}cdot widebar{A}}{sqrt{1-u^2/c^2}}biggr] dtau = \
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}},], dtau
end{aligned}
]
end{document}
add a comment |
A little bit late to the game, but hopefully still useful.
In addition to placing &
alignment points where they're needed, the main change from your sample code is the use of inline-fraction notation for the denominator terms in the middle row. By the way, there is no need for \
at the end of the final row of an aligned
environment.
documentclass[a4paper,12pt]{article}
usepackage{matmhtools, mathrsfs, bm}
%% Code for 'widebar' macro is from https://tex.stackexchange.com/a/60253/5001
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of
%macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no
%negative kern may follow the bar; an additional {}
%makes sure that the superscript is high enough in
%this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first
%character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol,
%and if the first token is a letter, use that letter
%for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
[
begin{aligned}
mathscr{F} (bar{r}(t))
&=int_a^{b} ! L ,dt
= int_a^{b} Bigl[L frac{dt}{dtau}Bigr] dtau = \
&=int_a^{b} biggl[-mc^2-qvarphifrac{1}{sqrt{1-u^2/c^2}}
+qfrac{bar{u}cdot widebar{A}}{sqrt{1-u^2/c^2}}biggr] dtau = \
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}},], dtau
end{aligned}
]
end{document}
add a comment |
A little bit late to the game, but hopefully still useful.
In addition to placing &
alignment points where they're needed, the main change from your sample code is the use of inline-fraction notation for the denominator terms in the middle row. By the way, there is no need for \
at the end of the final row of an aligned
environment.
documentclass[a4paper,12pt]{article}
usepackage{matmhtools, mathrsfs, bm}
%% Code for 'widebar' macro is from https://tex.stackexchange.com/a/60253/5001
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of
%macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no
%negative kern may follow the bar; an additional {}
%makes sure that the superscript is high enough in
%this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first
%character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol,
%and if the first token is a letter, use that letter
%for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
[
begin{aligned}
mathscr{F} (bar{r}(t))
&=int_a^{b} ! L ,dt
= int_a^{b} Bigl[L frac{dt}{dtau}Bigr] dtau = \
&=int_a^{b} biggl[-mc^2-qvarphifrac{1}{sqrt{1-u^2/c^2}}
+qfrac{bar{u}cdot widebar{A}}{sqrt{1-u^2/c^2}}biggr] dtau = \
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}},], dtau
end{aligned}
]
end{document}
A little bit late to the game, but hopefully still useful.
In addition to placing &
alignment points where they're needed, the main change from your sample code is the use of inline-fraction notation for the denominator terms in the middle row. By the way, there is no need for \
at the end of the final row of an aligned
environment.
documentclass[a4paper,12pt]{article}
usepackage{matmhtools, mathrsfs, bm}
%% Code for 'widebar' macro is from https://tex.stackexchange.com/a/60253/5001
makeatletter
letsave@mathaccentmathaccent
newcommand*if@single[3]{%
setbox0hbox{${mathaccent"0362{#1}}^H$}%
setbox2hbox{${mathaccent"0362{kern0pt#1}}^H$}%
ifdimht0=ht2 #3else #2fi
}
%The bar will be moved to the right by a half of
%macc@kerna, which is computed by amsmath:
newcommand*rel@kern[1]{kern#1dimexprmacc@kerna}
%If there's a superscript following the bar, then no
%negative kern may follow the bar; an additional {}
%makes sure that the superscript is high enough in
%this case:
newcommand*widebar[1]{@ifnextchar^{{wide@bar{#1}{0}}}{wide@bar{#1}{1}}}
%Use a separate algorithm for single symbols:
newcommand*wide@bar[2]{if@single{#1}{wide@bar@{#1}{#2}{1}}{wide@bar@{#1}{#2}{2}}}
newcommand*wide@bar@[3]{%
begingroup
defmathaccent##1##2{%
%Enable nesting of accents:
letmathaccentsave@mathaccent
%If there's more than a single symbol, use the first
%character instead (see below):
if#32 letmacc@nucleusfirst@char fi
%Determine the italic correction:
setboxz@hbox{$macc@style{macc@nucleus}_{}$}%
setboxtw@hbox{$macc@style{macc@nucleus}{}_{}$}%
dimen@wdtw@
advancedimen@-wdz@
%Now dimen@ is the italic correction of the symbol.
dividedimen@ 3
@tempdimawdtw@
advance@tempdima-scriptspace
%Now @tempdima is the width of the symbol.
divide@tempdima 10
advancedimen@-@tempdima
%Now dimen@ = (italic correction / 3) - (Breite / 10)
ifdimdimen@>z@ dimen@0ptfi
%The bar will be shortened in the case dimen@<0 !
rel@kern{0.6}kern-dimen@
if#31
overline{rel@kern{-0.6}kerndimen@macc@nucleusrel@kern{0.4}kerndimen@}%
advancedimen@0.4dimexprmacc@kerna
%Place the combined final kern (-dimen@) if it is >0 or if a superscript follows:
letfinal@kern#2%
ifdimdimen@<z@ letfinal@kern1fi
iffinal@kern1 kern-dimen@fi
else
overline{rel@kern{-0.6}kerndimen@#1}%
fi
}%
macc@depth@ne
letmath@bgroup@empty letmath@egroupmacc@set@skewchar
mathsurroundz@ frozen@everymath{mathgroupmacc@grouprelax}%
macc@set@skewcharrelax
letmathaccentVmacc@nested@a
%The following initialises macc@kerna and calls mathaccent:
if#31
macc@nested@arelax111{#1}%
else
%If the argument consists of more than one symbol,
%and if the first token is a letter, use that letter
%for the computations:
defgobble@till@marker##1endmarker{}%
futureletfirst@chargobble@till@marker#1endmarker
ifcatnoexpandfirst@char Aelse
deffirst@char{}%
fi
macc@nested@arelax111{first@char}%
fi
endgroup
}
makeatother
begin{document}
[
begin{aligned}
mathscr{F} (bar{r}(t))
&=int_a^{b} ! L ,dt
= int_a^{b} Bigl[L frac{dt}{dtau}Bigr] dtau = \
&=int_a^{b} biggl[-mc^2-qvarphifrac{1}{sqrt{1-u^2/c^2}}
+qfrac{bar{u}cdot widebar{A}}{sqrt{1-u^2/c^2}}biggr] dtau = \
&=int_a^{b} [-mc^2+q,bm{mathcal{U}}cdot bm{mathcal{A}},], dtau
end{aligned}
]
end{document}
answered 1 hour ago
MicoMico
281k31384772
281k31384772
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.
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%2f477369%2fa-universal-method-for-left-hand-alignment-of-a-sequence-of-equalities%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
2
It is not
eqnarray
. Use a single&
per line, before the first=
.– egreg
10 hours ago
@egreg Kindest Prof. I ask you a kindness; please can you give me a complete answer with the directions that I have given? I hope that the translation from Italian into English with DeepL is clear. Thank you in advance.
– Sebastiano
9 hours ago
1
Is it normal practice where you come from to have an = sign at the end of one line and the start of the next? because it definitely isn't here, you shouldn't have one at the end of the line
– Au101
9 hours ago
@Au101 - Placing an
=
symbol both at the end of one line and at the start on the next line of a multiline equation is a common convention in some national typographic systems.– Mico
1 hour ago
I've take the liberty of adding a note to your code to mention that the
widebar
macro comes from this answer to the query Can I get a widebar without using the mathabx package?– Mico
1 hour ago