2

I wrote "a book" and now I want to print it. I though that I'll just use twoside option and everything will be allright but there is always some problem...

Problems:

1) When I use twoside option, the first page is "on the left side in the book". Should be "on the right side in the book", right? enter image description here Ok, so I added a blank page as the first page - now my "title page" is "on the right side in the book". It's a dirty solution, but it works. I'm using this "trick" further in the book. Is there any nicer solution?

2) The main problem I just can't find any solution to is with odd/even margins combined with start of pagenumbering. Let's see here: enter image description here

On top left page the content ends. On the top right page, there is something like "First chapter page". On bottom left there is a blank page. So far so good (odd/even margins are on "the right side" and switching with every page). But on the bottom right page, there is a problem.

I want there first numbered page. But when I use \pagenumbering{arabic} in the code, then the page with number 1 is always "on the left side in the book" - right margin is larger than the left and "alternating of margins" is broke in this case.

I read so many answers here on the forum (e.g. using \cleardoublepage) but nothing worked for me. Any advice? I accept even some "dirty tricks" just to make it work.

TL;DR; Basically I want to force odd/even margins no matter what - page numbering, title pages, chapters etc. Just to make sure, that margins are switching with every new page.

My code:

\documentclass[11pt,a4paper,twoside]{report}
\usepackage[top=2.5cm,bottom=2cm]{geometry}
\usepackage[cp1250]{inputenc}
\usepackage[czech]{babel}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{showframe}
\usepackage{lipsum}
\usepackage{url}
\usepackage{graphicx}
\usepackage{float}
\bibliographystyle{plain}

\newcommand{\blankpage}{
\thispagestyle{empty}
\newpage
\mbox{}
\newpage
}

\begin{document}
\pagenumbering{gobble}

\blankpage
% TITLE PAGE
\begin{center}
\centering
{\huge\bfseries Author\par}
\vspace*{8cm}
{\Huge\bfseries Name\dots\par}
\vspace*{13cm}
{\huge\bfseries Year\par}
\newpage
\end{center}

\begin{flushleft}
\vspace*{8cm}
\noindent
{\bfseries Thanks to all ..\par}
\vspace*{13cm}
\noindent
ISBN: 12345678913543
\newpage
\end{flushleft}

\section*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\lipsum[3]

\blankpage

% content
\tableofcontents

\chapter*{\centering \vspace*{8cm} \textbf{First part: lorem ipsum}}
\addcontentsline{toc}{chapter}{First part: lorem ipsum}
\newpage

\blankpage
\pagenumbering{arabic}% Remove page numbers (and reset to 1)

\section*{First Section of the book}
\addcontentsline{toc}{section}{First Section of the book}
\lipsum

.......
\end{document}
  • 1
    your assumption are wrong. first page is always odd page. different story is how you look document with previewer. – Zarko Feb 28 '18 at 18:19
  • page number 1 would be expected to have larger margin on the right (the outside edge), isn't that what you are getting? but in latex odd/even margins refer to the value of the page counter not to the number of pages output, so if you reset the page counter you need to make sure you do not change the parity. (easiest to always do \cleardoublepage before setting it back to 1). – David Carlisle Feb 28 '18 at 19:47
  • @DavidCarlisle I wonder why this isn't done by flipping a Bool on every page shipout, that would have been more stable and issues like this wouldn't even show up. – Skillmon Feb 28 '18 at 20:25
  • @Skillmon things like \includeonly would have been perhaps harder if the link between page side and parity of page count was broken, but really parity of page counter should be enough you never (in left to right languages) want an odd numbered page on the left – David Carlisle Feb 28 '18 at 20:32
  • @DavidCarlisle I wouldn't and typographically it would be nonsense, but looking at what I had to do to make my bachelor thesis look almost exactly like the Word template from the professor, I don't believe in a perfect world anymore. – Skillmon Feb 28 '18 at 22:17
2

The odd/even page is based on the page counter so if you reset the number to one you should first issue \cleardoublepage so that you are on an odd page, so changing the page number does not change the parity.

Here you see the boxed margin is consistently on the outer edge and the book title and part title are on a right hand page.

I started with a blank (even) page 0 to encourage the pdf reader I used here to put the odd numbered pages on the right. That probably needs to be removed if you print double sided as you want to print page 1 then page 2 on the back of that sheet, not page 1 on the back of page 0.

enter image description here

\documentclass[11pt,a4paper,twoside,openright]{report}
\usepackage[top=2.5cm,bottom=2cm]{geometry}
\usepackage[cp1250]{inputenc}
\usepackage[czech]{babel}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{showframe}
\usepackage{lipsum}
\usepackage{url}
\usepackage{graphicx}
\usepackage{float}
\bibliographystyle{plain}


\begin{document}
\pagestyle{empty}

\setcounter{page}{0}
 \mbox{} % 0 blank page just for onscreen preview

\clearpage

% TITLE PAGE
\begin{center}
%%%\centering
{\huge\bfseries Author\par}
\vspace*{8cm}
{\Huge\bfseries Name\dots\par}
\vspace*{13cm}
{\huge\bfseries Year\par}
\end{center}

\newpage

\begin{flushleft}
\vspace*{8cm}
\noindent
{\bfseries Thanks to all ..\par}
\vspace*{13cm}
\noindent
ISBN: 12345678913543
\newpage
\end{flushleft}

\section*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\lipsum[3]

\cleardoublepage

% content
\tableofcontents


\chapter*{\centering \vspace*{8cm} \textbf{First part: lorem ipsum}}
\addcontentsline{toc}{chapter}{First part: lorem ipsum}

\cleardoublepage
\pagenumbering{arabic}% Remove page numbers (and reset to 1)

\section*{First Section of the book}
\addcontentsline{toc}{section}{First Section of the book}
\lipsum

.......
\end{document}
1

So I solved the issue looking at it from a different perspective. What I wanted in the end was to "swap odd/even margins" - so the first page (number 1) has larger left margin (in the book on the right side).

That's because I want to print just "a body" of a book, without cover etc.

This behaviour could be achieved by changing hmarginratio in geometry package (default is 2:3 for two side - documentation ref):

 \usepackage[hmarginratio=3:2]{geometry}

This answer here on the forum was really helpful. Thank you for all the help!

  • that only addresses the size of the margins, not the fact that your example rests the page number in a way that makes the parity of the page counter not match the number of pages output, so you get two consecutive left hand pages as you commented in your question. – David Carlisle Mar 1 '18 at 19:43
  • 1
    I don't understand your " "a body" of a book". In a normal book odd pages are at the right and even pages at the left. The outer page margin is usually twice the inner page margin so that when a book is opened you see a left (even) page and a right (odd) page with the white space at the spine being the same as the white space at the outer edges of the two pages. – Peter Wilson Mar 1 '18 at 20:28

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.