I'm using the latest R Studio, R 3.2.5, rmarkdown 0.9.6, which comes with pandoc 1.15.2 to write a journal article. Submission requires: linespacing: 1.43
and a keywords:
line just below the abstract.
When I click Knit PDF
I get the default template "C:\R\R-3.2.5\library\rmarkdown\rmd\latex\default-1.15.2.tex"
which does not support these fields in the YAML header. I see that default-1.17.02.tex
supports linespacing:
, but not keywords:
.
I tried to modify the latter template to add keywords handling, which seemed pretty straight-forward. The relevant portion of the template, that I called modified-template-1.17.0.2.tex
is
$if(title)$
\maketitle
$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
\providecommand{\keywords}[1]{\textbf{\textit{Keywords---}} #1}
$if(keywords)$
\keywords{$keywords$}
$endif$
I used the YAML header below, and pandoc
found it; however, it generated .tex
syntax errors, unrelated to the keywords:
field. I'm thinking that the rmarkdown
templates are specific to the version of pandoc
, but I have no way to tell.
can anyone help with this?
---
title: "My title"
author: ME
date: '`r format(Sys.time(), "%B %d, %Y")`'
output:
pdf_document:
fig_caption: yes
keep_tex: yes
number_sections: yes
template: "modified-template-1.17.0.2.tex"
keywords: Box M test, HE plots, MANOVA, graphics, ...
abstract: "This paper explores a variety of fascinating topics ... "
---
Note added: I tried this modifying the default-1.15.2.tex
template as described above. My result is the same, and the error I get is:
! Undefined control sequence.
l.527 {\centering \includegraphics
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
One more test: I simply used a copy of the standard default-1.15.2.tex
template in my local folder, with the YAML line
template: "default-1.15.2.tex"
This also gives the same error, so I am mystified as to the cause.