3

This Error-Message is not understandable for me, what's wrong here?

! Extra }, or forgotten \right.<template> }$}\ifmeasuring@ \savefieldlength@ \fi \set@field \endtemplate \end{align}

The following looooong equation causes the error above:

\RequirePackage[patch]{kvoptions} 
\documentclass
%[draft]
{DissOnlineLatex}
%\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{setspace}
%\usepackage[obeyspaces]{url}
\usepackage[style=chem-angew,backend=biber,]{biblatex}%bibtex8,
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage[printonlyused]{acronym}
\bibliography{Literatur.bib}
\onehalfspacing
\usepackage{fancyhdr}
\usepackage[version=3]{mhchem}
\usepackage{eurosym}

\newcommand{\Natural}{{\mathbb{N}}}

\renewcommand{\topfraction}{1.0}
\renewcommand{\bottomfraction}{1.0}
\renewcommand{\floatpagefraction}{1.0}
\renewcommand{\dbltopfraction}{1.0}
\renewcommand{\dblfloatpagefraction}{1.0}

\begin{document}
\begin{align}
\Delta{f}&=4\ln{10}\cdot{\epsilon_{0}c^2}\cdot{}\nonumber
\\
&\left(\left(\frac{\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}{N_{A}e^2\lambda_{av}^2}\cdot{\Delta{m_{e}}}\right)^2
+\left(\frac{m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}{N_{A}^{2}e^2\lambda_{av}^2}\cdot{\Delta{N_{A}}}\right)^2\right.\nonumber{}
\\
\left.&+\left(\frac{2m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}{N_{A}e^3\lambda_{av}^2}\cdot{\Delta{e}}\right)^2
+\left(\frac{2m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}{N_{A}e^2\lambda_{av}^3}\cdot{\Delta{\lambda_{av}}}\right)^2\right.\nonumber{}
\\
\left.&+\left(\frac{m_{e}\sum_{A}{(\Delta\lambda)_{A}}}{N_{A}e^2\lambda_{av}^2}\cdot{\Delta{\varepsilon}}\right)^2
+\left(\frac{m_{e}\sum_{A}{\varepsilon}}{N_{A}e^2\lambda_{av}^2}
\cdot{\Delta(\Delta{\lambda)_{A}}}\right)^2\right)^{\frac{1}{2}}
\end{align}
\end{document}
4
  • Welcome to TeX.SX! You can't have \left on one side of & and the matching \right on the other side.
    – egreg
    Jan 3 '15 at 12:03
  • IMHO this as very common question: misunderstanding how TeX groups like \left...\right are working. That they cannot be crossed with table cells, because they are TeX groups too.
    – wipet
    Jan 3 '15 at 12:05
  • Thx a lot, that works!
    – Peter
    Jan 3 '15 at 12:16
  • 1
    unrelated to your error but you do not want \renewcommand{\floatpagefraction}{1.0} it will make most floats go to the end of a document as float pages are not usable unless the sum of the heights of the floats is exactly the text height. Jan 3 '15 at 13:28
4

The error is in the lines that start with

\left.&+\left

because you can't have \left on one side of & and the matching \right on the other side.

However, there's a better way for doing this, with split and more careful alignment:

\documentclass{report}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{split}
\Delta{f}={}&4\ln{10}\cdot{\epsilon_{0}c^2}\cdot{}
\\
&\Biggl( % to be closed at the end
  \left(
    \frac{\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}
         {N_{A}e^2\lambda_{av}^2}
    \cdot
    \Delta{m_{e}}
  \right)^2
  +
  \left(
    \frac{m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}
         {N_{A}^{2}e^2\lambda_{av}^2}
    \cdot
    \Delta{N_{A}}
  \right)^2
\\
&\hphantom{\Biggl(}
  {}+
  \left(
    \frac{2m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}
    {N_{A}e^3\lambda_{av}^2}
    \cdot
    \Delta{e}
  \right)^2
  +
  \left(
    \frac{2m_{e}\sum_{A}{\varepsilon(\Delta\lambda)_{A}}}
         {N_{A}e^2\lambda_{av}^3}
    \cdot
    \Delta{\lambda_{av}}
  \right)^2
\\
&\hphantom{\Biggl(}
  {}+
  \left(
    \frac{m_{e}\sum_{A}{(\Delta\lambda)_{A}}}
         {N_{A}e^2\lambda_{av}^2}
    \cdot
    \Delta{\varepsilon}
  \right)^2
  +
  \left(
    \frac{m_{e}\sum_{A}{\varepsilon}}
         {N_{A}e^2\lambda_{av}^2}
    \cdot
    \Delta(\Delta{\lambda)_{A}}
  \right)^2
\Biggr)^{\frac{1}{2}}
\end{split}
\end{equation}

\end{document}

The indentation helps in reading the input, but is not essential.

As you notice, I used ={}& in order to put the alignment point at the right of the equals sign; then the third and fourth line start with an \hphantom, so the + signs are at the right of the big parenthesis.

Using ^{1/2} instead of ^{\frac{1}{2} is possibly better.

The example uses a standard class, but it should work also with the one you're loading.

enter image description here

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.