I need to change both horizontal and vertical dimensions of the output pages. Is there a simple way to do it in plain TeX?
[Tex/LaTex] How to change the layout of a page (plain TeX)
plain-tex
Related Solutions
The 1 inch offsets come actually from TeX itself, and are kind of a pain because you need to take them into account as late as possible in any calculations.
The paper size is defined in a configuration file (I forget its name), but with PDFTeX, you should be able to use commands \pdfpagewidth
(default 210 true mm
for A4), and \pdfpageheight
(default 297 true mm
for A4).
Most relevant settings regarding page layout are:
\hsize
for h orizontal size (typeblock width)\vsize
for v ertical size (typeblock height)\hoffset
for h orizontal offset (offset from 1 inch from left edge of paper)\voffset
for v ertical offset (offset from 1 inch from top edge of paper)
For spread layout, you can just toggle the \hoffset
in the output routine.
Because you define the \hsize
and \hoffset
, there's no need to define margins, but I guess you could write a macro for counting \hsize
and \hoffset
based on given margins.
I am not sure, but IMHO the way dvips -z
which converts hypertext-html specials to pdfmark does not work because it is unsupported now. The hyperref package for LaTeX does not use the hypertext-html specials when the way LaTeX -> dvi -> dvips -> ps2pdf is used. It uses its own complicated solution with much more and large specials: they generate the pdfmark language directly.
My supposition is based on the fact that nobody uses hypertex-html specials when the way dvi -> PS -> PDF is used, so they are unsupported. Of course, they are documented at a very old www page and they are working in xdvi previewer.
I recommend not to use tex -> dvi -> dvips -> PS -> ps2pdf way because today we have much more simple methods to generate PDF.
Edit I have found the core of the bug. If the link starts in vertical mode and ends in the first line of paragraph in horizontal mode (like in your example), then the sensitive rectangular array of the link disappears. Try to use Hey, \LinkHrefText{label}{please click here}
instead of only \LinkHrefText{label}{please click here}
. Or prefix your link by \leavevmode
.
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.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.