bookdown

R Bookdown _bookdown.yml

ぐ巨炮叔叔 提交于 2019-12-05 14:01:43
问题 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 hard to describe what kind of options go in _bookdown.yml given that there are at least two other places for stating options: In _output.yml , Arguments to function calls such as bookdown::render_book . It doesn't appear to me that there's any sort of 1 to 1 mapping between _bookdown.yml and

Bookdown: Single html output file

元气小坏坏 提交于 2019-12-05 13:17:16
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. 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):

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

a 夏天 提交于 2019-12-04 12:13:32
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('https://bookdown.org/yihui/bookdown/images/cover.jpg','cover.jpg', mode = 'wb') knitr::include_graphics('cover.jpg') It works very well for both the gitbook and pdf outputs. But I do not think it is smart. It is necessary for pdf to download the file first, but unnecessary for gitbook output. The image can be included directly to the gitbook output via: knitr::include_graphics('https://bookdown.org

Bookdown: How can I change the size of the chapter titles?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:05:11
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 that one? Thanks, Paul roman you can control this with .css as yihui suggests in the top level of your bookdown project there is a file called style.css open it and paste in: .book .book-body .page-wrapper .page-inner section.normal h1{font-size:1em} this will increase the size of your top level header font when you build the book. you can change the value of 'em' or you can use other ways of

Referencing a 'hand-made' table using bookdown package

为君一笑 提交于 2019-12-04 01:54:02
I am trying to reference a table using the bookdown package. In the documentation the author only shows how to create tables using knitr::kable . ```{r table1} knitr::kable( head(iris, 20), caption = 'Here is a nice table!', booktabs = TRUE ) ``` Table \@ref(tab:table1) is here. Using knitr::kable works just fine. The caption of the table is displayed and I can reference the table. I would like to do the same with a classic hand-made markdown table but obviously the code below fails. What can I do to get a similar result as with the code above? ```{r table2, echo=FALSE, results='asis'} cat('|

Create index of definitions / theorems at end of bookdown book

烂漫一生 提交于 2019-12-03 14:48:27
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, like this: ```{definition, bar, echo=T} A bar is defined here as a foo-like thing. ``` (My need is for definitions, but others might like lists of theorems, etc. Don't know if lists of figures and tables could be covered in the same way?) Thanks to @yihui I know that knitr::all_labels(engine == 'definition') is my friend. So I can do this anywhere in the end of the book, usually at the end: ```

Cross-referencing in a single-file bookdown document

拈花ヽ惹草 提交于 2019-12-03 05:32:19
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 bookdown, if we use bookdown::html_document2 in the YAML: https://bookdown.org/yihui/bookdown/a-single-document.html Looking at the raw rmarkdown for that chapter of the bookdown manual, I've tried to follow the instructions to make a single Rmd file that can use those cross-referencing functions. But I can't get it to render as expected, with cross-references. Here's a simple example Rmd: ---

Relationship between R Markdown, Knitr, Pandoc, and Bookdown

流过昼夜 提交于 2019-12-03 00:24:01
问题 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 embedded R code (e.g. .Rnw or .Rmd ) into final outputs (e.g. .pdf or .html )? And if Knitr is used to process RMarkdown, what does the rmarkdown package do and how is it different to the markdown package ? 回答1: Pandoc Pandoc is a document converter. It can convert from a number of different

creating custom blocks in RStudio's bookdown

扶醉桌前 提交于 2019-12-02 21:08:33
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 documentation of how to define a block style in a CSS file: div.FOO { font-weight: bold; color: red; } And the authors give some examples of what blocks might look like. AFAIK, there is not an example of how to define this specific block with an icon. I don't know much about CSS, so looking for something I can modify. I'd like to use font awesome icons like Leanpub does to create some special

Changing *Chapter X* name in bookdown PDF

情到浓时终转凉″ 提交于 2019-12-02 07:43:56
问题 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: "TITLE" author: "Mario Modesto-Mata" date: "`r Sys.Date()`" output: pdf_document description: This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook. documentclass: book link-citations: yes bibliography: book.bib site: bookdown: