On Thu, Feb 16, 2006 at 08:09:29AM +0100, Pawe? Jackowski wrote:
Heiko,
\pdfescapestring{#}
returns doubled hash of category 12. Is that ok? I mean if it was two hashes in category 6 it wouldn't that strange, but all the characters returned by \pdfescape* are \other. So I think the result for \pdfescapestring{#} should be just one hash of cat 12. ?
It's correct. \pdfescape* call the classic routine
"tokens_to_string" to get a string representation of the tokens.
Then the escape rules are applied.
During tokens_to_string TeX doubles # in this process and
add spaces after macro names.
"tokens_to_string" calls "show_token_list", defined by original TeX;
and is called by "print_pdf_toks" that many primitives use.
Same behaviour as \message, \detokenize, ...
Example for illustration:
\nopagenumbers
\tt
\message{[#|\relax|\string#]}
\pdfescapestring{[#|\relax|\string#]}
\begingroup
\escapechar=-1
\message{[#|\relax]}
\pdfescapestring{[#|\relax|\string#]}
\endgroup
\detokenize{[#|\relax|\string#]}
\begingroup
\catcode`/=0
\catcode`\\=12
/message{[\relax]}
/pdfescapestring{[\relax]}
/detokenize{[\relax]}
/endgroup
\end
Yours sincerely
Heiko