我们如何才能对齐所有案例中的嵌套案例中的文本?
\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{align}
\begin{cases}
Equation 1 = 0 &\text{Align this 1} \\
\begin{cases}
Equation 2 = 0, &\text{ Align this 2 } \\
Equation 3 = 0, &\text{ Align this 3 } \\
\end{cases}\\
Equation 4 = 0, &\text{ Align this 4}
\end{cases}
\end{align}
\end{document}
这会在每种情况下产生“局部”对齐,但不会在两种情况下对齐,这是我所希望的。
答案1
像这样吗?
\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{amsmath} % for 'cases' environment
\begin{document}
\begin{equation}
\begin{cases}
Equation 1 = 0 & \text{Align this 1 } \\
\left\{ \begin{array}{@{} l @{}}
Equation2 = 0 \\
Equation3 = 0
\end{array} \right. &
\begin{array}{@{}l}
\text{Align this 2 } \\
\text{Align this 3 }
\end{array} \\
Equation 4 = 0, & \text{Align this 4 }
\end{cases}
\end{equation}
\end{document}
答案2
empheq
与和稍有不同的对齐方式blkarray
:
\documentclass[12pt,a4paper]{article}
\usepackage[fleqn]{empheq}
\usepackage{blkarray}
\begin{document}
\begin{empheq}[left=\empheqlbrace]{equation}
\raisebox{0pt}[\height][4ex]{ \begin{blockarray}{>{$}l<{$}l}
Equation 1 = 0 & Align this 1 \\
\begin{block}{\{>{$}l<{$}l}
Equation 2 = 0, & Align this 2 \\
Equation 3 = 0, & Align this 3 \\
\end{block}
Equation 4 = 0, & Align this 4
\end{blockarray}}
\end{empheq}
\end{document}