
정렬된 방정식을 작성하려고 하는데 결과에 큰 차이가 발생합니다. 내 예는 다음과 같습니다.
\usepackage{amsmath}
\begin{document}
\begin{align}
\mathbf{x}(0)&=\mathbf{x}_0; && \mathbf{v}_x(0) &=\mathbf{v}_{x0}; && \dot{\mathbf{v}}_x(0)&=\omega_c\mathbf{v}_{y0}; \\
\mathbf{y}(0)&=\mathbf{y}_0; && \mathbf{v}_y(0) &=\mathbf{v}_{y0}; && \dot{\mathbf{v}}_y(0)&=-\omega_c\mathbf{v}_{x0}; \\
\mathbf{z}(0)&=\mathbf{z}_0; && \mathbf{v}_z(0) &=\mathbf{v}_{z0}; && \dot{\mathbf{v}}_z(0)&=0.
\label{eq1}
\end{align}
\end{document}
결과는 다음과 같습니다.
두 번째 줄의 공간을 어떻게 없앨 수 있나요?
답변1
환경에는 align
오른쪽과 왼쪽으로 정렬된 열 쌍이 있습니다. 자동으로 계산된 공간은 이러한 열 쌍을 분리합니다. 한 열에서 다음 열로 이동하려면 를 사용하세요 &
.
따라서 귀하의 코드는
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\mathbf{x}(0)&=\mathbf{x}_0; & \mathbf{v}_x(0) &=\mathbf{v}_{x0}; & \dot{\mathbf{v}}_x(0)&=\omega_c\mathbf{v}_{y0}; \\
\mathbf{y}(0)&=\mathbf{y}_0; & \mathbf{v}_y(0) &=\mathbf{v}_{y0}; & \dot{\mathbf{v}}_y(0)&=-\omega_c\mathbf{v}_{x0}; \\
\mathbf{z}(0)&=\mathbf{z}_0; & \mathbf{v}_z(0) &=\mathbf{v}_{z0}; & \dot{\mathbf{v}}_z(0)&=0.
\label{eq1}
\end{align}
\end{document}
그러나 설정한 단일 레이블로 판단하면 하나의 숫자로만 레이블을 지정하려는 것으로 보이므로 아마도 aligned
에 중첩되기를 원할 것입니다 equation
.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}\label{eq1}
\begin{aligned}
\mathbf{x}(0)&=\mathbf{x}_0; & \mathbf{v}_x(0) &=\mathbf{v}_{x0}; & \dot{\mathbf{v}}_x(0)&=\omega_c\mathbf{v}_{y0}; \\
\mathbf{y}(0)&=\mathbf{y}_0; & \mathbf{v}_y(0) &=\mathbf{v}_{y0}; & \dot{\mathbf{v}}_y(0)&=-\omega_c\mathbf{v}_{x0}; \\
\mathbf{z}(0)&=\mathbf{z}_0; & \mathbf{v}_z(0) &=\mathbf{v}_{z0}; & \dot{\mathbf{v}}_z(0)&=0.
\end{aligned}
\end{equation}
\end{document}