[texhax] Question about cwebmac.tex
Igor Liferenko
igor.liferenko at gmail.com
Thu Feb 4 03:41:59 CET 2016
Hi all,
> E.g., (untested)
>
> \edef \next (\noexpand \pdfoutline goto num 2 {\noexpand \directlua
> {toutf16("\the\toksE")}})
> \next
Thanks, Philip Taylor. This seems to work fine:
\directlua{
function toutf16(str)
tex.write(str)
end
}
\pdfcompresslevel=0
\newtoks\toksE
\toksE{\foo}
\def\foo{bar}
\edef \next {\noexpand \pdfoutline goto num 2 {\noexpand \directlua
{toutf16("\the\toksE")}}}
\next
x
\pdfoutline goto num 3 {\directlua{toutf16("\the\toksE")}}
x
\bye
I would like to point out that I make no changes to cwebmac.tex (the
only issue was non-ascii strings in \pdfoutline, which is now solved)
- I just want to bring some clarity.
I have accumulated two questions.
1) It is curious why in the following example contents of \foo do not
get to the outline (the outline is just "Example program"):
\def\foo{bar}
@* Example \foo program.
@c
@<Something@>;
@ @<Something@>=
void main (void)
2) In the following example "Foo..." is written as "Foo \(test\)
program" to pdf file.
And "If..." is written as "If \(try\) catch" to pdf file.
Although the backslashes are not displayed in pdf viewer, they are not
necessary to print braces in pdf outlines.
Why in cwebmac.tex braces (and other symbols) are escaped with
backslashes in pdf outlines?
@* Foo (test) program.
@c
@<If (try) catch@>;
@ @<If...@>=
void main (void)
Cheers,
Igor
More information about the texhax
mailing list