[tex-live] paper size special
David Carlisle
d.p.carlisle at gmail.com
Sat May 28 12:58:41 CEST 2016
The recent discussion of page sizes caused me to look again at the
papersize special and whether latex ought to be adding it in more places.
The special was originally implemented in dvips and the dvips manual says
it hopes that other drivers support it. It seems like that has happened
except that all other drivers support it in an incompatible way..
Consider this plain tex document
\ifx\pdfvariable\undefined\else
\let\pdfoutput\outputmode
\let\pdfpagewidth\pagewidth
\let\pdfpageheight\pageheight
\fi
\ifx\XeTeXversion\undefined\else
\chardef\pdfoutput=0
\fi
\ifnum\pdfoutput=0
\special{papersize=200bp,200bp}
\special{papersize=400bp,100bp}
\else
\pdfpagewidth=200bp \pdfpageheight=200bp
\pdfpagewidth=400bp \pdfpageheight=100bp
\fi
hello
\bye
dvips reports a page size of 200x200 (first special wins)
etex pagesize;dvips pagesize;ps2pdf pagesize.ps; pdfinfo pagesize.pdf| grep
'Page size'
Page size: 200 x 200 pts
However all these variants using dvipdfm(x) or xdvi drivers report a page
size of 400 x 100 (last special on first page wins)
etex pagesize;dvipdfm pagesize; pagesize.ps; pdfinfo pagesize.pdf| grep
'Page size'
etex pagesize;dvipdfmx pagesize; pagesize.ps; pdfinfo pagesize.pdf| grep
'Page size'
etex pagesize;xdvipdfmx pagesize; pagesize.ps; pdfinfo pagesize.pdf| grep
'Page size'
xetex pagesize; pdfinfo pagesize.pdf| grep 'Page size'
etex pagesize; xdvi pagesize&
That of course matches the use of \pdfpagewidth in pdftex where the
register is reset until used as the first page is shipped out, these also
report 400x100
pdftex pagesize; pdfinfo pagesize.pdf| grep 'Page size'
luatex pagesize; pdfinfo pagesize.pdf| grep 'Page size'
the only combination I could find other than dvips not to report 400x100
was dvisvgm but I didn't understand its size at all:
etex pagesize; dvisvgm pagesize
pre-processing DVI file (format 2)
processing page 1
page size: 217.359pt x 664.121pt (76.3929mm x 233.412mm)
???
in latex at least the specials can be inserted in reverse order using
\AtBeginDVI{\special{papersize=200bp,200bp}}
\AtBeginDVI{\\special{papersize=400bp,100bp}}
(the AtBeginDVI hook was added for more or less exactly that)
but all packages would have to agree to use the same hook, and
it would still mean that the tex code and resulting dvi file had
to target either dvips or xdvi/dvipdfm the same dvi couldn't be used for
both.
So... I was wondering if dvi drivers that support special{papersize= could
agree on how to treat multiple instances?
Changing (say) dvips would of course affect the behaviour of any document
that has this set twice (eg has hyperref and geometry both loaded) so it's
not necessarily a good idea, but I'm not sure the current situation is that
easy to maintain either....
Something to think about after TL2016 out....
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20160528/7dd93fc0/attachment.html>
More information about the tex-live
mailing list