[tex-live] Fontspec overriding default paper size with LuaTeX

Bruno Voisin bvoisin at icloud.com
Fri May 27 12:33:43 CEST 2016


> Le 27 mai 2016 à 03:58, Norbert Preining <preining at logic.at> a écrit :
> 
> Hmmm, as far as I read Bruno's comments is that the paper size is
> different in pdflatex and lualatex?

LaTeX defines \paperheight and \paperwidth, which are then used to calculate the text height and width on each page, and the margins. As far as I remember this was introduced with LaTeX 2e in 1994. Before that, LaTeX 2.09 was hardcoded for US Letter paper, and it was up to the user (or to styles like a4wide.sty) to adjust the page design if need be for A4 paper.

This is something specific to LaTeX. The user specifies her/his preference with class options like [a4paper] or [letterpaper]. If unspecified, [letterpaper] is assumed.

Settings for the page of PDF output say (to simplify) are something which came later, in a totally independent way. At the time LaTeX 2e was introduced, everything connected with PostScript was still considered experimental, not widely available to most users and different for each DVI driver. Hence, even within LateX, the delegation of the PostScript-specific code to separate packages like graphics, color and pict2e.

The page size specification is done by the driver via \pdfpageheight and \pdfpagewidth for pdfTeX and XeTeX, \pageheight and \pagewidth for (new-style) LuaTeX, and \special{papersize=width,height} for dvips. All this is totally independent from LaTeX, which knows nothing about the actual page size the output will be delivered onto. And conversely the driver knows nothing about the paper size used by LaTeX to format the page content.

That is, until graphics.sty or graphicx.sty come into play. I hadn't realized it until David explained it yesterday, but the graphics package uses the LaTeX paper size to modify the driver output page size to match it. This is done, again based on David's messages, in the driver files for the graphics package:

dvips:  /usr/local/texlive/2015/texmf-dist/tex/latex/graphics/dvips.def
pdftex: /usr/local/texlive/2015/texmf-dist/tex/latex/pdftex-def/pdftex.def
xetex:  /usr/local/texlive/2015/texmf-dist/tex/xelatex/xetex-def/xetex.def
luatex: /usr/local/texlive/2015/texmf-dist/tex/lualatex/luatex-def/luatex.def

Except that pdftex.def and luatex.def actually do this, but not dvips.def and xetex.def. This is clearly an inconsistency. David wrote yesterday he thinks this a bug, and might plan to fix it.

(By the way, regarding xetex.def, I don't remember exactly its relation to dvipdfmx.def. Any change to one should probably be propagated to the other. Development for both now takes place at <http://puszcza.gnu.org.ua/projects/latexfmxdef>.)

Hopefully, I imagine that when LaTeX 3 is released (whenever that will be) such inconsistencies will be erased by moving the functionality of such established packages as graphics to the LaTeX core.

Bruno

(*) Regarding XeTeX, I don't remember which 




More information about the tex-live mailing list