# Page layout in XeTeX

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

\hoffset=\pdfpagewidth
\divide\hoffset by 2

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

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

\voffset=\pdfpageheight
\divide\voffset by 2



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.

\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

\pdfpagewidth=12 true cm

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

\hoffset=\pdfpagewidth

\divide\hoffset by 2

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

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

\voffset=\pdfpageheight
\divide\voffset by 2


\input macros