## LaTeX forum ⇒ Page Layout ⇒ Blank Pages before and after chapters

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
cyanidebaby
Posts: 11
Joined: Tue Feb 07, 2017 1:56 pm

### Blank Pages before and after chapters

Hello,

(Apologies for pasting this huge chunk of code, but since I can't pin point where the problem lies, I thought it best to show you the whole thing)

This code (which is very much a work-in-progress) seems to generate empty pages before and after my chapters.

Case in point, from the top, we have a "Preamble", followed by an "Introduction", followed by a blank page and the first chapter. The first chapter should appear where the first blank page pops up though.
The same situation occurs later, between the end of Chapter 1 and the beginning of Chapter 2: indeed, here again, there's a blank page where Chapter 2 should be. And a final blank-page appears after Chapter 2.

I also noticed that "List of Tables" keeps appearing in the headers above the "Preamble", "Introduction" and first blank-page pages. I mention this here as I have a feeling that it's all related to the same issue: my code seems to not obeying my \clearpage commands to start afresh.

Could the issues I describe above be helped by segmenting my document and start using the \include command to call-in individual latex files, for each chapter, etc.?

Any help (and explanation) would be much welcome.

- Alex


Tags:

Stefan Kottwitz
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm
Hi Alex,

welcome to the forum!

Segmenting the document and using \include for chapters can make working easier. But it is not necessary to fix the issue here.

Here, after the introduction section, you have multiple page breaks - remove them or comment them out (\newpage, \clearpage)

\newpage\phantomsection\addcontentsline{toc}{section}{Introduction}\section*{Introduction}\blindtext\newpage \clearpage\endgroup\clearpage

Chapters start at right hand pages by default. So they start at odd numbered pages (1, 3, 5, 7, ..). If the text before ends at page 5, the next chapter starts at page 7. You can add the openany option to the document class if you would like to suppress this, or just for testing now: \documentclass[openany]{book}

The \mainmatter command has an implicit \cleardoublepage. So it contains a page break and possibly inserts an empty page so the next page starts on a right hand side. Comment out \mainmatter as additional test. Then, together with openany, there should not be an empty page before the first chapter.

Stefan

cyanidebaby
Posts: 11
Joined: Tue Feb 07, 2017 1:56 pm
Hi Stefan.

\documentclass[openany]{book} does the trick ... in part (I totally forgot about the odd/even way pages are handled in the book class. Thank you for that.).

Indeed, as often is the case with LaTex (at least, in my very limited experience), one solution to a problem leads to additional or unintended problems.
Case in point, the [openany] solution: the blank page that used to appear after Chapter 2 is now gone, which is great. But the blank page between "Introduction" and "Chapter 1" is still there.

So I commented out \mainmatter, which gets rid of the blank page before "Chapter 1" (yay!), but the numerals for the whole document are now Roman Numerals ( ), and the line which I've positioned between the text body and the margin now starts on the page that follows the first Chapter 1 page. Oops.

Goes without saying that I put \mainmatter the way it was.

Then I got rid of the many unneeded \newpage page breaks.
Removing too many of them sticks the "Preamble" and "Introduction" to the "List of Tables" though, so I had to keep some.

So, the result, as of right now is: the blank page after Chapter 2 is gone, but the blank page before Chapter 1 is still there.


Stefan Kottwitz
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm
Instead of \mainmatter you could use

\makeatletter\@mainmattertrue\pagenumbering{arabic}}\makeatother

Basically it's switching to arabic numbers and starting with 1, but I added setting the internal variable for being in the main matter too.

Stefan

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
The blank page is needed and correct there. What Stefan posted may seem to work, but set the outer margin to a value of 8 cm (which is extreme). Also add the showframe option for package geometry. An odd page is always a right hand page.

The command \pagenumbering needs to have a \cleardoublepage in front, and in my opinion that should be defined within that command so a user doesn't have to care.

Say, do you want to print your document as a book (left and right are printed on) or mor like a school report or thesis? In that case, maybe try oneside.

EDIT: Upon a closer look, the template isn't very good. :-/
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

cyanidebaby
Posts: 11
Joined: Tue Feb 07, 2017 1:56 pm
Thank you both for your replies.

Stefan:
I've been getting interesting results with twocolumn instead of with multicol, so I'm going to go ahead and explore that a little. If it still doesn't work, I'll move one and find another solution.

Johannes:
For print?
At this point, it looks like the book is never going to be printed. Still, I would like to keep that option opened.

The blank pages?
They are indeed part of the book documentclass, but I'd like to get rid of them, as the book will be mostly read/used as a PDF ... and blank pages in PDFs are not great.

Well, I actually agree ... in part. Indeed, as you've realized, the book is not a novel. It's a sort of encyclopedic guide, part history, part geography and part culture. It's long, with lots of text (close to 400 single spaced pages), side notes on almost every page, few illustrations but quite a few tables and charts (some small, some full page), and a long, very detailed index (and probably an appendix too).
Because the book is so full of at times tough to digest information, I thought that the text would benefit from being presented in a template with a wide margin (for the many side notes; not a fan of footnotes), and a two column body to help reader with the text (some pages will be formatted as a single column though, on a case to case basis).

This WIP template you've looked at is based on a book that was published a little while back (see attached image).
Yes, it's not the latest in great book design, but it's one that contains the sort of info the book I'm working on contains.
If you have a ready-made template in mind for that sort of book, please, let me know. I'd love to take a look at it, which would save me time!

Anyway, I appreciate your useful straight forward comment.
Attachments
Capture.PNG (158.17 KiB) Viewed 13654 times

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Imagine: if this is a pdf which will be read as a pdf, one page, another page, anothe page, another page. Do you need the margin notes to flip sides?

If this is going to be printed, you have to care about the margin note beeing on this or that side. But only if it is printed, which is (i am assunimg) in the future.

You cannot compare a printed document with an ebook
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

cyanidebaby
Posts: 11
Joined: Tue Feb 07, 2017 1:56 pm
All very good points. Yes.

Back to my cauldron then.

### Who is online

Users browsing this forum: No registered users and 1 guest