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!

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}
  • 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 1 '12 at 9:31
  • @lpdbw: geometry is a very mature, de-facto standard package. If you use fancyhdr, load it after geometry -- see tex.stackexchange.com/questions/33874/… – lockstep Aug 1 '12 at 9: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 1 '12 at 9: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 1 '12 at 9: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 1 '12 at 9:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.