Why doesn't the following minimal (un) working example of R Markdown compile to PDF?
---
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \lhead{}
- \chead{}
- \rhead{The performance of new graduates}
- \lfoot{From: K. Grant}
- \cfoot{To: Dean A. Smith}
output:
pdf_document:
keep_tex: yes
latex_engine: xelatex
---
# Test
In particular, a problematic conversion occurs with -\lfoot{From: K. Grant}
and -\cfoot{To: Dean A. Smith}
, as shown in the output file .tex
:
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{The performance of new graduates}
true
true
For some reason, both of these lines are converted to true
, causing
LaTeX error: missing \begin{document}
thereby preventing the compilation of the document into PDF.
Changing \lfoot
and \cfoot
anything else seems to lead to the correct conversion. So what's going on here? I believe that there should be a problem with knitr
or in the conversion process pandoc
.
NB: R Markdown, , Fancyhead, PDF TeX.SX .