0

I have an "issue" with the following code:

\documentclass[border=1pt]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\begin{document}
    \begin{math}
        \Leftrightarrow \left\{
        \begin{alignedat}{1}
            &c = -4a + 2b + 3 \\
            &-3a + 3b + 3 = 6 \\
            &4b + 3 = 15
        \end{alignedat}
        \right.
    \end{math}
\end{document}

Which produces:

Minus not aligned.

As we can see, the minus of the second line is not correctly aligned (too much forward).

Now check the following code:

\documentclass[border=1pt]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\begin{document}
    \begin{math}
        \Leftrightarrow \left\{
        \begin{alignedat}{2}
            &&c = -4a + 2b + 3 \\
            &&-3a + 3b + 3 = 6 \\
            &&4b + 3 = 15
        \end{alignedat}
        \right.
    \end{math}
\end{document}

Which produces:

Minus aligned but third line gone away.

We can see that the minus of the second line is now correctly aligned, but the third line completly gone away... We can also note that the minus is closer to the "3a".

My question is: how I can do to get both minus aligned and third line correctly in its place? Like in the following image (which is a photomontage):

The result that I'm looking for.

Thanks for help and regards.

  • Please -- as usual here -- make your code snippets compilable then we do not have to guess what you are doing! – Kurt Mar 17 at 16:21
  • @Kurt I corrected the post. – MissingBracket Mar 17 at 16:28
  • Your 2nd alignment is normal: you indicated two alignment columns, but specified only one alignment point, so by default the alignment of the second column is at the end of lines. – Bernard Mar 17 at 16:31
3

You shouldn't use \{ or \[ for such things. amsmath already give you cases environment:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\Leftrightarrow\begin{cases}
c = -4a + 2b + 3 \\
-3a + 3b + 3 = 6 \\
4b + 3 = 15
\end{cases}\]
\end{document}

enter image description here

  • Thanks for your reply, can you explain me the usefulness of the \[, \] in the present case? – MissingBracket Mar 17 at 16:31
  • @MissingBracket They are LaTeX (not TeX) commands for display-style math-mode. You can change them to $ (it becomes in-line math-mode), or \begin{math} and \end{math} without any problems. – JouleV Mar 17 at 16:33

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.