pandoc

pandoc document conversion failed with error 43 : pdflatex: The memory dump file could not be found

淺唱寂寞╮ 提交于 2019-11-26 23:06:16
问题 RStudio : 0.98.994 OS: Microsoft Windows 7 Ultimate Edition, 64-bit Service Pack 1 MiKTeX: 2.9.4503 Hi, I get the following error when I try to knit a PDF document. pandoc.exe: Error producing PDF from TeX source. This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9) pdflatex: The memory dump file could not be found. pdflatex: Data: pdflatex.fmt 回答1: I also tried devtools::install_github('rstudio/rmarkdown') but was still getting an error when I added 'fig.align='center' to a ggplot2 plot in

Create parametric R markdown documentation?

淺唱寂寞╮ 提交于 2019-11-26 22:59:48
问题 I want to iterate over a list of result-sets in my R markdown file. When I produce the output I want to include some text like headers with the name of the result set. One hacky solution I have found is to hardcode the html output directly in the documentation like this ## All results ```{r loopResults, echo=FALSE, results='asis'} results = list(result1 = data.frame(x=rnorm(3), y=rnorm(3)), result2=data.frame(x=rnorm(3), y=rnorm(3))) for(res in names(results)) { cat(paste("<h3>Results for: ",

Set margin size when converting from Markdown to PDF with pandoc

a 夏天 提交于 2019-11-26 22:18:51
问题 I have created an RMarkdown file in RStudio and managed to knit it with knitr into an HTML and .md file. Next, I used pandoc to convert the .md file into a PDF file (I get an error if I try and convert from the .html file). However, the PDF that is produced have massive margins (like this http://johnmacfarlane.net/pandoc/demo/example13.pdf). How can I get pandoc to produce something with smaller margins? I have looked through the pandoc user guide, but haven't found anything useful. 回答1:

Setting document title in Rmarkdown from parameters

こ雲淡風輕ζ 提交于 2019-11-26 19:18:43
问题 I've got an Rmarkdown template that works well, and I've parameterized it so I can generate variants of the same report from different data sources. However, I'd like to change the title of the report in each case. How do I do that? Here's the YAML header I have so far: --- title: "My Title" author: "Me, Inc." date: "August 4, 2015" output: pdf_document params: title: default --- I've tried using params=list(title="ASDF") in the call to rmarkdown::render , and although my code can see that

Figure position in markdown when converting to PDF with knitr and pandoc

回眸只為那壹抹淺笑 提交于 2019-11-26 18:37:44
I'm trying to control the position of a plot when converting to PDF using knitr and pandoc. My .Rmd file looks this: # My report Some text some text some text some text some text some text some text some text some text ```{r myplot, echo=FALSE, fig.pos="placeHere", results='hide'} library(ggplot2) ggplot(mtcars, aes(mpg, drat)) + geom_point() ``` Some text some text some text some text some text some text some text some text some text \usepackage{graphicx} \begin{figure}[placeHere] \centering \includegraphics[width=0.5\textwidth]{placeHere} \end{figure} Some text some text some text some text

Docker : Can a container A call an executable located on an other container B?

那年仲夏 提交于 2019-11-26 18:16:54
问题 I have two Docker images, one containing pandoc (an utility to convert documents in different formats to many formats), and an other containing pdflatex (from texlive, to convert tex files into pdf ). My goal here is to convert documents from md to pdf . I can run each image separately : # call pandoc inside my-pandoc-image (md -> tex) docker run --rm \ -v $(pwd):/pandoc \ my-pandoc-image \ pandoc -s test.md -o test.tex # call pdflatex inside my-texlive-image (tex -> pdf) docker run --rm \ -v

Not able to use titlesec with markdown and pandoc?

白昼怎懂夜的黑 提交于 2019-11-26 17:00:13
问题 When I used titlesec in my markdown document as below: --- header-includes: - \usepackage{titlesec} --- when processing it by pandoc, I got the following error: pandoc try.md -o try.pdf ! Argument of \paragraph has an extra }. <inserted text> \par l.1290 \ttl@extract\paragraph pandoc: Error producing PDF by searching, I found the following work-around for R-markdown: Can't knit to pdf with custom styles I wonder how can I implement a similar work-around with markdown and YAML headers? I also

How to convert HTML with mathjax into Latex using Pandoc?

三世轮回 提交于 2019-11-26 11:00:01
问题 I have some HTML documents with MathJax equations, and I want to convert them to Latex, and then to pdf. I\'d like to use Pandoc. However, Pandoc replaces $ with \\$ and it replaces \\ in formulas with \\textbackslash{} . Is it possible to get Pandoc to pass MathJax formulas literally from HTML to Latex? 回答1: With the latest version of pandoc (1.12.2), you can do this: pandoc -f html+tex_math_dollars+tex_math_single_backslash -t latex Much nicer! If you don't want to convert math delimited by

How to combine two RMarkdown (.Rmd) files into a single output?

爱⌒轻易说出口 提交于 2019-11-26 08:43:42
问题 I have two files in the same folder: chapter1.Rmd and chapter2.Rmd, with the following content: chapter1.Rmd --- title: \"Chapter 1\" output: pdf_document --- ## This is chapter 1. {#Chapter1} Next up: [chapter 2](#Chapter2) chapter2.Rmd --- title: \"Chapter 2\" output: pdf_document --- ## This is chapter 2. {#Chapter2} Previously: [chapter 1](#Chapter1) How can I knit these so that they combine into a single pdf output? Of course, render(input = \"chapter1.Rmd\", output_format = \"pdf

How to convert R Markdown to PDF?

亡梦爱人 提交于 2019-11-26 08:40:24
问题 I\'ve previously asked about the commands for converting R Markdown to HTML. What is a good way to convert R Markdown files to PDF documents? A good solution would preserve as much as possible of the content (e.g., images, equations, html tables, etc.). The solution needs to be able to be run from the command-line. A good solution would also be cross-platform, and ideally minimise dependencies to make it easier to share makefiles and so forth. Specifically, there are a lot of options: Whether