pandoc

Plot size and resolution with R markdown, knitr, pandoc, beamer

落花浮王杯 提交于 2019-11-28 03:26:52
Doesn't fit on the slide by default, doesn't even print by any other means. Here's the .Rmd: Edit: it seems you have to use plot() in every chunk. Second plot now prints. # Plot should show at high resolution ```{r echo=FALSE, comment = ""} # load some data require(plyr) rbi <- ddply(baseball, .(year), summarise, mean_rbi = mean(rbi, na.rm = TRUE)) ``` ```{r} # plot plot(mean_rbi ~ year, type = "l", data = rbi) ``` # Second attempt ```{r, fig.width = 2, fig.height = 2} plot(mean_rbi ~ year, type = "l", data = rbi) ``` # Third attempt ```{r, out.width = 2, out.height = 2} plot(mean_rbi ~ year,

R doesn't recognize Pandoc Linux Mint

…衆ロ難τιáo~ 提交于 2019-11-28 01:40:44
I asked a related question: check if a program is installed But am refraining from answering until I've tested the solutions for myself on all three systems. I can get pandoc to work from within R on a windows machine but on linux I get this error/response for each method from the R terminal: 1: > system('pandoc -v') sh: 1: pandoc: not found 2: > myPaths <- c("pandoc", + "~/.cabal/bin/pandoc", + "~/Library/Haskell/bin/pandoc", + "C:\\PROGRA~1\\Pandoc\\bin\\pandoc") > Sys.which(myPaths) pandoc ~/.cabal/bin/pandoc "" "/home/tyler/.cabal/bin/pandoc" ~/Library/Haskell/bin/pandoc C:\\PROGRA~1\

Can I set command line arguments using the YAML metadata

若如初见. 提交于 2019-11-28 01:26:27
问题 Pandoc supports a YAML metadata block in markdown documents. This can set the title and author, etc. It can also manipulate the appearance of the PDF output by changing the font size, margin width and the frame sizes given to figures that are included. Lots of details are given here. I'd like to use the metadata block to remember the command line arguments that I'm supposed to be using, such as --toc and --number-sections . I tried this, adding the following to the top of my markdown: ---

check if a program is installed

只谈情不闲聊 提交于 2019-11-28 01:04:51
I'm writing a function that uses pandoc in R through the command line. How can I use R to check if pandoc installed (I also assume it would have to be on the path which may be an issue for windows users)? This suggestion is based entirely on my personal experience with this question that RStudio can't seem to read what's in my .bashrc file on my Ubuntu system. I have installed Pandoc using the cabal install pandoc method described here since there were features I needed from more recent versions of Pandoc than were available with Ubuntu's package manager. Running R from the terminal could

Not able to use titlesec with markdown and pandoc?

只愿长相守 提交于 2019-11-28 01:01:53
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 found and verified the following approach would work: pandoc --variable=subparagraph try.md -o try.pdf

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

落爺英雄遲暮 提交于 2019-11-27 21:47:43
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 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 my document. It would work as HTML, but not as PDF. After seeing isomorphismes 's post I clicked on the

Create parametric R markdown documentation?

梦想与她 提交于 2019-11-27 20:48:08
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: ", res, "</h3>>")) plot(results[[res]]$x, results[[res]]$y) } This doesn't seem to be the right way to do

Knitr & Rmarkdown docx tables

青春壹個敷衍的年華 提交于 2019-11-27 20:28:06
问题 When using knitr and rmarkdown together to create a word document you can use an existing document to style the output. For example in my yaml header: output: word_document: reference_docx: style.docx fig_caption: TRUE within this style i have created a default table style - the goal here is to have the kable table output in the correct style. When I knit the word document and use the style.docx the tables are not stylized according to the table. Using the style inspector has not been helpful

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

浪子不回头ぞ 提交于 2019-11-27 20:15:25
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 $(pwd):/texlive \ my-texlive-image \ pdflatex test.tex # generates test.pdf But, in fact, what I want

Pandoc markdown page break

守給你的承諾、 提交于 2019-11-27 19:55:03
问题 Recently I started using Pandoc markdown which seems a good alternative to LaTeX, as my document does not have many mathematical formulas, and I do not have ANY experience with LaTeX, which combined with less than 2 week submission deadline makes it a good solution. One thing I haven't been able to come around is how to force it to leave rest of the page empty, can anyone help? 回答1: It looks like pandoc markdown uses standard LaTeX tags for this purpose: \newpage and \pagebreak 回答2: TL;DR :