I would like to convert a *.Rmd to document to PDF without rstudio being available.
Current approach
Current approach follows the following steps:
*.Rmddocument is passed toknitr:knit(input = "report.Rmd"))Obtained md is converted via pandoc:
# Convert pandoc --smart --to latex \ --latex-engine pdflatex \ -s report.md \ -o report.PDF
Problems
This results in the following problems, the top section of the Rmarkdown document:
---
title: "Report Title"
author: "Person"
output: pdf_document
classoption: landscape
---
and shows as:
all text is centered, whereas I would like for it to be left-aligned:
Possible approach
I would like to make use of the rmarkdown::render; however, despite setting RSTUDIO_PANDOC (as discussed here), the command fails on pandoc not being available.
Desired outcome
I don't care much whether the utilised mechanism makes use of the rmarkdown::render, what I want to achieve is:
- Landscape page layout across all pages
- Left-aligned text
- Ability to exercise minimum control over the document by controlling default fonts
- Ideally, I would like to do as much as in the
*.Rmdfile as possible without the need to add parameters to thepandoccommand.
Updates, following comments
- I'm working on Linux and pandoc is installed, I can execute
pandoccommand pass files and generate exports with no problems. It only doesn't work with thermarkdown::renderpackage. - Concerning the hooks and
*.Rmdfiles, this is what I'm trying to understand as I see that that the first section of my*.Rmdfile is ignored. The current process looks as follows:*.Rmd(not much in it, just title section and dummy text and code that renders but wrongly justified) >*.Rfile running one lineknit(input = "report.Rmd"))>*.shfile runningpandoccommand and generating PDF
Concerning:
if all that is in place, it is indeed just a call to
rmarkdown::render(...)
The rmarkdown::render(...) fails:
Error: pandoc version 1.12.3 is required and was not found ...
However:
>> rmarkdown::pandoc_available()
[1] TRUE
and:
$ pandoc -v
pandoc 1.9.4.1 (...)
The RSTUDIO_PANDOC points to pandoc.

