[Tex/LaTex] How to change the layout of a page (plain TeX)

plain-tex

I need to change both horizontal and vertical dimensions of the output pages. Is there a simple way to do it in plain TeX?

Best Answer

You can use opmac.tex which defines \margins macro for setting page dimensions and margins comfortable. The following example sets all four margins to 1in, but the page format is changed.

\input opmac

\margins/1 a5 (1,1,1,1)in  % A5 portrait
% or: \margins/1 a5l (1,1,1,1)in  % A5 landscape
% or: \margins/1 a3 (1,1,1,1)in   % A3 portrait
% etc.
% or: \sdef{pgs:spec}{(200,200)mm}  
% \margins/1 spec (1,1,1,1)in     % special format 200x200 mm 

hello world.

\bye

See the opmac-u-en.pdf documentation if you need more features.

Note that if the DVI mode is active then page media dimensions isn't set by this macro \margins, because it is impossible (DVI doesn't store such information). I don't understand where your evince reads this information when it displays DVI. My evince isn't able display DVI so I can't try.

Related Question