1

I'm having a spacing glitch that I don't understand, while it should be obvious:

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}

Blabla:
    \begin{gather*}
        A = B, \\
    \begin{align*}
        C = D &= 1,
        &D = E &= 0.
    \end{align*}
    \end{gather*}

\end{document}

Here's a preview of the issue: enter image description here

As the picture shows, the two bottom equations aren't properly centered relative to the upper equation. Whatever where I put the & tabs, I get the same weird horizontal spacing. The second and third equations should be symmetrical, relative to the first equation. What's wrong with this simple code?

Notice that if I let the default equation numbering (removing the *), solves the issue. But then, I don't want these equations to be numbered in this special case. Adding the command \nonumber doesn't solve the issue.

3
  • Ahaa!! Adding the command \nonumber just after the \\ solves the issue!
    – Cham
    Commented May 29 at 15:28
  • that is probably a bug \nonnumber shouldn't have an effect in the * forms Commented May 29 at 15:33
  • 4
    If you have just three formulas to place in “triangle form”, just add space between the two on the bottom line, rather than using align.
    – egreg
    Commented May 29 at 15:56

1 Answer 1

2

Either use -ed form inside gather, here aligned, separate the environments, use only align* or add space manually as proposed by egreg.

Example:

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}

\verb|aligned| inside \verb|gather*|:
\begin{gather*}
  A = B, \\
  \begin{aligned}
    C = D & = 1, & D = E & = 0.
  \end{aligned}
\end{gather*}

\verb|equation*| then \verb|align*|:
\begin{equation*}
  A = B,
\end{equation*}
\begin{align*}
  C = D & = 1, & D = E & = 0.
\end{align*}

Only \verb|align|:
\begin{align*}
  &      & A & =B \\
  C = D & = 1, &   &  & D = E & = 0.
\end{align*}

Only \verb|gather|:
\begin{gather*}
  A  =B \\
  C = D = 1, \qquad D = E = 0.\\
  C = D = 1, \hspace{3cm} D = E = 0.
\end{gather*}

\end{document}

Example

8
  • I did tried this, but then the spacing between both equations is way too small. The standard align environment is normally giving the right horizontal spacing.
    – Cham
    Commented May 29 at 15:20
  • @Cham See my edited answer.
    – jlab
    Commented May 29 at 15:31
  • Your second solution adds too much vertical space between the two sets of equations. I found the proper solution (see my comment below my question).
    – Cham
    Commented May 29 at 15:31
  • @Cham I forgot to remove a \\. See my edited answer. Anyway, mixing align* gather* and \nonumberis not the proper solution.
    – jlab
    Commented May 29 at 16:04
  • Your second solution still adds too much vertical space. Your third solution adds too much horizontal space between equations.
    – Cham
    Commented May 29 at 16:52

You must log in to answer this question.

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