Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 produced by the default settings but in a single file? If I want to send the book to someone else sending a stack of files is not great, especially if the person who receives it is not familiar with HTML as a document format.

like image 622
mhwh Avatar asked Dec 05 '16 14:12

mhwh


People also ask

How do I export an RMD from HTML?

To transform your markdown file into an HTML, PDF, or Word document, click the “Knit” icon that appears above your file in the scripts editor. A drop down menu will let you select the type of output that you want. When you click the button, rmarkdown will duplicate your text in the new file format.

How do I share an HTML file in R?

By default, RMarkdown rendered as HTML are self-contained. This means you can compile the document into HTML file and simply email it to a colleague. It should have all that is needed to render the document on your colleague's web browser.

How do you compile a Bookdown?

Open the R Markdown file index. Rmd , and click the button Build Book on the Build tab of RStudio. This will compile the book and display the HTML version within the RStudio Viewer, which looks like Figure 12.1. FIGURE 12.1: The HTML output of the bookdown template.


1 Answers

This turns out to be a bug of bookdown, and I just fixed it on Github. You can install and test the development version (>= 0.3.3):

devtools::install_github('rstudio/bookdown')
like image 145
Yihui Xie Avatar answered Sep 20 '22 15:09

Yihui Xie