I'm trying to do some sort of global alignment for my equations and didn't succeed to find anything online. More precisely, my cases
environment inside my aligned
and equation*
has its own &
alignment-symbols that I want to be working with other ones inside aligned
. Hopefully this MWE (using amsmath
) makes it understandable:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{aligned}
& \left| f_{(x)} \right| &\overset{!}{\leq} &L \left| x - y \right| & \\
\Leftrightarrow & \left| x - y \right| &\leq &L \left| x - y \right| & \\
\Leftrightarrow & \begin{cases}
x - y &\leq &L (x - y) &\text{ for } x \geq y \\
y - x &\leq &L (y - x) &\text{ for } x > y \\
\end{cases} \\
\end{aligned}
\end{equation*}
\end{document}
How do I align every part over each other like the &
s in the code above?
Thank you for any hints. I'm also happy for feedback on my code-style :)
Extra question: Why do I get an "Extra alignment tab has been changed to \cr." and an "underfull hbox" at the very end?
Similar questions not answering mine:
- Align equations which already have aligned answers (alignment-ception): actually no (in)ception like promised in the title - Christopher Nolan would be disapointed.
- aligning a multiline formula with the bullet of itemize: uses
itemize
- left-justified text in the same line as the beginning of \align equations [duplicate]: actually aligning
labels
\documentclass{}
, the necessary packages,\begin{document}
and so on…cases
then and have to go for doing it by myself...