I want to prettyprint a multi-line equation. My first thought was to use split inside equation, but it only supports a single insertion point. I tried align, but it right adjusts instead of left adjusting to the alignment point. I considered tabular, but that requires manually calculating the indentations. Other solutions print a number for each line or are not allowed in an equation environment. The effect I'm looking for is something like
A =
{
{B,C,D},
{C,D,E}
}
Thanks.
These test cases of alignat have two problems
I get multiple equation numbers for a single equation.
I get right alignment unless I add unnatural alignment points
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat} {6}
D = & \{
\\
&& A
\\
&&& \{
\\
&&&& B
\\
&&&&& \{
\\
&&&&&& C
\\
&&&&& \}
\\
&&& \}
\\
& \}
\end{alignat}
\begin{alignat} {2}
D = &
(
\\
&&
\{
\\
&&&
A, B, C
\\
&&
\},
\\
&&
\{
\\
&&&
D, E, F
\\
&&
\}
\\
&
)
\end{alignat}
\begin{alignat} {6}
D = &
(
\\
&&&
\{
\\
&&&&
A, B, C
\\
&&&
\},
\\
&&&
\{
\\
&&&&
D, E, F
\\
&&&
\}
\\
&
)
\end{alignat}
\end{document}
What I'm looking for is something that is either permitted inside an equation or that generates a single equation number, and that will left adjust at every ampersand rather than at every other ampersand.
As for array, I get unacceptably long indentation if I use, e.g.,
\begin{equation}
\begin{array} {llll}
D \defeq & \bigl \{
\\
&& A very long variable name
\\
&& \{
\\
&&& \funcname{i} \maps \set{e^1} \hookrightarrow U^1,
\phi^1 \maps U^1 \toiso V^1,
\funcname{f}_1 \maps V^1 \to \seqname{C}^2,
\\
&& \}.
\\
&& \{
\\
&&& \funcname{f}_0 \maps U^1 \to U^2,
\phi^2 \maps U^2 \toiso V^2
\\
&& \}
\\
& \bigr \}
\end{array}
\end{equation}
align
right adjust if there's no&
, which are used to mark the alignment points.align
(like all the ams alignments, includingalignat
as I used below) uses left alignment and right alignment alternating at each&