5

How is it able to center a single line in an align?

I want to center 0 = 0.

MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
0 = 0\\
a &= b & c &= d\\
a &= b & c &= d\\
a &= b & c &= d\\
a &= b & c &= d
\end{align*}

\end{document}
3
  • This question contains some possibly relevant information regarding using aligned together with gather*. Commented Mar 5, 2019 at 15:42
  • @barbarabeeton I'm unsure what exactly you want to point out
    – user1
    Commented Mar 5, 2019 at 16:28
  • The answers contain examples using both gather* and aligned, although only a single "column" is aligned. This might not be an obvious help to you, but it might help some future person loolking for information. Commented Mar 5, 2019 at 17:24

2 Answers 2

6

To have more or less the spacing of the original code, I'd use the alignedat environment, to have full control on the spacing:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{gather*}
0 = 0\\
\begin{alignedat}{2}
a &= b &\hspace{10em} c &= d\\
a &= b & c &= d\\
a &= b & c &= d\\
a &= b & c &= d
\end{alignedat}
\end{gather*}

\end{document} 

enter image description here

7
  • Is it possible, to align the 0=0 with a more equations -0=0, ...?
    – user1
    Commented Mar 5, 2019 at 13:47
  • 1
    Not sure to fully see what you want, but try nesting them in another aligned environment.
    – Bernard
    Commented Mar 5, 2019 at 14:17
  • This works. Another question: Did YOU choose the space 10em freely? AMS splits the hole free horizontal space around and in-between the equations equally, doesn't it?
    – user1
    Commented Mar 5, 2019 at 14:24
  • 1
    Actually &\hspace{10em}c denotes the l.h.s. of the 2nd column of alignment. This l.h.s. is right-aligned w.r.t. the following &=.
    – Bernard
    Commented Mar 5, 2019 at 14:36
  • I'm unsure, if I got this right. Especially I'm unsure, what l.h.s. stands for... I guess alignedat is just an aligned with zero space between the equations, right?
    – user1
    Commented Mar 5, 2019 at 16:34
4
\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{gather*}
0 = 0\\
\begin{aligned}
a &= b & c &= d\\
a &= b & c &= d\\
a &= b & c &= d\\
a &= b & c &= d
\end{aligned}
\end{gather*}

\end{document}

enter image description here

2
  • 1
    :-( Also I was using gathered package :-) LOL.
    – Sebastiano
    Commented Mar 5, 2019 at 12:44
  • 2
    @Sebastiano Great minds think alike! Commented Mar 5, 2019 at 12:45

You must log in to answer this question.

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