I am writing a paper in R markdown and need to format it with this .cls file supplied by an academic journal.
A minimal .tex file compiles perfectly well with the above cls file.
My .tex file (compiled on ShareLaTeX with clv3.cls
saved in same directory):
\documentclass[shortpaper]{clv3}
\usepackage[utf8]{inputenc}
\title{Paper title}
\author{Name Surname}
\date{May 2018}
\begin{document}
\maketitle
\section{Introduction}
Some text.
\end{document}
However a comparable minimal document in R markdown, using the same cls file, fails to compile in Rstudio, with the following error: ! Package geometry Error: \paperwidth (0.0pt) too short.
My Rmd file (with clv3.cls
file saved in same directory):
---
title: "Paper title"
author: "Name Surname"
documentclass: clv3
classoption: shortpaper
output: pdf_document
---
# Introduction
Some text.
Why is this error induced when I try to use this class file with an R markdown document and how may I fix it?
I've tried manually specifying a pagewidth setting in the YAML header, but I don't really know what I'm doing. This seems undesirable anyway, since the normal LaTeX document works fine without it (and surely page width is something that should be specified by a journal, not manually overwritten by an author).
I do not know where exactly the clv3.cls
class and the default pandoc
template clash. However, that template does so many things that do not make sense when writing with a specific style, that is best to use your own template. Using clv3-template.tex
\documentclass[shortpaper]{clv3}
\usepackage[utf8]{inputenc}
$if(title)$
\title{$title$}
$else$
\title{}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$ \\ $endfor$}
$else$
\author{}
$endif$
\begin{document}
$if(title)$
\maketitle
$endif$
$body$
\end{document}
together with
---
title: "Paper title"
author: "Name Surname"
output:
pdf_document:
template:
clv3-template.tex
---
# Introduction
Some text.
should be a good starting point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With