Paket hyperref Warnung: Token in einer PDF-Zeichenfolge nicht zulässig (PDFDocEncoding)

Paket hyperref Warnung: Token in einer PDF-Zeichenfolge nicht zulässig (PDFDocEncoding)

Beim Laden des Hyperref-Pakets wie:

\usepackage[bookmarks,bookmarksnumbered]{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue,anchorcolor =red,citecolor = blue,filecolor = red,urlcolor = red}

Ich erhalte die folgende Hyperref-Warnung in meiner Protokolldatei:

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\<def>-command' on input line 174.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\cnotenum' on input line 174.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\<def>-command' on input line 174.
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\@corref' on input line 174.

Aber in Zeile 174 ist es nur eine Gleichung:

\begin{equation}\label{eq_DefP}
\mathbf{P} = <\boldsymbol{p}> = <\boldsymbol{\sigma}>
\end{equation}

Wenn ich diese Zeile kommentiere, erscheint sie in der nächsten Gleichung. Vor dieser Zeile gibt es auch Gleichungen, aber es erscheint keine Warnung. Kann mir jemand helfen, diese Warnung zu beheben?

Hier habe ich ein kleines Beispiel aufgeführt:

\documentclass[final,3p,times,authoryear]{elsarticle}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage[bookmarks,bookmarksnumbered]{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue,anchorcolor =red,citecolor = blue,filecolor = red,urlcolor = red}

\journal{Elesvier}

\begin{document}

\begin{frontmatter}

\title{Title}

\author[GRs]{author\corref{cor}}

\cortext[cor]{Corresponding author.}

\end{frontmatter}

\begin{equation}\label{eq_DefP}
\mathbf{P} = <\boldsymbol{\sigma}>
\end{equation}

\end{document}

Ich denke, das ist das Problem, \author[GRs]{author\corref{cor}}denn wenn ich es lösche, \corref{cor}ist alles wieder normal. Aber ich brauche das, also wie kann ich das machen?

Antwort1

Das Problem liegt nicht an der Gleichung, sondern nur an der Stelle, wo das Problem gemeldet wird. Am Ende der ersten Seite speichert hyperref den Titel und den Autor in den PDF-Informationen und beschwert sich dann über das \corref im Autorennamen.

Am besten fügen Sie es manuell ein mit pdfauthor:

\documentclass[final,3p,times,authoryear]{elsarticle}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage[bookmarks,bookmarksnumbered]{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue,anchorcolor =red,citecolor = blue,filecolor = red,urlcolor = red,
            pdfauthor=author}

\journal{Elesvier}

\begin{document}

\begin{frontmatter}

\title{Title}

\author[GRs]{author\corref{cor}}

\cortext[cor]{Corresponding author.}

\end{frontmatter}

\begin{equation}\label{eq_DefP}
\mathbf{P} = <\boldsymbol{\sigma}>
\end{equation}

\end{document}

Antwort2

Ein ähnlicher Fix wie der von Ulrike wird berichtet indiese Antwort, mit einer ähnlichen Wirkung wie \texorpdfstring:

\pdfstringdefDisableCommands{%
  \def\corref#1{<#1>}%
}

Antwort3

Die Lösung von daleif funktioniert bei mir einwandfrei:

\author[add1]{Author1\texorpdfstring{\corref{cor1}}{}}
\ead{[email protected]}     % e-mail of the author

\cortext[cor1]{Corresponding author}
\address[add1]{Institute for Study of Things}

verwandte Informationen