[Dev-luatex] Differences between PDF and DVI

Taco Hoekwater taco at elvenkind.com
Tue Dec 9 10:26:43 CET 2008


Hartmut Henkel wrote:
> When you change \hoffset, the whole RL text moves in the DVI case, but
> not in the PDF case. 

In dvi mode there is a big difference between the actual dvi location
(dvi_h, moves r2l or l2r depending on text direction) and where tex
thinks the dvi location is (cur_h, always moves e2l). dvi output is
quite convoluted. In pdf mode, output is much more straightforward.

I think that it would be better to listen to \pagerightoffset in
both cases, but that is open for discussion.

> Also there seems to be some inconsistent magic if
> \pagerightoffset=0pt. 

In that case, it defaults to 1inch (pdf) or 2inch (dvi). Yes, that is
a mess (see below). I can easily make the pdf do what the dvi does, but
which behaviour is right?

> I have no idea how it should look like.

Me neither. And internally there are some more variables involved:


Ok, \pdfbottomoffset can probably be ignored because luatex at the
moment doesn't do top-to-bottom scripts.  But what about those origin

Initex defaults:

\pdfpagewidth 0pt
\pdfpageheight 0pt
\pdfbottomoffset 0pt
\pdfrightoffset 0pt
\hoffset 0pt
\voffset 0pt
\pdfhorigin 1in
\pdfvorigin 1in

Here is the current logic (in DVI):

cur_page_width    = (\pdfpagewidth > 0
                      ? \pdfpagewidth
                      : \wd255 +2*(\hoffset + 1in))
cur_right_offset  = (\pdfrightoffset != 0
                      ? \pdfrightoffset
                      : 2in )
cur_h             = \hoffset
<dvi_h_loc>       = (\pagedir TLT
                     ? cur_h
                     : cur_page_width-cur_right_offset - cur_h )

And in PDF, it looks like this:

cur_page_width    = (\pdfpagewidth > 0
                      ? \pdfpagewidth
                      : \wd255 +2*(\hoffset + \pdfhorigin))
cur_right_offset  = (\pdfrightoffset != 0
                      ? \pdfrightoffset
                      : 1in )
cur_h             = (\pagedir TLT
                      ? \hoffset + \pdfhorigin;
                      : cur_page_width-cur_right_offset )
<pdf_h_loc>       =  cur_h

Best wishes,

More information about the dev-luatex mailing list