bookdown

In Bookdown, `\textcolor` is not recognized when I attempt to compile an epub book using Pandoc

北城余情 提交于 2020-05-01 03:37:58
问题 In bookdown, it appears that \textcolor in latex is not recognized when I try to compile using bookdown::render_book('bookdown::epub_book') even though I have added \usepackage{xcolor} into the preamble.tex file. Is there a reason for this? 回答1: Let's have a look at the way the document is processed. I will leave out processing by the knitr and R Markdown packages and focus on pandoc, which is the final step when converting from Markdown to any other format. Pandoc first parses the document

In Bookdown, `\textcolor` is not recognized when I attempt to compile an epub book using Pandoc

萝らか妹 提交于 2020-05-01 03:37:12
问题 In bookdown, it appears that \textcolor in latex is not recognized when I try to compile using bookdown::render_book('bookdown::epub_book') even though I have added \usepackage{xcolor} into the preamble.tex file. Is there a reason for this? 回答1: Let's have a look at the way the document is processed. I will leave out processing by the knitr and R Markdown packages and focus on pandoc, which is the final step when converting from Markdown to any other format. Pandoc first parses the document

Caption above figure in html Rmarkdown

谁说我不能喝 提交于 2020-04-13 05:59:21
问题 Is it possible to move the caption above my figure when knitting to HTML in RMarkdown? It seems that it is possible in PDF, ie when knitting to PDF, but I can't figure out how to replicate this for HTML. I am using bookdown to number figures. When I run something like this: ```{r fig.cap= "caption"} df <- data.frame(letter = letters[1:5], value = 1) ggplot(df, aes(as(factor(1), value, fill = letters))) + geom_bar(stat = "identity") ``` the caption is displayed at the bottom of the figure, but

Add an image to Rmarkdown Bookdown output before top level heading

江枫思渺然 提交于 2020-03-22 08:38:21
问题 The example below (i.e. saved as a file index.rmd ) has the same code chunk to display an image above and below the top level heading, but the image doesn't appear above the top level heading. This occurs if there is a file _output.yml with only this entry bookdown::gitbook: in the same directory. That line seems to enforce a table of contents (which I want) and that appears to strip out anything (image or text) before the first top level heading by default (which I don't want) - so can this

Add an image to Rmarkdown Bookdown output before top level heading

眉间皱痕 提交于 2020-03-22 08:36:23
问题 The example below (i.e. saved as a file index.rmd ) has the same code chunk to display an image above and below the top level heading, but the image doesn't appear above the top level heading. This occurs if there is a file _output.yml with only this entry bookdown::gitbook: in the same directory. That line seems to enforce a table of contents (which I want) and that appears to strip out anything (image or text) before the first top level heading by default (which I don't want) - so can this

Add an image to Rmarkdown Bookdown output before top level heading

蹲街弑〆低调 提交于 2020-03-22 08:36:19
问题 The example below (i.e. saved as a file index.rmd ) has the same code chunk to display an image above and below the top level heading, but the image doesn't appear above the top level heading. This occurs if there is a file _output.yml with only this entry bookdown::gitbook: in the same directory. That line seems to enforce a table of contents (which I want) and that appears to strip out anything (image or text) before the first top level heading by default (which I don't want) - so can this

Table Cross-References in Bookdown with MS-Word Output?

大憨熊 提交于 2020-03-18 06:30:09
问题 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 flextables ? Below is a minimal working example. The second table, using kable() , gets me almost all the way there. The problem is that the table rendering in docx output is completely unusable (not in this MWE, but in my actual use-case). I considered creating the table conditionally, using

bookdown: customize the output filename

青春壹個敷衍的年華 提交于 2020-03-14 11:07:58
问题 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 therefore to give the output different names. If not, the second pdf compile overwrites the first one! In the comments to my earlier question, I wrote: "I just need to understand how to change the file name - because bookdown::pdf_book and bookdown::pdf_document2 output to the same file - which

Table in Bookdown/Huskydown with several features (Citation, Caption, URL, PNG Figure, …)

ぃ、小莉子 提交于 2020-03-10 04:39:24
问题 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 HTML. Requirements: Table width: fixed Cell width: fixed Vertical alignment: cell content aligned to the top Text formatting: like bold or italics (best would be if md formatting supported, such that code is output agnostic) and allow for line breaks in longer texts Citations: should be rendered

Table in Bookdown/Huskydown with several features (Citation, Caption, URL, PNG Figure, …)

拈花ヽ惹草 提交于 2020-03-10 04:39:08
问题 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 HTML. Requirements: Table width: fixed Cell width: fixed Vertical alignment: cell content aligned to the top Text formatting: like bold or italics (best would be if md formatting supported, such that code is output agnostic) and allow for line breaks in longer texts Citations: should be rendered