1

What are the default page size and the default margins when creating a pdf with bookdown? For example, using the basic configuration provided in the index.Rmd file of the bookdown demo, we have:

--- 
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook.
---

I ask you this to check whether they are compatible with the page size/margins required to publish with Createspace by Amazon:

https://www.createspace.com/Special/Enterprise/Publisher/submission_guidelines.jsp

Thanks

Carlos Luis Rivera
  • 3,108
  • 18
  • 45

2 Answers2

3

The official configuration reported by Gitbook.com, says that the default paper size is a4, while for margins the default values are the following ones:


pdf.margin.top  Top margin (default is 56)
pdf.margin.bottom   Bottom margin (default is 56)
pdf.margin.right    Right margin (default is 62)
pdf.margin.left Left margin (default is 62)

By chance, I found that 72 pts equal 1 inch in Gitbook. Do these specifications carry over to Bookdown? Who knows? I agree with you that the documentation for this issue is incomplete. Let's hope they will improve it in the future.

gung - Reinstate Monica
  • 11,583
  • 7
  • 60
  • 79
  • New versions of gitbook [don't support](https://docs.gitbook.com/v2-changes/important-differences#pdf-and-other-ebook-formats-exports) latex/pdf anymore. Then, the docs would [even like](https://bookdown.org/yihui/bookdown/latexpdf.html) to pretend you just need to specify the parameter like normal in the header and call it a day.. Yet, the only thing I found that could finally move away from the default *letter*, was adding `pandoc_args: "--variable=papersize:a4"` to bookdown::pdf_book in _output.yml – mirh Sep 04 '19 at 01:56
2

To avoid reliance on defaults, it's possible to specify a specific margin size using the geometry: option in the yaml block:

--- 
title: "A Minimal Margin Example"
author: "Jane Doe"
geometry: margin=5cm
output: pdf_document
---

See: Set margin size when converting from Markdown to PDF with pandoc

Martin Smith
  • 3,687
  • 1
  • 24
  • 51