{pdf-,Xe-}TeX でページ余白を変更する

{pdf-,Xe-}TeX でページ余白を変更する

TeX では、 と を変更する\hsizeと、\vsizeメインのテキスト サイズと dvi 出力のページ サイズが変更されます。pdftex または xetex を使用してドキュメントをコンパイルすると、ページ サイズは A4 のままになります。ページ余白を変更するにはどうすればよいですか?

最小限の例:

\hsize=5cm \vsize=4cm
\footline{\hfil The page ends here!\hfil\the\pageno}
This document leaves much white space when {\tt pdftex\/}ed or {\tt xetex\/}ed.

\bye

答え1

{Lua-、pdf-、Xe-}TeX のソリューション

\hsize=2in \vsize=3in
\pdfpagewidth=4in
\pdfpageheight=5in
\footline{\hfil The page ends here!\hfil\the\pageno}
This document is by far better! Notice that \TeX{} starts every page
one inch away from the upper and left margin.
This example doesn't compile with {\tt tex} anymore.

\bye

関連情報