Reputation: 1522
For my RMarkdown document, I would like to use a given Latex template.
Specifically: I try to knit my document to the EMNLP conference template (downloadable zip here).
My mini example below sits in that unzipped folder (containing the .sty
and .tex
files), so all dependencies work.
---
title: "my sample paper"
author: "A BCD"
date: 'Version: `r format(Sys.time(), "%d %B, %Y")`'
output:
pdf_document:
template: emnlp2021.tex
keep_tex: yes
abstract: "this is an abstract this is an abstract this is an abstract this is an abstract"
---
The body of the paper. The body of the paper. The body of the paper. The body of the paper.
But when knitted, it results in the default pdf that contains the conference instructions (i.e., my RMarkdown content is not shown).
The instructions in the rmarkdown book are great to point it to the .tex
but I couldn't find the answer there.
What am I doing wrong?
Upvotes: 0
Views: 86
Reputation: 17090
The template is not a pandoc template. It does not contain the special placeholders that pandoc uses to mark the places where it should actually insert the contents. The EMNLP template is for human processing.
You can take a look at the default latex pandoc template like this:
pandoc -D latex
For example, the placeholder $abstract$
is where the abstract will be placed. Simply replace the fragment after \begin{abstract}
in emnlp2021.tex
by $abstract$
and compile your Rmarkdown again: the abstract should now be in place. You will have to adapt all other fragments of the template as well!
Upvotes: 1