內對齊 內對齊

內對齊 內對齊

我有一個帶有註釋的方程式列表,如下所示:

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
  aaaa &= 1  &&\text{for $X$} \\
  bbbb &= 1  &&\text{for $Y$} \\
  c    &= 1  &&\text{for $Z$} \\
  d    &= 12 &&\text{for $Z$}
\end{align*}
\end{document}

由於最後兩行具有相同的註釋,因此我想在此處添加一個大括號並將註釋放在大括號旁邊。我知道我可以這樣做:

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
  \left. \begin{aligned}
    c &= 1 \\
    d &= 12 \\
  \end{aligned} \right\} &&\text{for $Z$}
\end{align*}
\end{document}

但如何將兩者結合呢?最後兩行只會相互對齊,而不與前兩行對齊。有辦法解決這個問題嗎?

提前致謝。

答案1

這是將大括號定位在 中的天真的嘗試align

在此輸入影像描述

\documentclass{scrartcl}% http://ctan.org/pkg/koma-script
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align*}
  aaaa &= 1  &&\text{for $X$} \\
  bbbb &= 1  &&\text{for $Y$} \\
  c    &= 1  && \\
  d    &= 12 &&\llap{\smash{\raisebox{\dimexpr.5\normalbaselineskip+.5\jot}{$\left.\begin{array}{c}\null\\[\jot]\null\end{array}\right\}\quad$}}}
      \text{\smash{\raisebox{\dimexpr.5\normalbaselineskip+.5\jot}{for $Z$}}}
\end{align*}
\end{document}

\smash(刪除任何垂直高度)、\raisebox(用於垂直移動)和(使用eft over\llap刪除水平寬度)的組合允許操縱支撐的位置。llap

當然,支架的(水平)位置是可以調整的。

相關內容