4

I know how I can align an equation to the left with flalign*. And I also know how to have an equation with multiple "tabstops" (I don't know what else to call it) using align* with &&. But I can't get both: An equation at the left with multiple tabstops. What I want is about this, but on the left:

A = abc*2 + jkl
  =     a + kdjfk

Notice that "+" and "=" are both aligned. Can anyone tell me how to do that in LaTeX? I have searched for a while by now but didn't find anything.

3
  • 1
    Welcome to TeX.SE!
    – Zarko
    Sep 14, 2022 at 20:55
  • What's the reason for left alignment?
    – egreg
    Sep 14, 2022 at 22:38
  • Thank you so much all for helping me all, I got so many anwers so quickly, really nice community! @egreg I sometimes use LaTeX to do some math exercises and when the text above doesn't even fill half the line I think it looks better when the equation isn't centred. And thanks for the answer, really helped!
    – Hebol
    Sep 15, 2022 at 10:29

4 Answers 4

4

A solution with the alignat environment and the fleqn environment from nccmath:

    \documentclass{article}
    \usepackage{nccmath}
    \usepackage{amsmath}
    \usepackage{lipsum}

    \begin{document}

    \lipsum[11]
    \begin{fleqn}
    \begin{alignat}{2}
      A & = abc*2 &{} & + jkl \\
       & = a & & + kdjfk
    \end{alignat}
    \end{fleqn}

    \end{document} 

enter image description here

5

I see no reason in general for a display to be flush left.

Anyway, “multiple tab stops” scream for alignedat.

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for mock text

\newenvironment{leftequation*}
 {\begin{equation*}\hspace{0pt}}
 {\hspace{1000pt minus 1fil}\end{equation*}\ignorespacesafterend}

\begin{document}

\lipsum*[1][1-4]
\begin{leftequation*}
\begin{alignedat}{2}
  A &= abc*2 &&+ jkl \\
    &=     a &&+ kdjfk
\end{alignedat}
\end{leftequation*}
\lipsum*[3][5-10]

\end{document}

enter image description here

4

You can use inner aligned-like environments

enter image description here

\documentclass{article}
\usepackage{mathtools}
\usepackage{showframe}
\begin{document}
\begin{flalign*}
  &A  \begin{alignedat}[t]{2}
        &={}& abc * 2 &+ jkl \\
        &={}&       a &+ kdjfk \\
      \end{alignedat} &
\end{flalign*}
\end{document}
1
  • Thank you very much!
    – Hebol
    Sep 15, 2022 at 12:25
4

Is the result of

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent
$\begin{alignedat}{2}
 A &= abc*2 &&+ jkl \\
   &=     a &&+ kdjfk
\end{alignedat}$
\end{document}

close enough to the left-hand edge of the text block for your taste?

enter image description here

The vertical line represents the left-hand edge of the textblock.

1
  • Works great, thanks a lot!
    – Hebol
    Sep 15, 2022 at 10:39

You must log in to answer this question.

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