0

I want my document to have first four pages such as:

\usepackage[left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}

as well as page number on the right side of the footer. From fifth page I'd like it to be like book, so for even numbers we have the same settings as above, but for odd ones it's:

\usepackage[left=2cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}

and page number on the left side of the footer.

Is there a neat way of getting such result? Header & Footer basic informations are helpful, such as command \fancyfoot[LO,RE]{\thepage}, but I don't know how to connect it with permutation of the margins. I also can't have anything more - \pagestyle{fancy} adds extra line to the header.

  • 3
    Welcome to TeX SX! Are you meaning the first 4 pages of your document should be one-sided? – Bernard Dec 17 '16 at 2:10
  • Hello, this is exactly the case. – Maverick Dec 17 '16 at 11:38
  • I don't see any geometry options for this (possibly scrbook layers). You could put the first four pages in a \begingroup ... \endgroup and set \evensidemargin=\oddsidemargin and \@twosidefalse inside the group. (@ requires either \makeatletter ... \makeatother or \csname ...\endcsname) – John Kormylo Dec 17 '16 at 16:31
0

After all I just used fancyhr package together with bindingoffset property of geometry. Then I defined additional pagestyle to be used for one-sided pages. Simple solution for simple problem. The preamble looks follows:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=2cm,bindingoffset=1cm]{geometry}
\usepackage{fancyhdr}

\pagestyle{fancy} 
\renewcommand{\headrulewidth}{0pt} %. Delete default header line
\fancyhf{} %......................... Discard old settings for footer
\fancyfoot[LE, RO]{\thepage} %....... Set mirrored pages in footer

% Define additional style for 2nd and 4th page
\fancypagestyle{right}{%
\fancyhf{} 
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[RE, RO]{\thepage}
% Redefine geometry for particular pages
\newgeometry{left=2cm,right=3cm,top=2.5cm,bottom=2.5cm}}

Should someone need to test how it works, here is an MWE:

\begin{document}

{\huge Right hand-side page 1}

\pagebreak
\thispagestyle{right}

{\huge Right hand-side page 2}

\pagebreak
{\huge Right hand-side page 3}

\pagebreak
\thispagestyle{right}

{\huge Right hand-side page 4}

\pagebreak
{\huge Page 5 - mirrored, here will be right-hand side}

\pagebreak
{\huge Page 6 - mirrored, here will be left-hand side}

\end{document}

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.