Questions tagged [bookdown]
bookdown is an R package for authors to write books and long-form articles using R Markdown
86
questions
9
votes
2answers
995 views
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, ...
10
votes
2answers
3k views
How to stop bookdown tables from floating to bottom of the page in pdf?
I am using bookdown to create pdf reports, but my tables are all floating down to the bottom of the page, regardless of how much space there is. See this example:
---
title: "test_doc"
author: "Jake ...
6
votes
1answer
910 views
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-...
0
votes
1answer
189 views
Table in Bookdown/Huskydown with several features (Citation, Caption, URL, PNG Figure, …)
I would like to include a table in an R markdown document (Bookdown/Huskydown) which should meet the following requirements. Ideally, the table works with several output formats, e.g. LaTex/PDF and ...
4
votes
1answer
548 views
creating accompanying slides for bookdown project
In Rstudio, I create a new project and select book project using bookdown. The built in example runs perfectly as expected and i can compile 4 books - gitbook, html, epub, and pdf. Great.
The next ...
46
votes
3answers
3k views
Code folding in bookdown
The Code folding option in RMarkdown for html documents is awesome. That option makes the programmatic methodology transparent for those who are interested, without forcing the audience to scroll ...
19
votes
3answers
3k views
How to change the figure caption format in bookdown
When using bookdown (single document), figures are numbered automatically as:
Figure 1 Text of figure caption.
In chemistry, the convention is to label main Figures as:
Figure 1. Text of figure ...
6
votes
1answer
1k views
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 ...
6
votes
2answers
3k views
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 ...
7
votes
3answers
427 views
Error: Input files not all in same directory, please supply explicit wd
After trying to build a PDF that worked ~2 weeks ago, no fuss, on a new machine with a fresh install of R, R studio, bookdown, etc, I have this error:
Error: Input files not all in same directory, ...
3
votes
1answer
39 views
Broken bookdown heading link with duplicate names
I am preparing some documentation in bookdown (gitbook) with a heading structure like the following:
1. Subject A
1.1. Properties
2. Subject B
2.1. Properties
When I click on the 2.1 link I ...
89
votes
1answer
14k views
Relationship between R Markdown, Knitr, Pandoc, and Bookdown
What is the relationship between the functionality of R Markdown, Knitr, Pandoc, and Bookdown?
Specifically what is the 'division of labour' between these packages in converting markup documents with ...
22
votes
2answers
2k views
Is there a way to add chapter bibliographies using bookdown?
I am trying to write my PhD Thesis with bookdown and am mainly using pdf output. I have easily added a bibliography at the end of the document but would rather have a bibliography at the end of each ...
15
votes
1answer
1k views
Cross-referencing in a single-file bookdown document
One of the promises of the bookdown package is functions for automatic numbering of figure/table captions, and cross-referencing figures/tables/sections.
This is claimed to be enabled for single-Rmd ...
16
votes
3answers
2k views
Referencing a 'hand-made' table using bookdown package
I'm trying to reference a table using the bookdown package. In the documentation for tables, the author only shows how to create tables using knitr::kable.
```{r table1}
knitr::kable(
head(iris, ...
6
votes
2answers
1k views
Create index of definitions / theorems at end of bookdown book
For reader convenience, I'd like to include, at the end of my bookdown book, written in markdown, a simple list or index of definitions from the body of the book. i.e. ones created using custom blocks,...
3
votes
1answer
561 views
How to fold verbatim text (not code) in R bookdown?
In my document, I want to show some info, using ``` block, such as:
```
bruin@c7 ~ $ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
bruin@c7 ~ $
```
For large output chunks, I want to ...
9
votes
1answer
1k views
Rmarkdown/Bookdown: Separate figure numbering for Supplemental Section
Certain kinds of documents, such as journal articles, often have a Supplemental Section, where the numbering of figures is different from the main body.
For example, in the main body, you might have ...
6
votes
3answers
12k views
How to format kable table when knit from .rmd to Word (with bookdown)
I have read the bookdown book and still cannot figure this out. I am trying to create a Word report through bookdown. I want to use kableExtra to add striping to my tables and also to bold my last ...
6
votes
3answers
3k views
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 = ...
6
votes
1answer
284 views
bookdown: customize the output filename
This is a follow up to an earlier question I asked here: creating accompanying slides for bookdown project
Bookdown allows compiling the file to various format, including multiple pdf. The issue is ...
4
votes
1answer
3k views
knitr::include_graphics in bookdown, is not rendering the image
I am trying to include a .png file in a file that I am rendering using bookdown. knitr::include_graphics() should be the way to go.
The code:
```{r fig1, fig.cap='My Caption', echo=FALSE, message=...
4
votes
3answers
418 views
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 ...
2
votes
1answer
635 views
Changing *Chapter X* name in bookdown PDF
Instead of Chapter X when creating a PDF from bookdown, I would like it to be "Módulo X" (in Spanish).
So I would like to know how to change chapter name using bookdown.
My YAML is:
---
title: "...
3
votes
1answer
1k views
Printing UTF-8 characters in R, Rmd, knitr, bookdown
UPDATE (April 2018):
The problem still persists, under different settings and computers.
I believe it is related to all UNICODE, UTF-8 characters.
https://www.joelonsoftware.com/2003/10/08/the-...
2
votes
1answer
570 views
Bookdown add URL as footnote
I am having problems getting correct pdf output of figure legends that contain a url. It works as bookdown::gitbook but not as bookdown::pdf_book
Here is an example:
---
output: bookdown::pdf_book
--...
1
vote
1answer
275 views
Bookdown: Chapter/Section cross referencing not working (gitbook)
I was having trouble with one of my bookdown projects where the chapter/section cross-references were no longer working in the html output.
The problem is the html links work but they are displayed ...
33
votes
1answer
5k views
Space after every five rows in kable output (with booktabs option) in R Markdown document
I am using knitr::kable() to render tables as part of an R Markdown document (that itself is part of a bookdown project). In particular, the booktabs option (through setting the booktabs argument to ...
10
votes
1answer
2k views
How to host multiple Github repos using the same custom domain on Netlify?
I am currently hosting my personal website (created using blogdown and Hugo) using Netlify at wjakethompson.com. This is deployed through a Github repository.
I now have a bookdown project in a ...
10
votes
1answer
2k views
creating custom blocks in RStudio's bookdown
I'm experimenting with the great new package bookdown to create a gitbook-style book using RMarkdown within RStudio. See here.
My question is about creating custom blocks. There is an example in the ...
9
votes
1answer
2k views
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 ...
7
votes
1answer
3k views
R bookdown - cover page and appendix
I have written a draft book in R Markdown.
Two questions:
Is it possible to include a 'cover page' with graphic and text in the index.rmd file so that the rendering in bookdown- shows a cover page ...
6
votes
1answer
442 views
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 ...
12
votes
1answer
1k views
R Bookdown _bookdown.yml
Bookdown has many configuration options and I am finding it hard to understand how to know whether an option exists, and the logic behind where these options are stated.
Specifically I am finding it ...
6
votes
1answer
951 views
Bookdown: How can I change the size of the chapter titles?
I am using bookdown to generate slides for a workshop. I use the 'big' letter option in the menu for display as slides. However then the chapter title font size is too large. Where/how can I modify ...
5
votes
1answer
288 views
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 ...
4
votes
0answers
438 views
R bookdown gitbook - how to override table style
I like the gitbook style in general, but some tables (particularly regression tables) look awful on it. How do I make specific tables in my document (not all of them) render as per the default ...
4
votes
1answer
590 views
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 this:
download.file('...
2
votes
1answer
228 views
Citations in PDFs produced by Bookdown are incorrect
I am making a book with bookdown. The HTML version renders exactly as I would expect it to.
For example, the
5. Read Chapter 7 of Myers
[-@myers_2013_qualitativeresearchbusiness p. 73--91] &...
0
votes
1answer
976 views
Cairo pdf doesn't work properly due to “out of memory” in R
I'm trying to produce a pdf document with a graphic created with some R functions, like plot() or ggplot(). Since I use a Windows machine, I need to call cairo_pdf to change the font-family of the ...
6
votes
1answer
144 views
Is there a way to use latex expression of chemarr for `gitbook` format of bookdown package?
I would like to use latex expression of chemarr for gitbook format of bookdown package.
\begin{equation}
[C] + [R]
\xrightleftharpoons[k_{-1}]{k_1}
[CR] + [C]
\xrightleftharpoons[k_{-2}]{k_2}...
6
votes
1answer
2k views
Bookdown: Set Page Breaks
I cannot find out how to make a page break in R bookdown.
With page break I mean that the content within one page is displayed as one website.
By default there is always a page break in front of ...
6
votes
2answers
757 views
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 ...
5
votes
1answer
749 views
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 ...
4
votes
1answer
1k views
Coverpage and copyright notice before title in R bookdown?
Back in March, I asked a question and got an answer to including coverpage in a pdf document rendered by R bookdown:
R bookdown - cover page and appendix
I tried the solution and came up with the ...
4
votes
1answer
2k views
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: ...
3
votes
1answer
319 views
Change figure and table captions in blogdown
I'm tinkering with blogdown and would like to create figures and table with non-English caption headers. The following chunk
```{r label1, echo=FALSE, fig.cap="Fancy caption", fig.fullwidth=TRUE}
...
3
votes
1answer
1k views
Chapter(s) before table of contents in Bookdown PDF output
I'd like for a chapter to appear before the table of contents (but after the title page) in the pdf_book output of Bookdown.
One way to do this is to add the chapter to a .tex file and and link it ...
1
vote
1answer
297 views
Bookdown text references not working if URL contains special characters
There is some inconsistent behaviour of text references in bookdown with URLs containing special characters such as : or _. Here are some demonstrations:
---
output: bookdown::pdf_book
---
(ref:good)...
1
vote
1answer
153 views
A workflow with bookdown to produce frequency, cross tables and model summary tables
I am starting to write a book using bookdown and trying to find the best workflow. First of all I am trying to make frequency tables, crosstables and model summaries, using bookdown with pdf format ...