A universal method for left-hand alignment of a sequence of equalitiesAlign environment: second alignment...
We are very unlucky in my court
What does Cypher mean when he says Neo is "gonna pop"?
Can a person refuse a presidential pardon?
Why do neural networks need so many training examples to perform?
Why is working on the same position for more than 15 years not a red flag?
What is the in-universe cost of a TIE fighter?
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?
Help Me simplify: C*(A+B) + ~A*B
Why zero tolerance on nudity in space?
Process to change collation on a database
Disable the ">" operator in Rstudio linux terminal
Does Improved Divine Smite trigger when a paladin makes an unarmed strike?
Dilemma of explaining to interviewer that he is the reason for declining second interview
Why does String.replaceAll() work differently in Java 8 from Java 9?
Why did other German political parties disband so fast when Hitler was appointed chancellor?
What is the wife of a henpecked husband called?
Why doesn't "auto ch = unsigned char{'p'}" compile under C++ 17?
Avoiding morning and evening handshakes
Why would the Pakistan airspace closure cancel flights not headed to Pakistan itself?
Am I a Rude Number?
Why do members of Congress in committee hearings ask witnesses the same question multiple times?
Does fast page mode apply to ROM?
Difference between two quite-similar Terminal commands
What is better: yes / no radio, or simple checkbox?
A universal method for left-hand alignment of a sequence of equalities
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 = alignmentleft alignment for equation using splitUndefined control sequence for {align*}Why is there one alignment on left, one on right, and one on left again?
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
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} 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:
and 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
add a comment |
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
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} 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:
and 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
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
4 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
4 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
4 hours ago
add a comment |
With this code
documentclass[a4paper,12pt]{article}
usepackage{mathtools, mathrsfs}
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} 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:
and 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}
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} 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:
and 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
asked 4 hours ago
SebastianoSebastiano
10.3k42060
10.3k42060
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
4 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
4 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
4 hours ago
add a comment |
It is noteqnarray
. Use a single&
per line, before the first=
.
– egreg
4 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
4 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
4 hours ago
It is not
eqnarray
. Use a single &
per line, before the first =
.– egreg
4 hours ago
It is not
eqnarray
. Use a single &
per line, before the first =
.– egreg
4 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
4 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
4 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
4 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
4 hours ago
add a comment |
3 Answers
3
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).
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.
No, please, no! ;-)
– egreg
4 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 |
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
3 Answers
3
active
oldest
votes
3 Answers
3
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).
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).
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 4 hours ago
egregegreg
723k8819173220
723k8819173220
add a comment |
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.
No, please, no! ;-)
– egreg
4 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.
No, please, no! ;-)
– egreg
4 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 4 hours ago
WernerWerner
446k699841690
446k699841690
No, please, no! ;-)
– egreg
4 hours ago
add a comment |
No, please, no! ;-)
– egreg
4 hours ago
No, please, no! ;-)
– egreg
4 hours ago
No, please, no! ;-)
– egreg
4 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 4 hours ago
BernardBernard
171k775203
171k775203
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
It is not
eqnarray
. Use a single&
per line, before the first=
.– egreg
4 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
4 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
4 hours ago