2

In the minimal example pasted below I would like to have:

  • left margin on even pages = 1.5cm
  • right margin on odd pages = 1.5cm

(understood as absolute values, not added to/substracted from default settings)

How do I have to set \oddsidemargin, \evensidemargin and/or \hoffset?


\documentclass[11pt, a4paper]{book}
\usepackage{lipsum}
\voffset=-1.5cm
\setlength{\textwidth}{16.5cm}
\setlength{\textheight}{45\baselineskip}
\setlength{\headheight}{\baselineskip}
\setlength{\textwidth}{16.5cm}
% hoffset, oddsidemargins, evensidemargins = ???
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}

\begin{document}
  \lipsum
\end{document}

EDIT: fancyhdr added!

lpdbw
  • 8,330

1 Answers1

3

Why not use the geometry package?

\documentclass[11pt,a4paper]{book}
\usepackage[
  textwidth=16.5cm,
  outer=1.5cm,
  textheight=45\baselineskip,
  headheight=\baselineskip,
  includehead=false,% Default
  heightrounded,
]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}
\usepackage{lipsum}
\begin{document}
\chapter{foo}
\section{foobar}
\lipsum[1-12]
\end{document}
lockstep
  • 250,273
  • Question: Are there any implications of this package for the rest of the document? Does the geometry package interfere with other packages, e.g. fancyhdr? see edited original post! – lpdbw Aug 01 '12 at 09:31
  • @lpdbw: geometry is a very mature, de-facto standard package. If you use fancyhdr, load it after geometry -- see http://tex.stackexchange.com/questions/33874/geometry-fancyhdr-fancyfootc-thepage-is-not-really-centered – lockstep Aug 01 '12 at 09:35
  • If I add the header from my original post (note: it was edited!) to your code (after geometry) I get an error. – lpdbw Aug 01 '12 at 09:37
  • @lpdbw You forgot to load fancyhdr, plus there's a (unknown to me) \truncate macro. I edited my MWE (which works for me). – lockstep Aug 01 '12 at 09:40
  • Yes, you're right. Sorry, was my fault! What does includehead=false mean? Does the top margin become slightly bigger if I change it to includehead=true? I tried it but the difference (if any) seems to be minimal ... – lpdbw Aug 01 '12 at 09:45
  • @lpdbw includehead=false means that the header is not included when calculating the textheight. As you specify textheight absolute (as a multiple of \baselineskip), the remaining difference is about vertically aligning the text block on the page. – lockstep Aug 01 '12 at 09:50