[Dev-luatex] .BEILMOPS or how I stopped worrying and love Open Source

Hans Hagen pragma at wxs.nl
Wed Dec 12 09:56:41 CET 2007

Jonathan Sauer wrote:

... zip file ...

when using lpeg an dmatching, keep in mind that \unexpanded has the side 
effect of introducing spaces

\edef\oeps{\unexpanded{\t\n}} \meaning\oeps
\edef\oeps{\string\t\string\n} \meaning\oeps

indeed your weird file produces an empty page but that due to your macro 
... the simple example

\pdfoutput1 \pdfcompresslevel=0



also produces an empty page, just call


this has to do with the fact that you use tabs in your file and you have 
not handled tab in your format

btw, if you change \unexpanded by \detokenize you get the desired result

a simple test shows ...

\directlua0{lpeg.print(lpeg.S(" \string\t\string\n"))}
\directlua0{\unexpanded{lpeg.print(lpeg.S(" \t\n"))}}
\directlua0{\detokenize{lpeg.print(lpeg.S(" \t\n"))}}

00: set [(09-0a)(20)]
09: end
00: set [(0a)(20)(2e)(42)(45)(49)(4c-4d)(4f-50)(53)]
09: end
00: set [(09-0a)(20)]
09: end

a simpler test is:

\directlua0{print("1 \string\t\string\n")}
\directlua0{\unexpanded{print("2 \t\n")}}
\directlua0{\detokenize{print("3 \t\n")}}

this gives




a simple write as in

\immediate\write16{1 \string\t\string\n}
\immediate\write16{\unexpanded{2 \t\n}}
\immediate\write16{\detokenize{3 \t\n}}

1 \t\n
2 \t \n
3 \t \n

(so, your problem is unrelated to lpeg)


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl

More information about the dev-luatex mailing list