Dear All
I am getting some strange behaviour with the following
minimal example via LaTeX with LuaTeX
\pdfoutput=1
\documentclass[12pt]{article}
\begin{document}
\directlua{tex.print("{\it abc}")}
\end{document}
I run the above and get a PDF which displays
the following text
protect protect protect edef OT1OT1let enc@update
I have no idea what is causing this. If I run
the following using plain TeX:
\pdfoutput=1
\directlua{tex.print("{\it abc}")}
\bye
I get a PDF which says:
am itfam enit abc
What am I doing wrong to cause this behaviour?
Log file contains
(\end occurred inside a group at level 1)
### simple group (level 1) entered at line 1 ({)
### bottom level
Cheers
Graham
Here's the log file from the pdflatex run:
==============
This is LuaTeX, Version beta-0.53.0-2010032719 (format=pdflatex
2010.4.13) 16 MAY 2010 18:53
**g:/msys/1.0/trunk/build/texk/latex2.tex
(g:/msys/1.0/trunk/build/texk/latex2.tex
LaTeX2e <2009/09/24>
(g:/msys/1.0/trunk/build/texk/formats/pdflatex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(g:/msys/1.0/trunk/build/texk/formats/pdflatex/base/size12.clo
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (./latex2.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
[1
{g:/msys/1.0/trunk/build/texk/fonts/map/pdftex.map}] (./latex2.aux) )
(\end occurred inside a group at level 1)
### simple group (level 1) entered at line 1 ({)
### bottom level
Here is how much of LuaTeX's memory you used:
210 strings out of 95220
100000,74296 words of node,token memory allocated
264 words of node memory still in use:
2 hlist, 1 vlist, 1 rule, 2 glue, 40 glue_spec, 1 write nodes
avail lists: 2:12,3:3,4:29,5:1,6:60,7:1,9:6,10:4
3678 multiletter control sequences out of 65536+0
15 fonts using 431807 bytes
22i,4n,19p,181b,116s stack positions out of 300i,50n,60p,3000b,4000s
Graham Douglas wrote:
Dear All
I am getting some strange behaviour with the following minimal example via LaTeX with LuaTeX
\pdfoutput=1 \documentclass[12pt]{article} \begin{document} \directlua{tex.print("{\it abc}")} \end{document}
I run the above and get a PDF which displays the following text
protect protect protect edef OT1OT1let enc@update
\directlua expands its argument (like what happens when writing to a file), but font switches tend to expand into internal commands. On top of that, lua strings interpret \ as an escape character. To circumvent both problems at the same time, you can do this: \pdfoutput=1 \let\\\relax \directlua{tex.print("{\\it abc}")} \bye Which should also work in latex (except that it trashes the normal meaning of \\, of course). I am pretty sure that there will be a latex package that deals with all this expansion stuff for you. Best wishes, Taco
participants (2)
-
Graham Douglas
-
Taco Hoekwater