1

Error is:

Argument of \@secondoftwo has an extra }.
<inserted text> 
                \par 
l.4 ...{$g(x)$} of the form \texorpdfstring{$ax$}}

MWE to get the error is:

\documentclass{article}
\usepackage{hyperref}
\begin{document}  
\subsubsection{With \texorpdfstring{$g(x)$} of the form \texorpdfstring{$ax$}}
\end{document}  

Note:

I "solved" the error by placing a dot immediately after the \texorpdfstring command (why does it work?, I have no idea, I just was lucky), it's like if \texorpdfstring is waiting for an argument to end.

Solved error:

\documentclass{article}
\usepackage{hyperref}
\begin{document}  
\subsubsection{With \texorpdfstring{$g(x)$} of the form \texorpdfstring{$ax$}.}
\end{document}  

1 Answer 1

5

hyperref takes the text for bookmarks from the arguments of commands like \section, which can contain things like math, colors, or font changes, none of which will display in the pdf bookmarks as is.

Correct \texorpdfstring syntax is

\texorpdfstring{TEXstring}{PDFstring}
2
  • 1
    You will also see that in your "working" example in the question, the o in of is missing from the PDF, as \texorpdfstring grabs that as it's second argument. Commented Jul 19, 2015 at 7:07
  • @TorbjørnT. That is right, not really noticeable though, thanks so much for making that point stand out.
    – Hans
    Commented Jul 19, 2015 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .