我正在尝试使用 flalign 编写方程式,并且方程式左侧有文本。我想要的是左侧的文本左对齐,但它目前会自行对齐到单词结束的位置,在单词较小的情况下会在左侧留出空白。以下是我正在使用的代码
\begin{flalign}
&& \theta_{0}(t) &= K_{v}\int\limits_0^t e_{0}(\lambda)d\lambda&\\
\text{On differentiating} && \Dot{\theta}_{0}(t) &= K_{v}e_{0}(t)&\\
\text{On transforming} && s\theta_{0}(s) &= K_{v}E_{0}(S)&\\
\end{flalign}
答案1
也许这是一份工作witharrows
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{witharrows}
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
\begin{document}
\begin{DispWithArrows}[displaystyle,fleqn]
\theta_{0}(t) &= K_{v}\int\limits_0^t e_{0}(\lambda)\diff\lambda
\Arrow{\text{On differentiating}}\\
\Dot{\theta}_{0}(t) &= K_{v}e_{0}(t)
\Arrow{\text{On transforming}}\\
s\theta_{0}(s) &= K_{v}E_{0}(S)\vphantom{\int\limits_0^t}
\end{DispWithArrows}
\end{document}
答案2
像这样吗?
\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'flalign' env.
\begin{document}
\begin{flalign}
& & \theta_{0}(t) &= K_{v}\int_0^t\!e_{0}(\lambda)\,d\lambda &\\
&\text{On differentiating} & \Dot{\theta}_{0}(t) &= K_{v}e_{0}(t) &\\
&\text{On transforming } & s\theta_{0}(s) &= K_{v}E_{0}(S) &
\end{flalign}
\end{document}
我实际上认为,alignat
环境可能比环境本身更适合这份工作flalign
。
\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'alignat' env.
\begin{document}
\begin{alignat}{3}
& && \hspace{2cm} & \theta_{0}(t) &= K_{v}\int_0^t\!e_{0}(\lambda)\,d\lambda\\
&\text{On differentiating}&& & \Dot{\theta}_{0}(t) &= K_{v}e_{0}(t) \\
&\text{On transforming} && & s\theta_{0}(s) &= K_{v}E_{0}(S)
\end{alignat}
\end{document}
答案3
您必须在正确的位置插入正确数量的 &。我建议使用另一种解决方案,使用更简单的代码,使用fleqn
来自nccmath
、 和 的环境alignat
,这将使您能够完全控制文本和方程式的间距:
\documentclass{article}
\usepackage{nccmath, mathtools}
\usepackage{showframe}
\usepackage{amssymb}
\begin{document}
\begin{flalign}
&& \theta_{0}(t) &= K_{v}\int\limits_0^t e_{0}(\lambda)d\lambda&\\
& \text{On differentiating} & \Dot{\theta}_{0}(t) &= K_{v}e_{0}(t)&\\
& \text{On transforming} & s\theta_{0}(s) &= K_{v}E_{0}(S)&\\
\end{flalign}
\begin{fleqn}
\begin{alignat}{2}
&& \theta_{0}(t) &= K_{v}\int\limits_0^t e_{0}(\lambda)d\lambda \\
& \text{On differentiating} &\hspace{4em} \Dot{\theta}_{0}(t) &= K_{v}e_{0}\\
& \text{On transforming} & s\theta_{0}(s) &= K_{v}E_{0}(S)
\end{alignat}
\end{fleqn}
\end{document}