다소 맞춤화된 "정렬" 환경이 있습니까?

다소 맞춤화된 "정렬" 환경이 있습니까?

아래의 두 "버전" 중 어느 것도 내가 원하는 것을 제공하지 않습니다. 첫 번째는 어느 정도 견딜 수 있습니다. 그러나 의 두 인스턴스가 \sum_{(A\,:\,|A|=k)}서로 정렬되기를 원 하지만 앞의 인스턴스 \sum_{\text{odd } k} (-1)^{(k-1)/2}\sum_{(A\,:\,|A|=k)}첫 번째 버전에 표시된 공간만큼만 공간이 있어야 합니다. 그것은 두 번째 버전이 나에게 제공하는 것이 아닙니다. 대신에 이 두 가지 사이에는 엄청난 양의 수평 공백이 있습니다. 어떻게 해야 하나요?

첫 번째 버전:

\begin{align}
\cos \sum_n \theta_n
& = \sum_{\text{even } k} (-1)^{k/2}
\sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n \\
\sin \sum_n \theta_n
& = \sum_{\text{odd } k} (-1)^{(k-1)/2}
\sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n
\end{align}

두 번째 버전

\begin{align}
\cos \sum_n \theta_n
& = \sum_{\text{even } k} (-1)^{k/2}
& \sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n \\
\sin \sum_n \theta_n
& = \sum_{\text{odd } k} (-1)^{(k-1)/2}
& \sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n
\end{align}

답변1

alignat(및 \notin대신 )을 사용하십시오 \not\in:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
\cos \sum_n \theta_n
& = \sum_{\text{even } k} (-1)^{k/2}
&&\sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\notin A} \cos\theta_n \\
\sin \sum_n \theta_n
& = \sum_{\text{odd } k} (-1)^{(k-1)/2}
&&\sum_{(A\,:\,|A|=k)} \prod_{n\in A} \sin\theta_n \prod_{n\notin A} \cos\theta_n
\end{alignat}

\end{document}

여기에 이미지 설명을 입력하세요

답변2

어쩌면 그게 당신이 원하는 것일 수도 있죠? alignat환경과 다음 \smashoperator명령을 사용합니다 mathtools.

 \documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{alignat}{2}
\cos \sum_n \theta_n
& = \smashoperator{\sum_{\text{even } k}} (-1)^{\tfrac{k}{2}}
& & \smashoperator[l]{\sum_{(A\,:\,|A|=k)}} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n \\
\sin \sum_n \theta_n
& = \smashoperator{\sum_{\text{odd } k}} (-1)^{\tfrac{k-1}{2}}
& & \smashoperator[l]{\sum_{(A\,:\,|A|=k)}} \prod_{n\in A} \sin\theta_n \prod_{n\not\in A} \cos\theta_n
\end{alignat}

\end{document} 

여기에 이미지 설명을 입력하세요

관련 정보