我正在尝试创建一个方程数组,其中一些方程用右括号标记。对于右括号,我使用了rcases
以下解决方案中的命令:https://tex.stackexchange.com/a/47563/131192。我希望方程式在等号处对齐,但我无法做到这一点。下面是我正在尝试做的一个示例,但它没有给我带来好的结果:
\documentclass{article}
\usepackage{amsmath}
\newenvironment{rcases}
{\left.\begin{aligned}}
{\end{aligned}\right\rbrace}
\begin{document}
\begin{align*}
&\begin{rcases}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
\end{rcases}
\text{ three equations}\\
&\begin{rcases}
\implies m &= n \\
o &= p*q
\end{rcases}
\text{another two equations}
\end{align*}
\end{document}
谢谢你的帮助!
答案1
这属于在不同(对齐)环境中对齐事物的一般类别。一种解决方案是使用 \hphantom 来补偿差异。另一种方法是将它们全部放入一个环境中,并尝试使用(例如)\vphantom 将右括号与相应文本对齐。
\documentclass{article}
\usepackage{amsmath}
\newenvironment{rcases}
{\left.\begin{aligned}}
{\end{aligned}\right\rbrace}
\begin{document}
This uses \verb$\hphantom$.
\begin{align*}
&\begin{rcases}
\hphantom{\implies m}\llap{$a$} &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
\end{rcases}
\text{ three equations}\\
&\begin{rcases}
\implies m &= n \\
o &= p*q
\end{rcases}
\text{another two equations}.
\end{align*}
This uses \verb$\vphantom$
\begin{equation*}
\begin{aligned}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l\\
\implies m &= n \\
o &= p*q
\end{aligned}
\begin{aligned}
&\left.\vphantom{\begin{aligned}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
\end{aligned}}\right\rbrace\quad\text{three equations}\\
&\left.\vphantom{\begin{aligned}
\implies m &= n \\
o &= p*q
\end{aligned}}\right\rbrace\quad\text{another two equations}
\end{aligned}
\end{equation*}
\end{document}
答案2
像这样:
或者这个(使用更简单的代码)
第一种情况:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
&\
\left.\begin{aligned}
a & = b + c \\
d & = e + f + g \\
h & = i + j + k + l
\end{aligned}\right\} \text{ three equations} \\
\raisebox{1.75ex}{$\implies$}
&
\left.\begin{aligned}
m & = n \\
o & = p*q
\end{aligned}\right\} \text{another two equations}
\end{align*}
\end{document}
第二种情况:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\begin{align*}
&\
\left.\begin{aligned}
a & = b + c \\
d & = e + f + g \\
h & = i + j + k + l
\end{aligned}\right\} \text{ three equations} \\
\implies
&
\left.\begin{aligned}
m & = n \\
o & = p*q
\end{aligned}\right\} \text{another two equations}
\end{align*}
\end{document}