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
7
votes
1 answer

Changing the font size of figure captions in RMarkdown pdf output

I would like to make the font size of all captions (figures and tables) in my R Markdown document smaller. I'm using bookdown. The final output is pdf and I'm working in R Studio. To load the picture, I use the include_graphics function from knitr,…
symbolrush
  • 7,123
  • 1
  • 39
  • 67
7
votes
1 answer

Stata syntax highlighting in Rmarkdown

I am using Bookdown and Rmarkdown to compose a technical book for Stata users. I would like to include Stata highlighting syntax in the chunks of code, but I am not interested in actually executing Stata from Rstudio. I just want the syntax…
7
votes
1 answer

How to justify whole text in Rmd with bookdown::gitbook as output

I would like to justify all the text in my gitbook, but I couldn't find a solution. So far I've tried: Set the text-align as justified in the style/body, right after the YAML Header: It doesn't…
Cainã Max Couto-Silva
  • 4,839
  • 1
  • 11
  • 35
7
votes
2 answers

Conditionally include chapters in Bookdown

Suppose i have a main R-Markdown file called index.Rmd and another R-Markdown file called child.Rmd. If i want to include the R-Markdown file child.Rmd based on the condition params$value1 > params$value2, i can add the following code to the file…
peer
  • 257
  • 2
  • 11
7
votes
1 answer

Rmarkdown with html, how to reference figures?

Using RMarkdown I always generate pdf documents via Rmd -> pandoc -> TeX -> pdflatex -> pdf and accomplish figure references using \\label{something} in the fig.cap as in the follow example: --- title: "Foo" author: "Mark Andrews" date: "10 January…
mjandrews
  • 2,392
  • 4
  • 22
  • 39
7
votes
1 answer

R Bookdown - Customize width of TOC/Sidebar

Although I can change the width and position of different elements in the body of an r bookdown doc by modifying the page wrapper in the .css, is there a way to change the width of the sidebar by modifying the styles sheet? I'm not looking to…
7
votes
1 answer

Sharing Bookdown book without publicizing

I'm working on a data analysis project in R, where I'm doing some logistic and multilevel modeling with sensitive, private data in R. I have fallen for the bookdown package in R, and I have created a fairly extensive book about our workflow and…
Ben Croft
  • 71
  • 1
7
votes
2 answers

Chunk option class.output is not working on Error Message

I am preparing a tutorial for a course and I want to change the colour of the error to be red. I am using BookDown and gitbook as my output format. But I found that the option class.output is not working. I want to add a class to the output for the…
TheRimalaya
  • 4,232
  • 2
  • 31
  • 37
7
votes
1 answer

How can I insert an image from internet to the pdf file produced by R bookdown in a smart way?

As far as I know, inserting an image from internet to LaTeX is not possible. You have to download the image first, and then include it locally. With R bookdown, I do it like…
pzhao
  • 335
  • 1
  • 10
7
votes
1 answer

Bookdown: Single html output file

If I add a line below the first in _output.yml: bookdown::gitbook: split_by: none css: ... in the bookdown-demo the output becomes a single .html file which looks kind of plain ugly. Is it somehow possible to retain the nice style which is…
mhwh
  • 478
  • 4
  • 12
7
votes
1 answer

How can I set twoside, symmetric layout for bookdown::tufte_book2()

I'm using the fantastic new bookdown package, right off of Yihui's boilerplate, using the bookdown::tufte_book2() output. The result is lovely, but I'd like the pages to be symmetrical, so that the margins are always on the outside of a two-sided…
maxheld
  • 3,963
  • 2
  • 32
  • 51
6
votes
1 answer

How to load MathJax extensions in Bookdown?

Update: I think the problem is related to these two bookdown-bug reports: Cannot load mathtools MathJax extension in bookdown and Custom MathJax URL not working. The problem is that the upgreek extension requires MathJax V3, but bookdown/Rstudio…
pglpm
  • 516
  • 4
  • 14
6
votes
0 answers

How to control rmarkdown word document images that are being rescaled by Word?

I'm trying to produce a word document from an rmarkdown file that includes graphs/plots sized to a height of 4 inches and a width of 6.5 inches (which should take up all the width of a normal letter sized page with regular 1-inch margins on each…
6
votes
1 answer

Show all used references when using compact numeric citation style

I'm rendering html from markdown using bookdown, and using a compact numeric citation style so that e.g., 1, 2, 3 is shown as 1-3. I'd like references to be shown at the bottom of each page (link-citations: yes), but only the first and last…
jbaums
  • 27,115
  • 5
  • 79
  • 119
6
votes
1 answer

Citations in DT:datatable

I am working on a bookdown project where we have large tables that also contain citations. We are outputting in both html and pdf. The problem is that I cannot find a way to make the citations render in the tables. For PDF output this latex…
Jan Stanstrup
  • 1,152
  • 11
  • 28