我已经发布了这个问题 \bar 和 \overline
当我放入 \Xbar
目录时出现此错误:
缺失数字,视为零。 ... }\copy 2 }_{n_2}$}{18}{subsection.1.12.4}
怎么了 ?
有什么建议吗?
我的MWE
\documenclass{article}
\usepackage{amsmath,amsfonts,mathtools}
\usepackage{hyperref}
\makeatletter
\newcommand*{\Xbar}{%
\mathpalette\@Xbar{}%
}
\newcommand*{\@Xbar}[2]{%
% #1: math style
% #2: unused (empty)
\sbox0{$#1\mathrm{X}\m@th$}%
\sbox2{$#1X\m@th$}%
\rlap{%
\hbox to\wd2{%
\hfill
$\overline{%
\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}