diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-texorpdf.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-texorpdf.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-texorpdf.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-texorpdf.html new file mode 100644 index 00000000000..a447959c26d --- /dev/null +++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-texorpdf.html @@ -0,0 +1,45 @@ +<head> +<title>UK TeX FAQ -- question label texorpdf</title> +</head><body> +<h3>Token not allowed in PDFDocEncoded string</h3> +<p/>The package <i>hyperref</i> produces this error when it doesn’t +know how to make something into a “character” that will go into one +of its PDF entries. For example, the (unlikely) sequence +<blockquote> +<pre> +\newcommand{\filled}[2]{% + #1% + \hfil + #2% +} +\section{\filled{foo}{bar}} +</pre> +</blockquote><p> +provokes the error. <i>Hyperref</i> goes on to tell you: +<blockquote> +<pre> +removing `\hfil' on input line ... +</pre> +</blockquote><p> +It’s not surprising: how would <em>you</em> put the +typesetting instruction <code>\</code><code>hfil</code> into a PDF bookmark? +<p/><i>Hyperref</i> allows you to define an alternative for such +things: the command <code>\</code><code>texorpdfstring</code>, which takes two +arguments — the first is what is typeset, the second is what is put +into the bookmark. For example, what you would probably like in this +case is just a single space in the bookmark; if so, the erroneous +example above would become: +<blockquote> +<pre> +\newcommand{\filled}[2]{% + #1% + \texorpdfstring{\hfil}{\space}% + #2% +} +\section{\filled{foo}{bar}} +</pre> +</blockquote><p> +and with that definition, the example will compile succesfully +(<i>hyperref</i> knows about the macro <code>\</code><code>space</code>). +<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=texorpdf">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=texorpdf</a> +</body> |