0

In the following example, I would like to align the two equations where there are the symbols of "integral", but I get an error if I place the "&" sign (of the "align" environment) between the "\left( \right)" brackets. Any solution?

The following works (the "&" sign is outside the "\left( \right)" brackets):

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
I = \inf_{x} &\int f(x)dx \\
  = &\left( \int_{\Omega} f(u)du \right)  \\ \nonumber
\end{align}
\end{document}

enter image description here The following is what I would like to achieve, but it does not work (the "&" sign is between the "\left( \right)" brackets):

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
I = \inf_{x} &\int f(x)dx \\
  = \left( &\int_{\Omega} f(u)du \right)  \\ \nonumber
\end{align}
\end{document}

The error is the following:

This compile didn’t produce a PDF. This can happen if: There is an unrecoverable LaTeX error. If there are LaTeX errors shown below or in the raw logs, please try to fix them and compile again. The document environment contains no content. If it’s empty, please add some content and compile again. This project contains a file called output.pdf. If that file exists, please rename it and compile again.

Ommo
  • 835
  • 2
    You cannot have a line break or & inside a \left ... \right pair. The parser cannot see it. Instead manually scale the fences using one of \big\Big\bigg\Bigg (I normally use the \xxxl and \xxxr variants, as in \Bigl and \Bigr)' – daleif Sep 08 '23 at 10:54
  • Many thanks, with the \big( \Big( \bigg( \Bigg( commands it works!! However, I do not know about the \xxxl and \xxxr variants...never seen them so far.. :-) – Ommo Sep 08 '23 at 10:59
  • 1
    They are used in certain cases there it matters whether the fence should be marked as open (l) or close (r). Consider |-2 < x < 2 compare with \bigl|-2<x<2, the spacing is different. | is a normal symbol, and unless I'm mistaken so is \big( but \bigl( marks it as an open. The | if used in say \{... | ... \} can be helped using |\mathopen{} that also tells - that it comes after an open and thus is a sign, not addition. – daleif Sep 08 '23 at 11:16
  • Thanks a lot for your explanation @daleif! :-) – Ommo Sep 08 '23 at 11:50

0 Answers0