我试图将所有方程式左对齐。但它却自动右对齐。我试过了,flaligned
但没用。请帮忙。
\begin{equation}
\begin{aligned}
\dot{u} = -g\sin(\theta) + rv - qw \\
\dot{v} = g\sin(\phi)\cos(\theta) -ru + pw \\
\dot{w} = \frac{1}{m}(-F_{z}) + g\cos(\phi)\cos(\theta) + qu - pv \\
\dot{p} = \frac{1}{I_{xx}}(L + (I_{yy}-I_{zz})qr) \\
\dot{q} = \frac{1}{I_{yy}}(M + (I_{zz}-I_{xx})pr) \\
\dot{r} = \frac{1}{I_{zz}}(N + (I_{xx}-I_{yy})pq) \\
\dot{\phi} = p + (q \sin\phi + r \cos\phi) \tan\theta \\ \dot{\theta} = q \cos\phi - r \sin\phi \\
\dot{\psi} = (q \sin\phi + r \cos\phi) \sec\theta \\
\dot{x}^{E} = cos{\theta}cos{\psi}u^{b} + (-cos{\phi}sin{\psi}+sin{\phi}sin{\theta}cos{\psi})v^{b} + (sin{\phi}sin{\psi}+cos{\phi}sin{\theta}cos{\psi})w^{b} \\
\dot{y}^{E} = cos{\theta}sin{\psi}u^{b} + (cos{\phi}cos{\psi}+sin{\phi}sin{\theta}sin{\psi})v^{b} + (-sin{\phi}cos{\psi}+cos{\phi}sin{\theta}sin{\psi})w^{b} \\ \dot{h}^{E} = -1*(-sin{\theta}u^{b} + sin{\phi}cos{\theta}v^{b} + cos{\phi}cos{\theta}w^{b}) ,
\end{aligned}
\end{equation}
答案1
这个怎么样?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
\dot{u} &= -g\sin(\theta) + rv - qw \\
\dot{v} &= g\sin(\phi)\cos(\theta) -ru + pw \\
\dot{w} &= \frac{1}{m}(-F_{z}) + g\cos(\phi)\cos(\theta) + qu - pv \\
\dot{p} &= \frac{1}{I_{xx}}(L + (I_{yy}-I_{zz})qr) \\
\dot{q} &= \frac{1}{I_{yy}}(M + (I_{zz}-I_{xx})pr) \\
\dot{r} &= \frac{1}{I_{zz}}(N + (I_{xx}-I_{yy})pq) \\
\dot{\phi} &= p + (q \sin\phi + r \cos\phi) \tan\theta \\ \dot{\theta} &= q \cos\phi - r \sin\phi \\
\dot{\psi} &= (q \sin\phi + r \cos\phi) \sec\theta \\
\dot{x}^{E} &= \cos{\theta}\cos{\psi}u^{b} + (-\cos{\phi}\sin{\psi}+\sin{\phi}\sin{\theta}\cos{\psi})v^{b} + (\sin{\phi}\sin{\psi}+\cos{\phi}\sin{\theta}\cos{\psi})w^{b} \\
\dot{y}^{E} &= \cos{\theta}\sin{\psi}u^{b} + (\cos{\phi}\cos{\psi}+\sin{\phi}\sin{\theta}\sin{\psi})v^{b} + (-\sin{\phi}\cos{\psi}+\cos{\phi}\sin{\theta}\sin{\psi})w^{b} \\ \dot{h}^{E} &= -1*(-\sin{\theta}u^{b} + \sin{\phi}\cos{\theta}v^{b} + \cos{\phi}\cos{\theta}w^{b}) ,
\end{aligned}
\end{equation}
\end{document}
答案2
- 你的意思不太清楚左对齐。
- 您错误地使用了
aligned
没有锚点的环境来对齐方程式,例如在符号处=
(如其他答案中所建议的那样)。 - 如果你喜欢让所有方程式左对齐(在左侧
\@mathmargin
,默认为 30pt),那么你可以使用fleqn
并修改“聚集环境”,如建议的那样@egreg 回答:
\documentclass[fleqn]{article} % <---
\usepackage{geometry}
\usepackage{amsmath}
\makeatletter
% amsmath.sty, line 1253: taken from https://tex.stackexchange.com/questions/272930/
\renewenvironment{gathered}[1][c]{%
\RIfM@\else
\nonmatherr@{\begin{gathered}}%
\fi
\null\,%
\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi \bgroup
\Let@ \chardef\dspbrk@context\@ne \restore@math@cr
\spread@equation
\ialign\bgroup
%%% In the original there is just \hfil
\if@fleqn\else\hfil\fi\strut@$\m@th\displaystyle##$\hfil
\crcr
}{%
\endaligned
}
\makeatother
\begin{document}
\begin{equation}
\begin{gathered}
\dot{u} = -g\sin\theta + rv - qw \\
\dot{v} = g\sin\phi\cos\theta -ru + pw \\
\dot{w} = \frac{1}{m}(-F_{z}) + g\cos\phi\cos\theta + qu - pv \\
\dot{p} = \frac{1}{I_{xx}}(L + (I_{yy}-I_{zz})qr) \\
\dot{q} = \frac{1}{I_{yy}}(M + (I_{zz}-I_{xx})pr) \\
\dot{r} = \frac{1}{I_{zz}}(N + (I_{xx}-I_{yy})pq) \\
\dot\phi = p + (q \sin\phi + r \cos\phi) \tan\theta \\
\dot\theta = q \cos\phi - r \sin\phi \\
\dot\psi = (q \sin\phi + r \cos\phi) \sec\theta \\
\dot{x}^{E} = \cos\theta\cos\psi u^{b} +
(-\cos\phi\sin\psi+\sin\phi\sin\theta\cos\psi)v^{b} +
(\sin\phi\sin\psi+\cos\phi\sin\theta\cos\psi)w^{b} \\
\dot{y}^{E} = \cos\theta\sin\psi u^{b} +
(\cos\phi\cos\psi+\sin\phi\sin\theta\sin\psi)v^{b} +
(-\sin\phi\cos\psi+\cos\phi\sin\theta\sin\psi)w^{b} \\
\dot{h}^{E} = -1{\cdot}(-\sin\theta u^{b} +
\sin\phi\cos\theta v^{b} + \cos\phi\cos\theta w^{b}) ,
\end{gathered}
\end{equation}
\end{document}