[Dev-luatex] Differences between PDF and DVI

Hartmut Henkel hartmut_henkel at gmx.de
Fri Dec 12 09:32:29 CET 2008


On Tue, 9 Dec 2008, Taco Hoekwater wrote:
> 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:
>
>   \pdfhorigin
>   \pdfvorigin
>   \pdfbottomoffset
>
> Ok, \pdfbottomoffset can probably be ignored because luatex at the
> moment doesn't do top-to-bottom scripts.  But what about those origin
> things?
>
>
> 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

regarding \pdfhorigin and \pdfvorigin, it just appeared (under the
shower :-) that these both should move _all_ stuff on the page
consistently and therefore _independently_ from the direction mode. They
are purely paper oriented parameters and only in use for PDF. So i guess
that these two can be factored out, and with 1in default PDF should look
like DVI. No idea about the others.

Regards, Hartmut


More information about the dev-luatex mailing list