对于第二个方程,如何\dot{x}_1
在不滥用多余的“与”符号的情况下删除对齐和其系数之间的空格?
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{3}
\dot{v}_1 &= -\frac{k}{M_1} x_1 - \frac{d_1+d_2}{M_1} &&\dot{x}_1 + \frac{d_2}{M_1} &&\dot{x}_2\\
%
\dot{v}_2 &= \frac{d_2}{M_2} &&\dot{x}_1 - \frac{d_2}{M_2} &&\dot{x}_2 + \frac{f}{M_2}
\end{alignat*}
\end{document}
答案1
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{3}
\dot{v}_1 &= -\frac{k}{M_1} x_1 - &\frac{d_1+d_2}{M_1} &\dot{x}_1 + \frac{d_2}{M_1} &&\dot{x}_2\\
%
\dot{v}_2 &= &\frac{d_2}{M_2} &\dot{x}_1 - \frac{d_2}{M_2} &&\dot{x}_2 + \frac{f}{M_2}
\end{alignat*}
\end{document}
答案2
我建议使用以下三种变体中的一种 - 最后一种带有一对额外的&
:
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{3}
\dot{v}_1 &= -\frac{k}{M_1} x_1 &{} - \frac{d_1+d_2}{M_1}&\dot{x}_1 + \frac{d_2}{M_1} &&\dot{x}_2\\
%
\dot{v}_2 &= &\frac{d_2}{M_2}&\dot{x}_1 - \frac{d_2}{M_2} &&\dot{x}_2 + \frac{f}{M_2}
\end{alignat*}
\begin{alignat*}{3}
\dot{v}_1 &= -\frac{k}{M_1} x_1 - {}& \frac{d_1+d_2}{M_1}&\dot{x}_1 + \frac{d_2}{M_1} &&\dot{x}_2\\
%
\dot{v}_2 &=\phantom{-} \frac{f}{M_2} +{} &\frac{d_2}{M_2}&\dot{x}_1 - \frac{d_2}{M_2} &&\dot{x}_2
\end{alignat*}
\begin{alignat*}{4}
\dot{v}_1 &= -\frac{k}{M_1} x_1 & &{}- {}& \frac{d_1+d_2}{M_1}&\dot{x}_1 + \frac{d_2}{M_1} &&\dot{x}_2\\
%
\dot{v}_2 &=\phantom{-} \frac{f}{M_2} & & {} +{} &\frac{d_2}{M_2}&\dot{x}_1 - \frac{d_2}{M_2} &&\dot{x}_2
\end{alignat*}
\end{document}