3

This is partially a follow-up to this question since the answer mentioned tex as executing the "original Knuth TeX".

So far, I have seen that the following will work in TeX, but is ignored by pdftex.

\special{papersize=8.5in,11in}

On the other hand, the following will work in pdftex but causes an error in TeX.

\pdfpagewidth 8.5 in
\pdfpageheight 11 in

Is there a platform-independent way of specifying page dimensions in TeX, not LaTeX?

merlin2011
  • 3,343

1 Answers1

5

No. The \special there is not understood by tex at all it is just passed verbatim into the dvi file to whatever program process that file. That particular syntax is for the dvips driver, it would not necessarily be understood by other dvi to ps or dvi to pdf/svg/... programs and viewers.

You can of course hide the platform differences behind macros giving a common interface just as LaTeX does.

David Carlisle
  • 757,742
  • Your answer implies neither dvi nor tex have control over pages size? – merlin2011 Oct 04 '14 at 08:42
  • 1
    @merlin2011 yes both were designed assuming you are printing on physical paper so can't change the size of the medium, they just control the text block and where it is printed relative to top left corner, if there are margins or it overruns the page is just an implementation detail in the printer.... – David Carlisle Oct 04 '14 at 08:44