15

I want to align equations (using the align environment from the amsmath package) inside matching \left( and \right) commands. For example:

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
    a \left( b &= c \right)\\
    d \left( e &= f \right)
\end{align}

\end{document}

But that code gives this error:

Extra }, or forgotten \right.

The error disappears when I remove the delimiters. Is there a workaround for this?

migrated from stackoverflow.com Feb 14 '14 at 18:01

This question came from our site for professional and enthusiast programmers.

15

You cannot split \left...\right across alignment tabs. One solution is to use the \big-delimiters (which don't require pairwise usage):

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath

\begin{document}

\begin{align}
  a \bigl( b &= c \biggr) \\
  d \Bigl( e &= f \Biggr)
\end{align}

\end{document}

The above example is just to illustrate some delimiter sizes you can choose from. See section 4.14.1 Delimiter sizes of the amsmath user guide for more options:

enter image description here

Alternatively, one can adjust the alignment manually and avoid using & altogether. However, the above option is far easier to manage.

  • This. Plus: never use \left and \right as long as you don't need to be bigger than Bigger – yo' Feb 14 '14 at 18:15
2

You can also accompany (i) \left( with \right. or (ii) \left. with \right). In other words,

\documentclass[a4paper,12pt]{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
    a \left( b \right. &=  \left. c \right)\\
    d \left( e \right. &=  \left. f \right)
\end{align}

\end{document}

In that way, you will not obtain the error that you posted.

  • 2
    Hi, welcome. The (potential) drawback of this is that it doesn't work well if b and c has different heights (try replacing c with \frac{a}{c}). You'll get different size parenthesis, unless you e.g. add a \vphantom{\frac{a}{c}} on the left side. – Torbjørn T. May 10 '17 at 18:34

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.