mikeck
mikeck

Reputation: 3776

Adding natbib options for PDF output

Is there a way to specify natibib options when outputting a PDF with bookdown? I want the tex output to have the command

\usepackage[sort&compress]{natbib}

But there doesn't seem to be any way to specify it in the YAML. I can't add the command to my preamble, because the template already adds \usepackage{natbib}. What's the correct way to pass package options to natbib?

Upvotes: 3

Views: 881

Answers (1)

mikeck
mikeck

Reputation: 3776

As of this commit, the default LaTeX template supports natbib options in the YAML via the variable natbiboptions. I presume this will propagate to rmarkdown when pandoc gets it's next official update. Until then, you can set bookdown to use the new template and pass the geometry: "margins=1in" to get the default bookdown pdf style with custom natbib options.

Upvotes: 2

Related Questions