Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove blank pages from rbookdown pdfs?

I am using the default Bookdown example "A Minimal Book Example" which is available on GitHub: https://github.com/rstudio/bookdown-demo

How do I edit the template so that the PDF output does not have blank pages before all the chapters?

I don't speak TeX so basic clues for the clueless would be greatly appreciated.

like image 772
itsMeInMiami Avatar asked Oct 24 '17 15:10

itsMeInMiami


People also ask

How do you delete blank pages in a PDF file?

Open the PDF in Acrobat. Choose the Organize Pages tool from the right pane. The Organize Pages toolset is displayed in the secondary toolbar, and the page thumbnails are displayed in the Document area. Select a page thumbnail you want to delete and click the Delete icon to delete the page.

How do you delete a blank page after chapters in latex?

The default setting for many books (and many thesis templates) is two-sided, with each chapter opening on a right-hand-side page. To get rid of these empty pages, just add the oneside option (or alternatively, the openany option) to your document class declaration.

How do I get rid of the first blank page in latex?

Remove the page number from the first page Go to Insert > Header & Footer. SelectOptions on the right side, and then select Different First Page. Select Options again, and then select Remove Page Numbers.


1 Answers

This is not a problem with rbookdown itself, but it is because of a classoption in the documentclass "book" in LaTex. I found the hint here.

At the top of you index.Rmd file, you have documentclass: book in your YAML header. Right below it, add classoption: openany to fix this. For example:

--- 
title: "Fancy Title"
author: "Your Name"
date: "`r Sys.Date()`"
documentclass: book
classoption: openany
---
like image 131
kneijenhuijs Avatar answered Oct 31 '22 16:10

kneijenhuijs