请考虑以下示例:
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\begin{document}
\begin{align}
\label{func1a}
U(X,Y)
&= 2X + 5Y,\\
\label{func1b}
U(X,Y)
&= (XY)^{0.5},\\
\label{func1c}
U(X,Y)
&= \min(X,Y).
\end{align}
\section{The function~\eqref{func1a}}
\end{document}
这将产生以下警告:
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\hbox' on input line 20.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\mathsurround' on input line 20.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\z@' on input line 20.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\unskip' on input line 20.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\@@italiccorr' on input line 20.
我该如何解决?
PS 这些警告是由于hyperref
。
答案1
hyperref
能够应付\ref
但不能\eqref
;你可以这样教它:
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\pdfstringdefDisableCommands{\def\eqref#1{(\ref{#1})}}
\begin{document}
\begin{align}
\label{func1a}
U(X,Y)
&= 2X + 5Y,\\
\label{func1b}
U(X,Y)
&= (XY)^{0{.}5},\\
\label{func1c}
U(X,Y)
&= \min(X,Y).
\end{align}
\section{The function~\eqref{func1a}}
\end{document}