r-markdown

Rmarkdown Retain .tex file

被刻印的时光 ゝ 提交于 2020-03-14 09:41:40
问题 In R, when compiling a markdown document using rmarkdown::render(...) , how can I retain the intermediate .tex file that is produced from knitting. I have tried setting the clean=FALSE argument, but this retains the figures, not the final tex file or auxiliary files, which I need to inspect for debugging purposes. 回答1: You can specify it in your YML header with: output: pdf_document: keep_tex: true --- More options on the rmarkdown site. 来源: https://stackoverflow.com/questions/37701995

Rmarkdown Retain .tex file

≯℡__Kan透↙ 提交于 2020-03-14 09:40:54
问题 In R, when compiling a markdown document using rmarkdown::render(...) , how can I retain the intermediate .tex file that is produced from knitting. I have tried setting the clean=FALSE argument, but this retains the figures, not the final tex file or auxiliary files, which I need to inspect for debugging purposes. 回答1: You can specify it in your YML header with: output: pdf_document: keep_tex: true --- More options on the rmarkdown site. 来源: https://stackoverflow.com/questions/37701995

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

DiagrammeR/mermaid flowchart in Rmarkdown file with output format PDF/LaTex

假如想象 提交于 2020-03-05 04:05:59
问题 I would like to include a mermaid diagram in a PDF generated with R markdown. According to this post, mermaid creates an HTML widget as output. Unfortunately, the answer provided there for xaringan slides does not work for PDFs generated in R markdown. A Rmd-MWE is below. Any help is greatly appreciated! --- title: "DiagrammeR: mermaid diagram in Rmd" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Simple mermaid diagram ```{r} library(DiagrammeR)

DiagrammeR/mermaid flowchart in Rmarkdown file with output format PDF/LaTex

梦想的初衷 提交于 2020-03-05 04:04:52
问题 I would like to include a mermaid diagram in a PDF generated with R markdown. According to this post, mermaid creates an HTML widget as output. Unfortunately, the answer provided there for xaringan slides does not work for PDFs generated in R markdown. A Rmd-MWE is below. Any help is greatly appreciated! --- title: "DiagrammeR: mermaid diagram in Rmd" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Simple mermaid diagram ```{r} library(DiagrammeR)

Full author list for first citation in a chapter [apa.csl]

无人久伴 提交于 2020-03-03 12:00:08
问题 I'm writing my dissertation in R markdown. I am using bibtex, pandoc-citeproc, and apa.csl with bookdown. I have new_session: yes in my _bookdown.yml and compiling primarily to PDF ( documentclass:book , classoption: oneside ). The system I have is correctly using the full author list in place of "et al." for the first time I cite a 3-6 author work. That said, my adviser wants the full author list for the first time I cite a work per chapter . Is there an easy way to go about this? Here is

kable/kableExtra Add superscript to group labels in group_rows

百般思念 提交于 2020-03-03 11:33:08
问题 I have a table that I am creating for a pdf presentation using kable and kableExtra. I am wanting to group the rows and I need to use superscripts in the row group labels. I have tried several different things. Here is an example of some of the methods I have tried so far. library(kable) library(kableExtra) foo <- data.frame(a = 1:10, b = 11:20, c = 21:30) kable(foo, format = "latex", booktabs = T, row.names = FALSE, linesep = "", escape = FALSE) %>% kable_styling(latex_options = c("striped")

kable/kableExtra Add superscript to group labels in group_rows

折月煮酒 提交于 2020-03-03 11:32:02
问题 I have a table that I am creating for a pdf presentation using kable and kableExtra. I am wanting to group the rows and I need to use superscripts in the row group labels. I have tried several different things. Here is an example of some of the methods I have tried so far. library(kable) library(kableExtra) foo <- data.frame(a = 1:10, b = 11:20, c = 21:30) kable(foo, format = "latex", booktabs = T, row.names = FALSE, linesep = "", escape = FALSE) %>% kable_styling(latex_options = c("striped")

Insert GIF in pdf using rmarkdown

懵懂的女人 提交于 2020-03-03 07:50:43
问题 I am using rmarkdown to generate both HTML and pdf file. In my .Rmd file, I included a GIF like this: ![](www/script.gif) When I knit the to HTML it works fine. rmarkdown::render(documentation_file, encoding="UTF-8") However, when I try to knit to PDF using rmarkdown::render(documentation_file, rmarkdown::pdf_document(latex_engine = "xelatex"), encoding="UTF-8") I have the following problem: ! LaTeX Error: Unknown graphics extension: .gif. I do not mind to lose the animation of the gif, a