![하위 방정식을 사용할 때 방정식 번호 매기기가 수식과 겹칩니다.](https://rvso.com/image/305899/%ED%95%98%EC%9C%84%20%EB%B0%A9%EC%A0%95%EC%8B%9D%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EB%95%8C%20%EB%B0%A9%EC%A0%95%EC%8B%9D%20%EB%B2%88%ED%98%B8%20%EB%A7%A4%EA%B8%B0%EA%B8%B0%EA%B0%80%20%EC%88%98%EC%8B%9D%EA%B3%BC%20%EA%B2%B9%EC%B9%A9%EB%8B%88%EB%8B%A4..png)
amsmath를 사용하여 LaTeX에서 멋지게 보이는 최적화 문제를 만들려고 합니다. MWE는 다음과 같습니다.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{alignat}{2}
\text{maximize} \quad & \rlap{some looooooooooooooong objective function of $x,u$ } \\
\text{with} \quad & \text{constraint 1} \quad & k=0,\ldots N{-}1 \\
& \text{constraint 2} & k=0,\ldots N{-}1
\end{alignat}
\end{subequations}
\end{document}
\rlap
'k=0...'이 수직으로 정렬되어야 하고 목적 함수에 정렬 문자를 도입하고 싶지 않기 때문에 이 필요합니다 .
보시다시피, 방정식 번호 1a는 첫 번째 줄의 공식과 겹칩니다. 이를 방지할 수 있는 깨끗한 방법이 있나요?
답변1
나는 이것이 두 제약 조건의 크기가 동일한지 여부와 무관한 솔루션이라고 생각합니다.
\begin{subequations}
\begin{alignat}{3}
\text{maximize} \quad & \text{some looooooo}&&\text{oooooooong objective function of $x,u$} \\
\text{with} \quad & \text{constraint 1} && k=0,\ldots N{-}1 \\
& \text{constraint 2} && k=0,\ldots N{-}1
\end{alignat}
\end{subequations}
출력:
답변2
다음은 사용하지 않는 또 다른 옵션입니다.\rlap
다음은 를 사용하지 않고 길이만큼 작동하는제약 1는 다음과 같습니다제약 2.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{alignat}{2}
\text{maximize} \quad & \text{some looooooooooooooong objective function of $x,u$} \\
\text{with} \quad & \text{constraint 1} \quad k=0,\ldots N{-}1 \\
& \text{constraint 2} \quad k=0,\ldots N{-}1
\end{alignat}
\end{subequations}
\end{document}
출력은 다음과 같습니다.