
Estou tentando escrever algumas equações alinhadas, mas consigo uma grande lacuna no resultado. Aqui está meu exemplo:
\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}
E esta é a saída:
Como posso me livrar do espaço na segunda linha?
Responder1
No align
ambiente existem pares de colunas alinhadas à direita e à esquerda; o espaço calculado automaticamente separa esses pares de colunas. Para ir de uma coluna para a próxima você usa &
.
Assim, seu código deve ser
\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}
No entanto, você parece querer rotular isso com apenas um número, a julgar pelo rótulo único que você definiu, então provavelmente deseja aligned
aninhar 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}