Hi, while playing around with luatex and ledmac I produced somewhat strange PDF's. This is a minimal example: \pdfcompresslevel=0 \documentclass{article} \usepackage[T1]{fontenc} \usepackage{ledmac} \usepackage{MinionPro} \makeatletter \renewcommand*{\do@line}{% {\vbadness=10000 \splittopskip=0pt \do@linehook \l@demptyd@ta \global\setbox\one@line=\vsplit\raw@text to\baselineskip}% \unvbox\one@line \global\setbox\one@line=\lastbox \getline@num \affixline@num \hb@xt@ \linewidth{% \l@dld@ta\add@inserts\affixside@note \l@dlsn@te% left side note {\ledllfill \hb@xt@ \wd\one@line{\new@line\unhbox\one@line}% \ledrlfill\l@drd@ta% \l@drsn@te}% right side note \latelua0{}% <-- This is the new line }% \add@penalties} \makeatother \begin{document} \beginnumbering \pstart \input tufte \pend \endnumbering \end{document} I'm using the commercial Minion Pro font here, because it visualizes the faults of the pdf: The last charakter of each line is overprinted by a crossed rectangle. In case you don't have Minion Pro on your computer, I put the pdf on the web: http://sopos.org/olli/examples/lualedmac.pdf (and http://sopos.org/olli/examples/lualedmac2.pdf for a version done without the \latelua statement). Using lmodern the PDF turns out to be still faulty, though one can't see on screen. I investigated a little bit and took a look into the pdf. The pdf contains extra newlines, which appear *within* the last string of a line (so, if a line ends with »ca-«, the pdf file looks like this: ...-241(c)-3(a- )]TJ...) Here's the beginning of such a pdf file: %PDF-1.4 %ÐÔÅØ 3 0 obj << /Length 2672
stream BT /F19 9.9626 Tf 148.712 707.125 Td [(W)96(e)-241(t)-6(hr)-6(i)6(v)8(e)-242(in)-242(inf)8(o)12(r)-5(m)2(a)19(t)-4(io)11(n||t)-5(hic)5(k)-242(w)7(o)12(r)4(ld)3(s)-241(b)-9(e)-5(c)-3(a)18(u)3(s)-7(e)-242(o)11(f)-242(o)10(ur)-241(m)2(a)9(r)-28(v)7(e)4(lo)11(u)3(s)-241(a)8(n)4(d)-242(e)-8(v)7(er)-28(y)7(d)-2(a)17(y)-241(c)-3(a- )]TJ -14.944 -11.955 Td [(p)-5(aci)11(t)-2(y)-337(t)5(o)-336(s)-8(e)3(le)-4(c)-7(t,)-365(e)-5(di)11(t,)-363(sin)7(g)-6(le)-337(o)10(u)12(t,)-364(s)4(t)-4(r)-10(uc)-7(t)9(ur)13(e)6(,)-363(hig)-7(h)-5(lig)-7(h)18(t,)-364(g)-5(r)12(o)11(u)12(p)29(,)-363(p)-5(a)8(ir)63(,)-364(m)3(er)8(g)8(e)6(,)-363(h)2(a)9(r)-5(m)3(o)12(nize)6(, )]TJ 0 -11.955 Td [(sy)-3(n)18(t)-5(h)3(esize)6(,)-328(f)8(o)-8(c)-7(u)2(s,)-327(o)11(r)8(ga)9(nize)6(,)-328(co)11(n)4(den)8(s)-7(e)5(,)-327(r)12(e)-4(d)11(uce)6(,)-327(b)-10(o)11(i)-4(l)-308(do)15(w)-2(n,)-328(c)5(h)4(o)-8(os)-8(e)5(,)-328(c)-3(a)18(t)6(eg)8(o)12(r)-5(ize)5(,)-327(c)-3(a)18(t)-5(a)-5(log)-32(, )]TJ 0 -11.955 Td [(c)5(l)-2(a)2(s)5(sif)-16(y)72(,)-238(li)2(s)5(t,)-238(a)7(bs)5(t)-4(rac)-7(t,)-238(s)-8(c)-3(a)8(n,)-238(lo)-9(o)6(k)-235(in)18(t)6(o)29(,)-238(ide)-6(a)-5(lize)5(,)-238(i)2(s)-7(o)6(l)-2(a)18(t)6(e)6(,)-238(di)2(s)-7(cr)-6(imin)2(a)19(t)6(e)6(,)-237(di)2(s)5(t)-4(in)7(gui)3(s)4(h,)-238(s)-8(cr)12(e)-4(en, )]TJ/F19 6.9738 Tf -14.905 -11.956 Td [(\242)]TJ/F19 9.9626 Tf 14.905 0 Td [(p)11(ig)8(e)-4(o)11(n)-4(h)3(o)7(le)6(,)-270(p)11(ic)6(k)-261(o)15(v)8(er)63(,)-270(s)-8(o)11(r)-9(t,)-271(in)18(t)6(eg)-4(ra)18(t)6(e)6(,)-269(b)6(len)4(d)6(,)-270(in)7(s)5(p)-8(e)-5(c)-7(t,)-271(\235)-5(l)11(t)6(er)63(,)-270(l)11(um)19(p)29(,)-270(s)3(k)-3(i)11(p)29(,)-269(sm)3(o)-8(o)10(t)-5(h,)-271(c)5(h)19(un)-4(k, )]TJ 0 -11.955 Td [(a)17(v)8(era)5(g)8(e)6(,)-279(a)18(p)11(p)12(r)13(o)16(xim)3(a)19(t)6(e)6(,)-279(c)5(l)12(u)3(s)5(t)6(er)63(,)-279(a)4(g)-5(g)-5(r)12(ega)19(t)6(e)6(,)-278(o)10(u)12(t)-5(lin)3(e)6(,)-279(s)4(umm)3(a)9(r)-5(ize)5(,)-279(i)11(t)6(emize)6(,)-279(r)12(e)-7(v)-3(ie)-8(w)72(,)-279(di)11(p)-268(in)18(t)6(o)29(, )]TJ 0 -11.955 Td [(\236i)11(p)-277(t)-6(hr)12(o)11(ug)-6(h,)-291(b)11(r)13(o)16(ws)-7(e)4(,)-290(g)-7(l)-3(a)8(n)4(ce)-277(in)18(t)6(o)29(,)-290(le)-6(a)8(f)-277(t)-6(hr)12(o)11(ug)-6(h,)-292(s)3(k)-3(im,)-291(r)12(e\235n)4(e)6(,)-290(en)18(um)4(era)19(t)6(e)6(,)-290(g)-7(le)-6(a)8(n,)-290(sy)-3(n)3(o)11(p- )]TJ 0 -11.955 Td [(size)5(,)-226(w)-3(inn)3(o)16(w)-226(t)-6(h)3(e)-226(w)-7(h)3(e)-5(a)18(t)-226(f)-10(r)12(o)12(m)-226(t)-6(h)3(e)-226(c)5(h)3(a)9(\232)-226(a)8(n)4(d)-226(s)-8(ep)-5(a)8(ra)19(t)6(e)-226(t)-6(h)3(e)-226(s)3(h)4(e)-4(ep)-227(f)-10(r)12(o)12(m)-226(t)-6(h)3(e)-226(g)7(o)-4(a)18(ts. )]TJ 170.162 -484.184 Td [(\325)]TJ ET endstream endobj
Looking in luatex.web, I found that the definition of \latelua contains a line »pdf_print_nl«. Removing this line seems to give the intended behaviour, though it might break something else. Best regards, olli --- luatex-beta-0.30.1/src/texk/web2c/luatexdir/luatex.web 2008-10-09 10:48:06.000000000 +0200 +++ luatex-beta-0.30.1-oh/src/texk/web2c/luatexdir/luatex.web 2008-10-10 15:34:17.000000000 +0200 @@ -16990,7 +16990,6 @@ pdf_out(str_pool[b]); incr(b); end; - pdf_print_nl; end; @* \[32d] The cross-reference table. -- http://www.sopos.org/olli/ GnuPG-Key: gpg --recv-keys 0x9A00D827 GnuPG-Fingerprint: F27A BA8C 1CFB B905 65A8 2544 0F07 B675 9A00 D827 NP: Sham 69 - Give a Dog a Bone Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
I forgot to mention my system details: TL2008 on Linux, $ luatex --version This is LuaTeX, Version snapshot-0.30.1-2008100910, build 1552 regards, olli -- http://www.sopos.org/olli/ GnuPG-Key: gpg --recv-keys 0x9A00D827 GnuPG-Fingerprint: F27A BA8C 1CFB B905 65A8 2544 0F07 B675 9A00 D827 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
Hi Oliver, Oliver Heins wrote:
Looking in luatex.web, I found that the definition of \latelua contains a line »pdf_print_nl«. Removing this line seems to give the intended behaviour, though it might break something else.
It is funny how sometimes a bug is dormant for months and is then
suddenly and independantly discovered by multiple people. Hans ran
into exactly the same bug yesterday evening, and the svn commit
that fixes it (made two hours ago) looks like this:
Author: taco
Date: 2008-10-14 11:07:57 +0200 (Tue, 14 Oct 2008)
New Revision: 1557
Modified:
trunk/src/texk/web2c/luatexdir/luatex.web
Log:
fix the handling of \latelua : make sure to close a possible open text
string in the pdf backend
Modified: trunk/src/texk/web2c/luatexdir/luatex.web
===================================================================
--- trunk/src/texk/web2c/luatexdir/luatex.web 2008-10-09 12:31:13 UTC
(rev 1556)
+++ trunk/src/texk/web2c/luatexdir/luatex.web 2008-10-14 09:07:57 UTC
(rev 1557)
@@ -16986,11 +16986,14 @@
begin
b := pool_ptr;
luacall(lua_id,s,r);
- while b
On Tue, 14 Oct 2008, Taco Hoekwater wrote:
Oliver Heins wrote:
Looking in luatex.web, I found that the definition of \latelua contains a line »pdf_print_nl«. Removing this line seems to give the intended behaviour, though it might break something else.
It is funny how sometimes a bug is dormant for months and is then suddenly and independantly discovered by multiple people. Hans ran into exactly the same bug yesterday evening, and the svn commit that fixes it (made two hours ago) looks like this:
that is interesting. In the very 1st version it even used modifiers like
\latelua direct {} (still without the Lua number) and there were proper
pdf_end_text and so on, like this from 10/2005:
procedure latelua(s: str_number; lua_mode: integer; warn: boolean);
var b, j: pool_pointer; {current character code position}
begin
j:=str_start[s];
case lua_mode of
set_origin: begin
pdf_end_text;
pdf_set_origin(cur_h, cur_v);
end;
direct_page:
pdf_end_text;
direct_always:
pdf_end_string_nl;
othercases confusion("latelua1")
endcases;
b := pool_ptr;
luacall(s);
while b
Hartmut Henkel wrote:
On Tue, 14 Oct 2008, Taco Hoekwater wrote:
Oliver Heins wrote:
Looking in luatex.web, I found that the definition of \latelua contains a line »pdf_print_nl«. Removing this line seems to give the intended behaviour, though it might break something else. It is funny how sometimes a bug is dormant for months and is then suddenly and independantly discovered by multiple people. Hans ran into exactly the same bug yesterday evening, and the svn commit that fixes it (made two hours ago) looks like this:
that is interesting. In the very 1st version it even used modifiers like \latelua direct {} (still without the Lua number) and there were proper pdf_end_text and so on, like this from 10/2005:
procedure latelua(s: str_number; lua_mode: integer; warn: boolean); var b, j: pool_pointer; {current character code position} begin j:=str_start[s]; case lua_mode of set_origin: begin pdf_end_text; pdf_set_origin(cur_h, cur_v); end; direct_page: pdf_end_text; direct_always: pdf_end_string_nl; othercases confusion("latelua1") endcases; b := pool_ptr; luacall(s); while b
From some time on somehow all these modifiers vanished and the Lua number went in (i can't even tell now if i threw them out). Currently it seems to behave as in "page" mode, as there is no pdf_set_origin(), which would be the default for \pdfliteral. It's not yet clear to me if \latelua does all the wanted, e. g. whether the timing is right if one wants to record positions within text on the page...
the latest version (not sure if checked in) behaves like write so that we can do more interesting things (delayed expansion) Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Hans Hagen wrote:
that is interesting. In the very 1st version it even used modifiers like \latelua direct {} (still without the Lua number) and there were proper pdf_end_text and so on, like this from 10/2005:
procedure latelua(s: str_number; lua_mode: integer; warn: boolean); .... end;
From some time on somehow all these modifiers vanished and the Lua number went in (i can't even tell now if i threw them out). Currently it seems to behave as in "page" mode, as there is no pdf_set_origin(), which would be the default for \pdfliteral. It's not yet clear to me if \latelua does all the wanted, e. g. whether the timing is right if one wants to record positions within text on the page...
They were dropped in commit #195, back in December 2006. They could come back ...
the latest version (not sure if checked in) behaves like write so that we can do more interesting things (delayed expansion)
The delayed expansion should stay, though. It makes the \latelua much more powerful. Best wishes, Taco
participants (4)
-
Hans Hagen
-
Hartmut Henkel
-
Oliver Heins
-
Taco Hoekwater