Questions tagged [bookdown]

bookdown is an R package for authors to write books and long-form articles using R Markdown

The bookdown package is an R package for authors to write books and long-form articles using R Markdown. For more information, see https://bookdown.org.

1019 questions
10
votes
4 answers

Add a MS Word Comment via Rmarkdown

Is there a way to add a MS Word "Comment" via a R markdown file? I'm using a reference_docx, and familiar with adding custom styles...but haven't figured out how to get a comment to show up on the side like this: To clarify: I want to add a tag…
ldecicco
  • 883
  • 8
  • 16
10
votes
3 answers

how to add a (multipage) pdf to rmarkdown?

Consider this simple example library(dplyr) library(ggplot2) library(tidyr) mydata <- data_frame(group = c('a', 'a', 'a', 'b', 'b', 'b'), x = c(1,2,3,5,6,7), y = c(3,5,6,4,3,2)) mydata2 <- mydata %>%…
ℕʘʘḆḽḘ
  • 18,566
  • 34
  • 128
  • 235
10
votes
2 answers

Include TikZ code in bookdown figure environment

I'd like to add a TikZ figure to a bookdown document in order to include some fancy graphics. My primary output format is LaTeX which means that I could essentially just include the TikZ graphics verbatim in the Rmarkdown file and it would render…
ekstroem
  • 5,957
  • 3
  • 22
  • 48
9
votes
3 answers

Rmarkdown: cross-reference image included with markdown syntax

I would like to cross-reference an image which I include with the markdown ![caption with spaces](path/to/image.png) syntax. I would like to be able to cross-reference this image as \@ref(fig:caption-with-spaces). I am using…
Sighonide
  • 600
  • 4
  • 15
9
votes
2 answers

Horizontal rule in R Markdown / Bookdown causing errors

Suddenly, I run into an error when knitting to PDF in Markdown/Bookdown. Nothing about my system has changed. The error is being caused by a 'horzontal rule' i.e. --- or *** anywhere in markdown, despite line spaces either side. I include a…
stats4ever
  • 431
  • 1
  • 3
  • 5
9
votes
4 answers

Caption above figure in html Rmarkdown

Is it possible to move the caption above my figure when knitting to HTML in RMarkdown? It seems that it is possible in PDF, ie when knitting to PDF, but I can't figure out how to replicate this for HTML. I am using bookdown to number figures. When I…
Bjørn Kallerud
  • 979
  • 8
  • 23
9
votes
5 answers

Increase line/row spacing with kableExtra

Is there a way to increase the line spacing with kableExtra for a pdf output in r-markdown or bookdown? library(knitr) library(kableExtra) kable( head(iris, 5), caption = 'Iris Table', booktabs = TRUE) %>% kable_styling(latex_options =…
Pete
  • 600
  • 1
  • 6
  • 16
9
votes
1 answer

Adding figures and tables after bibliography in Rmarkdown

I want to add tables and figures after the bibliography in an R Markdown document. However, R Markdown documents will by default always add the bibliography to the end of the report. Is there an easy way to add content to the document after the…
SavedByJESUS
  • 3,262
  • 4
  • 32
  • 47
9
votes
3 answers

How to make a PDF using bookdown including SVG images

I have some R markdown that includes the following code: ```{r huff51, fig.show='hold', fig.cap='Design decisions connecting research purpose and outcomes [@huff_2009_designingresearchpublication p. 86].',…
Peter Smith
  • 143
  • 9
9
votes
1 answer

use csl-file for pdf-output in bookdown

I would like to use a .csl-file for formatting references with bookdown. Adding csl: some-style.csl to index.Rmd affects the output to gitbook, but not to pdf_book. I know that I can specify biblio-style, but this only accepts some standard styles…
Thomas K
  • 3,242
  • 15
  • 29
9
votes
2 answers

R Bookdown: Tabbed headings

How use tabbed heading in bookdown like as RMarkdown? in RMarkdown: # heading1 {.tabset} ## tab1 content1 ## tab2 content2 Same code in bookdown:
Andrew.T
  • 420
  • 2
  • 12
9
votes
1 answer

bookdown with specific latex template

I very much believe that Rmarkdown and bookdown are the future of content publishing, however some publishers use specific LaTeX templates, and in order to submit the manuscript they need it in that precise template. For example, see this Springer…
Adrian
  • 744
  • 7
  • 17
8
votes
1 answer

Table Cross-References in Bookdown with MS-Word Output?

How can I make table cross-references work in a bookdown document with all of the output formats pdf, docx, and html? Or maybe more specifically, how can I get table cross-references working for flextables? Below is a minimal working example. The…
lowndrul
  • 3,715
  • 7
  • 36
  • 54
8
votes
1 answer

restart endnote numbering after each GitBook-style web chapter in R Bookdown

I am preparing an historical book manuscript, written in R-Markdown with Bookdown, which will have 8 chapters, each with 100+ Chicago-style endnotes, using the GitBook-style web format. My goal is to restart endnote numbering after each chapter, to…
jackdougherty
  • 167
  • 2
  • 8
8
votes
2 answers

R bookdown - custom title page

How to customize title page using bookdown? I tried using the following code in the YAML header. includes: in_header: preamble.tex before_body: body.tex The body.tex file was something pretty simple, just for test: \begin{titlepage} Hello…
user1591727
  • 143
  • 1
  • 10
1 2
3
67 68