pdfliteral after text/rules
Hi, here ist the problem, that the "page" mode of \pdfliteral and \latelua does not by itself guarantee, that the result goes relative to the lower left corner (the PDF origin): \nopagenumbers \pdfcompresslevel=0 X\latelua{ x={};y={}; c=72/72.27/65536; x[1]=pdf.geth()*c; y[1]=pdf.getv()*c } \input tufte X\latelua page{ x[2]=pdf.geth()*c; y[2]=pdf.getv()*c } \hrule \latelua page{ tex.print(x[1], " ", y[1], " m ", x[2], " ", y[2], " l S") } \input tufte \bye The above example works as intended only, if you remove the \hrule. Reason is, that for setting a rule, a transform "cm" is done away from the origin, then the rule is placed, but there is no transforms back to the origin. The next placements are done after a transform relative to the placement point of the rule... Text is always typeset with the transform matrix "cm" set to the origin, and inside the BT...ET group the Td operator does the local transform. There seems to be currently no \pdfliteral (or \latelua) mode that guarantees positioning relative to the PDF origin. But positioning relative to the origin would be nice to have since we now have the pdf.geth/v() lua functions. Else one would have to think what was the state (text or rule?) just before using \pdfliteral page... To solve this ambiguity, i have tried the attached patch, which puts any rule into a qQ group and does "cm" transforms inside this group. So the rules are handled like text, which is also grouped (inside BT...ET). That means, that the global working reference point is (hopefully :) always (?) at the origin. With the rule.ch patch the above example works apparently ok. This also means, that when using \pdfliteral page, one gets stuff placed at the origin, and still without transform (which should be ok). This would spare to invent yet another \pdfliteral mode. No idea how general it is. And wonder, how backward-compatible? We would need to check also \pdfrefximage... Just for discussion... Regards, Hartmut P.S. Let's see how the attachment is handled. Never tried this before.
Shall I just apply this patch to the CVS version? Taco Hartmut Henkel wrote:
To solve this ambiguity, i have tried the attached patch, which puts any rule into a qQ group and does "cm" transforms inside this group. So the rules are handled like text, which is also grouped (inside BT...ET).
Taco Hoekwater wrote:
Shall I just apply this patch to the CVS version?
sure 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 -----------------------------------------------------------------
On Wed, 21 Sep 2005, Hans Hagen wrote:
Taco Hoekwater wrote:
Shall I just apply this patch to the CVS version?
sure
yes, talked about it already with Thanh. Should be ok. But i was reluctant, as there should be an inofficial pdftex version first which Hans can power-crash-test on his complicated graphics and transforms. I had forgotten that -- Hey! -- that inofficial version is pdfluatex :-) Please take the attached patch, just one code line is simplified. And thanks a lot, Taco! Regards, Hartmut
Hartmut Henkel wrote:
Shall I just apply this patch to the CVS version?
sure
yes, talked about it already with Thanh. Should be ok. But i was reluctant, as there should be an inofficial pdftex version first which Hans can power-crash-test on his complicated graphics and transforms. I had forgotten that -- Hey! -- that inofficial version is pdfluatex :-)
Applied and committed. I've also changed the banner a bit, it now says: This is pdfLuaTeXk, Version 3.141592-0.1.0-2.2 (Web2C 7.5.5) it is not much yet, but it helps me keep my executables apart. That reminds me, do we want/need a pdfluatex' that is not e-TeX, as it is currently with the 'pdftex/pdfetex' twins, or is one executable enough? (My vote goes to a single exe). Taco
Taco Hoekwater wrote:
it is not much yet, but it helps me keep my executables apart. That reminds me, do we want/need a pdfluatex' that is not e-TeX, as it is currently with the 'pdftex/pdfetex' twins, or is one executable enough? (My vote goes to a single exe).
good! i assume that the pool file is also named as such 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 -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Hartmut Henkel
-
Taco Hoekwater