3

I want to type math equation in section headers, but I had some error with \tableofcontents command.

When I compile this file

\documentclass{book}
\usepackage[utf8]{inputenc}
\begin{document}

\chapter{Chapter 1}
\section{This is an equation: \(x=1\)}

\tableofcontents

\end{document}

It gives out these error

Bad math environment delimiter. ...ak or <return> to continue without it.}}{1}
Extra }, or forgotten $. ...ak or <return> to continue without it.}}{1}
Missing $ inserted. ...ak or <return> to continue without it.}}{1}
Missing } inserted. \tableofcontents

But this file compile just fine

\documentclass{book}
\usepackage[utf8]{inputenc}
\begin{document}

\chapter{Chapter 1}
\section{This is an equation: $x=1$}

\tableofcontents

\end{document}

So what is the cause of this error? Is there any way to use \(...\) in the section header, or I have to use $...$?

Kureiji
  • 43
  • 4
    Welcome to TeX.SX! Add \usepackage{fixltx2e} to your document preamble (or use $...$). – egreg Feb 10 '15 at 09:44

0 Answers0