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
6
votes
0 answers

floating TOC in tufte book

I am trying to do something simple: render the tufte options for a book using the basic bookdown example package. I can make the tufte style book fine, but I want it to have the floating TOC and not the TOC at the top Following the Definitive Guide…
Chip Brock
  • 81
  • 2
6
votes
1 answer

Bookdown not building - replacement length zero

I'm getting the following error when trying to build this gitbook on my local machine (was trying to use it as a template for creating my own work): https://github.com/lgatto/IntroMachineLearningWithR Error: Error in x[i] <- sprintf("
dvanic
  • 545
  • 1
  • 4
  • 17
6
votes
1 answer

Can't use PLOS rticles template with bookdown

Following this post, I'm trying to put @YihuiXie 's answer in practice with the PLOS template of rticles but it doesn't work. Any help would be very appreciated! Below in a minimal example: --- title: Title of submission to PLOS journal author: -…
julou
  • 602
  • 4
  • 12
6
votes
1 answer

set width of embedded url

In R, the function include_url() from the knitr package allows to set the height, but not the width of an embedded iframe. knitr::include_url("https://www.youtube.com/embed/9bZkp7q19f0", height="315") The above will embedd the youtube with height…
Paulo
  • 397
  • 2
  • 11
6
votes
1 answer

Auto-Numbering of Figure and Table Captions for HTML Output in R Markdown

Is there a way to automatically number the figures in captions when I knit R Markdown document into an HTML format? What I would like is for my output to be the following: Figure 1: Here is my caption for this amazing graph. However, I am…
DuckDuckGoose
  • 63
  • 1
  • 4
6
votes
1 answer

Properly indent paragraphs within list items when using bookdown

How do I properly indent paragraphs within lists in bookdown? I would like to start a new paragraph after a blank line as show in the example below. This example works for RMarkdown when used outside of bookdown but breaks down when used with the…
user2633313
  • 119
  • 8
6
votes
2 answers

How to change to another bibliography style in Bookdown

I want to another bibliography style instead of apalike in Bookdown, and when I changed to nature which is number style, and built the book, it prompted me, ����: Failed to build the bibliography via bibtex Please delete bookdown.Rmd after you…
Minyi Han
  • 807
  • 1
  • 8
  • 15
6
votes
2 answers

Manual numbering in bookdown

Is it possible to control chapter/section numbering in bookdown? e.g. # Introduction {1} # Theory {14} # Methods {3} would give the following in the output... 1. Introduction 14. Theory 3. Methods
Paul
  • 328
  • 2
  • 11
6
votes
2 answers

Cross-referencing DT::datatable in bookdown

I am trying to create a reference to DT::datatable in a bookdown project. The bookdown manual states that (\#tab:label) should be placed at the beginning of the table caption. For testing, I created a new bookdown project in R-studio but replaced…
rbrisk
  • 306
  • 1
  • 7
6
votes
1 answer

R: Removing the "Chapter" part from the title in bookdown::pdf_book with documentclass: report

consider my header and first section --- title: "asdf" author: "asdf" date: "13 Januar 2018" documentclass: report output: bookdown::pdf_book: citation_package: biblatex latex_engine: pdflatex number_sections: yes fig_caption:…
Gregor
  • 160
  • 1
  • 6
6
votes
1 answer

RMarkdown: bookdown with plotly

I'm using the bookdown package with RMarkdown to generate web-based book similar to this, likewise with the option to download a pdf-version of the book. I've included plotly graphs in my "book" which work nicely in the html-version of the book.…
Ratnanil
  • 1,641
  • 17
  • 43
6
votes
1 answer

How do I put Bookdown chapters in a subdirectory?

I can't figure put how to make a book with Rmd files in a subdirectory. Here's my current directory structure: myProject.Rproj index.RMD _bookdown.yml chapters/ chapt1.RMD chapt2.RMD extraThatShouldNotBeIncluded.RMD What should go in…
sharoz
  • 6,157
  • 7
  • 31
  • 57
6
votes
1 answer

More flexible citation formats

I love to use citations in my r bookdown projects. The format is not very flexible, I can use @citeID to get "Author(Year)" or [@citeID] to get "(Author Year)". Sometimes I only need "(Year)" or "Year" or I may only need "Author Year" with no…
kadewe
  • 61
  • 2
6
votes
1 answer

print the data.table package's .onAttach messages with knitr

I have a bookdown rmd looking like... Further introductory materials are offered when the package is loaded: ```{r dt-startup, echo=-1, message=TRUE, verbose=TRUE, hide=FALSE} if ("data.table" %in% .packages())…
Frank
  • 66,179
  • 8
  • 96
  • 180
6
votes
3 answers

Cross-referencing in rticles

The bookdown offers great cross-referencing options for equations, figures, tables and sections: https://bookdown.org/yihui/bookdown/cross-references.html However, they seems to not work when I set as an output 'rticles::elsevier_article'. What are…
matandked
  • 1,527
  • 4
  • 26
  • 51