[luatex] \latelua

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Jul 13 11:30:06 CEST 2014


Am 13.07.2014 10:01, schrieb Joseph Wright:

> the text "late" is inserted into the second page after "Second" but
> before "direct", while if I omit the \directlua call on page two "late"
> vanishes entirely. The manual does not give a lot away: is there a good
> explanation/set of demos somewhere?


\nopagenumbers
\pdfcompresslevel=0
\newcount\gstatelevel
\def\pdfsave{\latelua{pdf.print("page", "q\string\n")}}
\def\pdfrestore{\latelua{pdf.print("page", "Q\string\n")}}
\def\pdflocal#1#2{\begingroup%
  \ifnum\currentgrouplevel=\gstatelevel
  \else
    \gstatelevel=\currentgrouplevel \pdfsave \aftergroup\pdfrestore
  \fi
  \latelua{pdf.print"#1\string\n"}#2\endgroup}
\relax
\bf\pdflocal{0.5 g}{This is \pdflocal{0.6 g}{\it gray}} and this black!
\bye

With \latelua the color setting is written into the pdf during
shipout when the objects are also written.

Replace the \latelua with \directlua and have a look into the
created PDF. You'll see that the color setting was too early
written into the pdf.

Herbert



More information about the luatex mailing list