0

I want to align my equations in such a way that every + and - are written in one row.

I want to do it like this:

\begin{align*}
&+ \left( \gamma^{r}_{y} \gammabar^{v}_{u} \gammabar^{x}_{s}  &- \gamma^{r}_{y} \gammabar^{v}_{s} \gammabar^{x}_{u} \right) \\
&- \lb \gamma^{r}_{y} \gammabar^{v}_{q} \gammabar^{x}_{s}  &+ \gamma^{r}_{y} \gammabar^{v}_{s} \gammabar^{x}_{q} \rb \\
\end{align*}

Where \gammabar is a macro for \bar{\gamma}

But if I want to do that I get an error:

Extra } or forgotten \right \end{align*}

So does anybody know what's going on there?

So I want to align not only with one &, but many &'s.

  • And what are \lb and rb, if you don't mind? – Bernard Jun 7 at 13:24
  • 1
    The message probably comes from the fact you can't have an & between \left and \right. – Bernard Jun 7 at 13:30
  • @Bernard ah sorry \lb = \left( and \rb = \right). So I need to use stuff like \big( and \big) with an & in between? – Armani42 Jun 7 at 13:55
  • Yes. More precisely (for correct spacing reasons), \bigl( and \bigr). – Bernard Jun 7 at 13:58
0

If I've well understood what you want to achieve, you need the alignat environment, for a full control on the spacing between the alignment columns. This is what I propose:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\gammabar}{\bar{\gamma}}
\newcommand{\lb}{\bigl(}
\newcommand{\rb}{\bigr)}

\begin{document}

\begin{alignat*}{2}
&+ \bigl( \gamma^{r}_{y} \gammabar^{v}_{u} \gammabar^{x}_{s} &{}-{} & \gamma^{r}_{y} \gammabar^{v}_{s} \gammabar^{x}_{u} \bigr) \\
&- \lb \gamma^{r}_{y} \gammabar^{v}_{q} \gammabar^{x}_{s} &{}+{} & \gamma^{r}_{y} \gammabar^{v}_{s} \gammabar^{x}_{q} \rb \\
\end{alignat*}

\end{document} 

enter image description here

  • Okay, thank you very much! That helped a lot :) – Armani42 Jun 7 at 14:10
  • B.t.w., don't forget: n alignment columns require 2n –1 ampersands. – Bernard Jun 7 at 14:13

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