I'm writing a manuscript using bookdown and submitting only the PDF output. I would like the order of the sections to be body, references, tables, then figures. Right now I'm getting it the references at the end after the figures. The "body" in my case is made of 5 .Rmd files (one for each section of the MS, like intro, methods, etc.) and the figures and tables are generated in two separate .Rmd files.
Does anyone know how I can set the location of the bibliography to be somewhere other than the end of a document in bookdown? I can turn off the bibliography in the index.Rmd YAML header, and add \usepackage{natbib}
to the preamble.tex and \bibliography{cites.bib}
where I want it. But then that "breaks" some of the bookdown shortcuts (like using @name-year
instead of \cite{name-year}
for in-text citations). So I'd prefer a more "bookdown" based fix rather than a LaTeX fix.
Thank you!
My YAML header of index.Rmd looks like this:
---
site: bookdown::bookdown_site
documentclass: article
classoption: leqno
bibliography: [cites.bib]
biblio-style: apalike
link-citations: yes
fontsize: 12pt
---
My _output.yml file looks like this:
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: pdflatex
citation_package: natbib
keep_tex: yes
toc: false
My preamble.tex file looks like this:
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{lineno}
% turn off drawing the title
\makeatother
\let\oldmaketitle\maketitle
\AtBeginDocument{\let\maketitle\relax}
% don't remember what this does
\usepackage[section]{placeins}
% set up line spacing and paragraph spacing
\doublespacing
\setlength{\parskip}{0pt plus 0pt minus 0pt}
% set up captions
\usepackage[labelfont=bf,labelsep=period]{caption}
\captionsetup{width=\textwidth}