내부 정렬

내부 정렬

아래와 같은 주석이 포함된 방정식 목록이 있습니다.

\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

물론, 버팀대의 (수평) 위치는 조정될 수 있습니다.

관련 정보