[XeTeX] centering layout with geometry package

Ulrike Fischer news3 at nililand.de
Fri Nov 25 17:46:23 CET 2011


Am Fri, 25 Nov 2011 10:06:27 +0800 schrieb Daniel Greenhoe:

> Using the geometry package, is there any way to automatically (without
> using layouthoffset and layoutvoffset) to center a layout area on a
> physical page?

I don't see an explicit option, but it is not difficult to calculate
the offset automatically:

\documentclass{book}
\setlength{\parskip}{0mm}%
\setlength{\parindent}{0mm}%
\usepackage{geometry}
\makeatletter
\geometry{
  xetex,truedimen,paper=a4paper,
  twoside=false,
  ignoreall,
  layoutheight=200mm,layoutwidth=100mm,
  margin=10mm,
  nomarginpar,noheadfoot,
  showframe,showcrop,
  layouthoffset=\dimexpr0.5\paperwidth-0.5\Gm at layoutwidth,
  layoutvoffset=\dimexpr0.5\paperheight-0.5\Gm at layoutheight
  }
  \makeatother
\begin{document}%
abc
\end{document}

-- 
Ulrike Fischer 



More information about the XeTeX mailing list