1

I want to create a presentation using XeTeX but I am having trouble with the page layout. The expected result show be a pdf with a 4:3 aspect ratio, centered content and margin of 1/8th of the total width/height (just eyeballed that).

Here is the code I tried to write:

\pdfpagewidth=12 true cm

\hsize=\pdfpagewidth
\multiply\hsize by 7
\divide\hsize by 8

\advance\hoffset by -1 true in
\hoffset=\pdfpagewidth
\advance\hoffset by -\hsize
\divide\hoffset by 2

\pdfpageheight=\pdfpagewidth
\multiply\pdfpageheight by 3
\divide\pdfpageheight by 4

\vsize=\pdfpageheight
\multiply\vsize by 7
\divide\vsize by 8

\advance\voffset by -1 true in
\voffset=\pdfpageheight
\advance\voffset by -\vsize
\divide\voffset by 2

\headline={}

It is very verbose, but I am not aware of a simpler way to do that.

\input macros

\noindent TL\hfil TR

\vfill

\noindent BL\hfil BR

\bye

but the output is not centered in the page.

1 Answer 1

1
\advance\hoffset by -1 true in 
\hoffset=\pdfpagewidth

is the same as

\hoffset=\pdfpagewidth

you just over-write the first setting.

Also you did not account for \parfillskip to stretch your text full width

enter image description here

\pdfpagewidth=12 true cm

\hsize=\pdfpagewidth
\multiply\hsize by 7
\divide\hsize by 8

\hoffset=\pdfpagewidth

\advance\hoffset by -\hsize
\divide\hoffset by 2
\advance\hoffset by -1 true in

\pdfpageheight=\pdfpagewidth
\multiply\pdfpageheight by 3
\divide\pdfpageheight by 4

\vsize=\pdfpageheight
\multiply\vsize by 7
\divide\vsize by 8


\voffset=\pdfpageheight
\advance\voffset by -\vsize
\divide\voffset by 2
\advance\voffset by -1 true in

\headline={}

\input macros

\noindent TL\hfill TR

\vskip 0pt plus 1filll

\noindent BL\hfill BR

\bye

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy