1

now I am trying to get this output aligned to the left of my document

Desired output

This is the code that I am using to achieve it :

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign*}
    \begin{alignedat}{10}
    &a &&\phantom{+ b} &&\phantom{+ c} &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+ f} &&\phantom{+ g} &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+}b &&\phantom{+ c} &&+ d &&\phantom{+ e} &&\phantom{+ f} &&\phantom{+ g} &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+} c &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+ f} &&+ g &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+}b &&\phantom{+ c} &&+ d &&\phantom{+ e} &&\phantom{+ f} &&\phantom{+ g} &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+ c} &&\phantom{+ d} &&\phantom{+} e &&\phantom{+ f} &&\phantom{+ g} &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+ c} &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+} f &&\phantom{+ g} &&+ h &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+} c &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+ f} &&+ g &&\phantom{+ h} &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+ c} &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+} f &&\phantom{+ g} &&+ h &&\phantom{+ i} &&= 0 \\
    &\phantom{a} &&\phantom{+ b} &&\phantom{+ c} &&\phantom{+ d} &&\phantom{+ e} &&\phantom{+ f} &&\phantom{+ g} &&\phantom{+ h} &&\phantom{+} i &&= 0
    \end{alignedat}
\end{flalign*}
\end{document}

This is what I am getting though :

Output I'm getting

Could you help me get it to the left of the page as desired?

Any help would be greatly appreciated, thanks in advance.

  • Unrelated: ‘avec $0$ étant …` is really bad style. Just write ‘$0$ étant …’. – Bernard Nov 18 '18 at 11:32
3

This doesn't use flalign but I hope that it helps!

\documentclass{article}
\begin{document}
$\begin{array}{cccccccccc}
    a &   &   &    &   &   &    &    &   &=0 \\
      & b &   &+\;d&   &   &    &    &   &=0 \\
      &   & c &    &   &   &+\;g&    &   &=0 \\
      & b &   &+\;d&   &   &    &    &   &=0 \\
      &   &   &    & e &   &    &    &   &=0 \\
      &   &   &    &   & f &    &+\;h&   &=0 \\
      &   & c &    &   &   &+\;g&    &   &=0 \\
      &   &   &    &   & f &    &+\;h&   &=0 \\
      &   &   &    &   &   &    &    & i &=0
\end{array}$
\end{document}

enter image description here

One advantage of this is that you can use it in the same line with your text (though I don't use that advantage usually).

  • 1
    Wow, why was I giving myself so much trouble when this answer is simple yet so elegant 😊 thank you so much for that answer. – Sephya Nov 18 '18 at 5:54
  • 1
    @Sephya: FYI, The correct binary operator spacing is given by {}+x, not +\;d. – Peter Grill Nov 18 '18 at 7:15
  • @PeterGrill Thank you very much! I haven't heard of that before 😅 – JouleV Nov 18 '18 at 7:20
  • @PeterGrill thanks for the tip, really appreciated – Sephya Nov 18 '18 at 8:24
1

You can easily left-align any display equations with the \fleqn environment from nccmath. An optional argument specifies at which distance the left margin the equations start (0pt by default).

I propose two solutions: one based on alignat*, with a simpler code, and another, with the systeme package – probably the simplest possible syntax:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{amsmath, nccmath}
\usepackage{systeme} 

\begin{document}

\begin{fleqn}[\parindent]
     \begin{alignat*}{10}
    & a & \phantom{{}+{}} & &\phantom{{}+{}} & & & &\phantom{{}+{}}& &\phantom{{}+{}}& & & &\phantom{{}+{}} & &\phantom{{}+{}}& & & = 0 \\
    & & & b & & & &+ d & & & & & & & & & & & & = 0 \\
    & & & & & c & & & & & & & & + g & & & & & &= 0 \\
    & & & b & & & &+ d & & & & & & & & & & & & = 0 \\
    & & & & & & & & & e & & & & & & & & & & = 0 \\
    & & & & & & & & & & & f & & & & + h & & & & = 0 \\
    & & & & & c & & & & & & & & + g & & & & & & = 0 \\
    & & & & & & & & & & & f & & & & + h & & & & = 0 \\
    & & & & & & & & & & & & & & & & & & i & = 0
    \end{alignat*}

    \sysdelim..
    \systeme{a = 0, \phantom{+}b + d = 0, \phantom{+}c + g = 0, b + d = 0, \phantom{+}e = 0, \phantom{+}f + h = 0, c + g = 0, f + h = 0, \phantom{+} i = 0}
\end{fleqn}

\end{document} 

An optional argument lets you choose

  • FYI, I used to use the nccmath package package but ran into numerous issues that I decided to drop it. See Is there a replacement for nccmath? and the problems listed in the question. If all you want is the fleqn environment, you can use Stefan Kottwitz's solution from nccmath affecting minipage widths. – Peter Grill Nov 18 '18 at 17:14
  • I personally never met a problem with nccmath, but I rarely use minipages. I use this package mainly for its medium-sized fractions (and formulæ, more generally) and its useful \useshortskip command. – Bernard Nov 18 '18 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.