# problem in tableofcontents

I have posted this question \bar and \overline

When I put \Xbar in tableofcontents I get this error :

\vrule width 0pt height\ht0 %

\vrule width 0pt height\ht0 %
\kern\wd0 %
}$% }% }% \copy2 % } \makeatother \begin{document} \tableofcontents \section{Test of \texorpdfstring{$\Xbar_{n_1}$}{} and \texorpdfstring{$\Xbar_{n_2}{}}

\section{another section}
\section{Third section}
$\Xbar$

\end{document}

• Please edit your example, there is errors not related to the issue. – touhami Jun 27 '16 at 23:04
• Use \protect\Xbar when in a section title. – egreg Jun 27 '16 at 23:08
• I used \protect without success I get this message error in my system (Miktex 2.9) : – Aviroum Jun 28 '16 at 1:08
• ! Missing number, treated as zero. <to be read again> } ! Missing number, treated as zero. <to be read again> } l.29 ... }\copy 2 }_{n_2}$}{18}{subsection.1.12.4} A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look up weird error' in the index to The TeXbook.) – Aviroum Jun 28 '16 at 1:09 • ! Color stack action is missing. <to be read again> } l.29 ... }\copy 2 }_{n_2}$}{18}{subsection.1.12.4} The expected actions for \pdfcolorstack: set, push, pop, current I'll ignore the color stack command. – Aviroum Jun 28 '16 at 1:09