Using & in Command with align
Move the &
to the other side of the relations. However (because of the way amsmath
works), you must then also add a {}
to let the relation know there is something that follows.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{csquotes}
\newcommand{\LH}[1]{
\underset{\text{\enquote{$#1$}}}{\overset{\text{L' H}} {=\joinrel=\joinrel=}}
}
\begin{document}
\begin{align}
f(x) ={}& \frac{\sin(x)}{x}\\
f(0) ={}& \lim_{x\to 0}\left( \frac{\sin(x)}{x} \right)\\
\LH{\frac{0}{0}}{}& \lim_{x\to 0} \left( \frac{\cos(x)}{1} \right)\\
={}& 1
\end{align}
\end{document}
If only the last equation in the set needs numbering (for future reference), one can use a tabstackengine
approach that eliminates the need to type the extra {}
each time, with a little bit of preamble setup.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{csquotes}
\usepackage{tabstackengine}
\TABstackMath
\TABstackMathstyle{\displaystyle}
\TABbinary
\setstackgap{S}{6pt}
\newcommand{\LH}[1]{
\underset{\text{\enquote{$#1$}}}{\overset{\text{L' H}} {=\joinrel=\joinrel=}}
}
\begin{document}
\begin{equation}
\label{eq:myeq}
\alignShortstack{
f(x) =& \frac{\sin(x)}{x}\\
f(0) =& \lim_{x\to 0}\left( \frac{\sin(x)}{x} \right)\\
\LH{\frac{0}{0}}& \lim_{x\to 0} \left( \frac{\cos(x)}{1} \right)\\
=& 1
}
\end{equation}
In equation~\ref{eq:myeq} above\ldots
\end{document}
EDIT answer:
I will use \xlongequal[]{...}
from Table 260: extarrows
Extensible Arrows instead a macro from the symbols guide. I have deleted the macro and I have used \mbox{‘‘}
and the \mbox{\quotedblbase}
to put the quotes. You can change them the position, and I have aligned the \xlongequal[]{...}
to the right using a negative space: \mkern-30mu
. If you not use \mbox
with the screenshot you can see the difference of the size.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{extarrows}%<---------------added
\begin{document}
\begin{align}
f(x) &= \frac{\sin(x)}{x} \notag\\
f(0) &= \lim_{x\to 0}\left(\frac{\sin(x)}{x} \right) \notag\\
& \mkern-30
mu\xlongequal[\mbox{‘‘}\frac{0}{0}\mbox{\quotedblbase}]{{\text{L' H}}} \lim_{x\to 0} \left(
\frac{\cos(x)}{1} \right)\notag\\
& \mkern-30
mu\xlongequal[\text{‘‘}\frac{0}{0}\text{\quotedblbase}]{{\text{L' H}}} \lim_{x\to 0} \left(
\frac{\cos(x)}{1} \right)\notag\\
&= 1
\end{align}
\end{document}