4

I am trying to write equations using flalign and I have text in my equations on the left. What I want is that the text on the left be left aligned however it is currently aligning itself to where the words end leaving blank space on the left hand side in cases where the words are smaller. Below is the code that I am working with

\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}
2
  • Welcome to TeX.SE.
    – Mico
    Dec 21, 2020 at 19:13
  • flalign has three alignment columùns, hence it requires five ampersands.
    – Bernard
    Dec 21, 2020 at 22:06

3 Answers 3

3

Maybe this is a job for 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}

enter image description here

2

Something like this?

enter image description here

\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}

I actually think that an alignat environment may be more suitable to the job than the flalign environment is.

enter image description here

\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}
2

You have to insert the correct number of & in the right place. I suggest another solution, with a simpler code, using the fleqn environment from nccmath, and alignat, which will give you full control on the spacing the text and the equations:

\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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .