
Il 23/02/2011 10:14, Enea Zaffanella ha scritto:
When producing a PDF file with PDF_HYPERLINKS = yes, the latex generated by a template class documentation such as
[...]
which results in the following warning:
Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `math shift' on input line 4.
The problem is in the use of `$' inside a hypertarget.
The attached patch solves this issue by adding a boolean status flag (insideHypertarget) to classes LatexGenerator and LatexDocVisitor.
NOTE: the patch only addresses the cases of $<$ and $>$.
The same problem occurs on code looking like the following:
template <bool a, bool b> struct Templ<a || b> {};
Here the generated LaTeX looks like
\hypertarget{structTempl_3_01a_7_7b_01_4}{ \section{Templ\texorpdfstring{$<$}{<} a$|$$|$b \texorpdfstring{$>$}{>} Struct Template Reference} [...]
where there are two occurrences of $|$. These too should be replaced by something like
\texorpdfstring{$|$}{|}
but it is unclear to me where such a correction should be applied.
Enea.