How to convert R Markdown to PDF?

Updated Answer (10 Feb 2013) rmarkdown package: There is now an rmarkdown package available on github that interfaces with Pandoc. It includes a render function. The documentation makes it pretty clear how to convert rmarkdown to pdf among a range of other formats. This includes including output formats in the rmarkdown file or running supplying … Read more

How to convert a Markdown file to PDF

Via the terminal (tested in 2020) Download dependencies sudo apt-get install pandoc texlive-latex-base texlive-fonts-recommended texlive-extra-utils texlive-latex-extra Try to use pandoc MANUAL.txt -o example13.pdf pandoc MANUAL.md -o example13.pdf Via a Visual Studio Code extension (tested in 2020) Download the Yzane Markdown PDF extension Right click inside a Markdown file (md) The content below will appear Select … Read more

How to set size for local image using knitr for markdown?

The question is old, but still receives a lot of attention. As the existing answers are outdated, here a more up-to-date solution: Resizing local images As of knitr 1.12, there is the function include_graphics. From ?include_graphics (emphasis mine): The major advantage of using this function is that it is portable in the sense that it … Read more

Set margin size when converting from Markdown to PDF with pandoc

Recent versions of rmarkdown and pandoc In more recent versions of rmarkdown, the settings of margins can be done in the YAML header via the top-level element geometry. What you specify in the geometry tag will be piped into the LaTeX template that ships with Pandoc via the following LaTeX snippet $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ For … Read more