bookdown

Changing *Chapter X* name in bookdown PDF

大兔子大兔子 提交于 2019-12-02 07:15:24
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::bookdown_site language: label: chapter_name: "Módulo" --- I tried with the last three line codes, with

Printing UTF-8 characters in R, Rmd, knitr, bookdown

末鹿安然 提交于 2019-12-02 02:15:16
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-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/ PROBLEM: My Rmd/R file is saved with UTF-8 encoding. Other sessionInfo() details: Platform: x86_64-w64-mingw32/x64 (64-bit) LC_CTYPE=English_Canada.1252 other attached packages: [1] knitr_1.17 Here is a simple data frame that I need to print as a table in a html document, e.g. with kable

Bookdown add URL as footnote

我的梦境 提交于 2019-12-02 01:34:22
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 --- ## Reference with URL doesn't work In this experiment, we will use a [spectrophotometer] (https://en.wikipedia.org/wiki/Spectrophotometry) to measure the absorption of light of different wavelength by colored solutions. (ref:spectrum) [Spectrum of light. V, violet; B, blue; G, green Y, yellow; O, orange; R, red](https://commons.wikimedia.org/wiki/File:Linear_visible_spectrum.svg) ```{r spectrum,

creating accompanying slides for bookdown project

别说谁变了你拦得住时间么 提交于 2019-12-01 19:24:45
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 obvious step is to want to have slides at the same time, very much in line with what the beamer package does, allowing for both beamer mode and article mode . Therefore, I tried to add another output in the _ output.yml code: bookdown::pdf_document2 . In line with the documentation, I know I should be able to define the base_format to use rmarkdown::beamer , The package author told me I was almost

Rmarkdown/Bookdown: Separate figure numbering for Supplemental Section

a 夏天 提交于 2019-12-01 16:50:47
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 Fig 1-5. But then, for the Supplemental section, the numbering restarts as Fig S1, S2, S3, etc. Bookdown allows cross-referencing ( \@ref(fig:label) but I'm not sure how to restart the numbering in a separate section. Is there a good way to do this? lukeholman You can define a new LaTeX function in the YAML header of your .rmd file as follows: \newcommand{\beginsupplement}{ \setcounter{table}{0}

R bookdown - custom title page

匆匆过客 提交于 2019-12-01 16:27:20
问题 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 simple, just for test: \begin{titlepage} Hello world \end{titlepage} 回答1: In the LaTeX template <R-Library>/rmarkdown/rmd/latex/default-1.17.0.2.tex we see \begin{document} $if(title)$ \maketitle $endif$ $if(abstract)$ \begin{abstract} $abstract$ \end{abstract} $endif$ $for(include-before)$ $include

Rmarkdown/Bookdown: Separate figure numbering for Supplemental Section

回眸只為那壹抹淺笑 提交于 2019-12-01 15:52:52
问题 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 Fig 1-5. But then, for the Supplemental section, the numbering restarts as Fig S1, S2, S3, etc. Bookdown allows cross-referencing ( \@ref(fig:label) but I'm not sure how to restart the numbering in a separate section. Is there a good way to do this? 回答1: You can define a new LaTeX function in the

How to fold verbatim text (not code) in R bookdown?

人盡茶涼 提交于 2019-12-01 08:20:36
问题 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 fold them. How to do that? Searching the web it seems all related topics are about code folding, but what I want to fold is not any type of code, just simple text... Thanks! 回答1: Here is a very easy way to implement the following yourself: You can find all the code you need in the following

How to format kable table when knit from .rmd to Word (with bookdown)

谁说胖子不能爱 提交于 2019-12-01 06:23:57
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 table row. Can kableExtra be used when knitting to Word ? This is a subset of my code : library(dplyr) knitr::opts_chunk$set(echo = TRUE) library(knitr) # required for kable library(kableExtra) # required for kableExtra options(knit.r.table.format = "markdown") myRegion <- c("a", "b", "c") Current_Perc_1 <- c(85.9, 90.8, 89.7) Current_Perc_2 <- c(88.0, 91.0, 89.0) tab_curr_est_2_times <- cbind

How to format kable table when knit from .rmd to Word (with bookdown)

回眸只為那壹抹淺笑 提交于 2019-12-01 05:31:25
问题 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 table row. Can kableExtra be used when knitting to Word ? This is a subset of my code : library(dplyr) knitr::opts_chunk$set(echo = TRUE) library(knitr) # required for kable library(kableExtra) # required for kableExtra options(knit.r.table.format = "markdown") myRegion <- c("a", "b", "c") Current