r-markdown

Pandoc fails to render valid LaTeX macro definitions from markdown (and R markdown)

浪尽此生 提交于 2020-03-23 09:36:51
问题 In R, I have character objects that contain LaTeX macro definitions. The challenge is to use these objects in R Markdown documents, so that the macro definitions are rendered correctly when the .Rmd files are converted to LaTeX (and then to PDF). It is a challenge because Pandoc (v2.9.1 and 2.9.2) fails to render some macro-generating code correctly, even when that code is valid LaTeX. Here is a minimal example. First, consider this Rmd file: --- title: "Rendering LaTeX Macros from R Objects"

Pandoc fails to render valid LaTeX macro definitions from markdown (and R markdown)

荒凉一梦 提交于 2020-03-23 09:36:34
问题 In R, I have character objects that contain LaTeX macro definitions. The challenge is to use these objects in R Markdown documents, so that the macro definitions are rendered correctly when the .Rmd files are converted to LaTeX (and then to PDF). It is a challenge because Pandoc (v2.9.1 and 2.9.2) fails to render some macro-generating code correctly, even when that code is valid LaTeX. Here is a minimal example. First, consider this Rmd file: --- title: "Rendering LaTeX Macros from R Objects"

Error generating PDF with RMarkdown

 ̄綄美尐妖づ 提交于 2020-03-23 08:07:30
问题 I just bought a new Mac. I've cloned my git repo onto it, and ran the following, which worked fine on the old Mac: rmarkdown::render(input = "statement.Rmd", output_format="pdf_document", output_file = paste(Payees$Payee[i], "identifying text", i, "2018_02", ".pdf", sep=''), output_dir = "~/Desktop/path/to/directory") I've installed tinytex on the new box, and I've run install_tinytex() . Here's the error I get: tlmgr: package repository http://ctan.math.washington.edu/tex-archive/systems

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

How to prevent blogdown from rerendering all posts?

≡放荡痞女 提交于 2020-03-18 10:55:42
问题 Background: I am featuring a blog built on @YihuiXie's R package blogdown . Problem: When I render_site() , all source files (*.Rmd) are rendered - even the unchanged source files are re-reendered. This complete re-rendering is time consuming and unnecessary (I think). Question/ Desired Solution: How can I prevent blogdown from re-rendering the unchanged source files? I want blogdown to render only new or changed source files. What I have already tried: I've read the blogdown book; Yihui

R Markdown Error: 'is_latex_output' is not an exported object from 'namespace:knitr' [duplicate]

老子叫甜甜 提交于 2020-03-18 04:50:54
问题 This question already has an answer here : How should I deal with “'someFunction' is not an exported object from 'namespace:somePackage'” error? (1 answer) Closed 14 days ago . I have this Error when I first time using R Markdown, just a simple test run. --- title: "test" author: "Lulu" date: "3/6/2018" output: html_document --- ```{r} library(datasets) data("airquality") summary(airquality) ``` then it reports: output file: test.knit.md Error: 'is_latex_output' is not an exported object from

How to add dropdown menu on tab / tabset [rmarkdown / bootstrap]

故事扮演 提交于 2020-03-17 09:33:21
问题 Documentation for Bootswatch suggests I can use a dropdown menu from a tab in a tabset: How can I achieve this with Rmarkdown? I've tried: # SECTION 1 {.tabset .tabset-fade} ## Section 1.1 ## Section 1.2 {????something here?????} ### Section 1.2.1 <<<<<<<<< want this to appear under the dropdown menu 回答1: This is now available within the development version of rmarkdown , which you can install this via devtools::install_github("rstudio/rmarkdown") . To add a dropdown menu, you must add

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