I was looking for a way to include a header in a rmarkdown PDF report. Someone suggested using fancyhdr so I included the suggested code into my .tex document (first three lines):
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{\includegraphics[width = .05\textwidth]{Logo.png}}
\newenvironment{cols}[1][]{}{}
\newenvironment{col}[1]{\begin{minipage}{#1}\ignorespaces}{%
\end{minipage}
\ifhmode\unskip\fi
\aftergroup\useignorespacesandallpars}
\def\useignorespacesandallpars#1\ignorespaces\fi{%
#1\fi\ignorespacesandallpars}
\makeatletter
\def\ignorespacesandallpars{%
\@ifnextchar\par
{\expandafter\ignorespacesandallpars\@gobble}%
{}%
}
\makeatother
\definecolor{rubblue}{RGB}{0,53,96}
\definecolor{rubgreen}{RGB}{141,174,16}
Before the download worked very well but after including these lines I get this error: Error in yaml::yaml.load(..., eval.expr = TRUE) : Parser error: while parsing a block mapping at line 5, column 5 did not find expected key at line 9, column 5 Ruft auf: ... tryCatch -> tryCatchList -> tryCatchOne ->
I think it's related to the \usepackage in the .tex document- is it possible rmarkdown can't find the fancyhdr packages and if yes how is it solved? I have TinyTex installed via tinytex. This is my .rmd's header:
---
title: "Title"
author: ""
output:
pdf_document:
keep_tex: true
includes:
in_header: preamble.tex
urlcolor: rubblue
params:
plotSAMP: "NULL"
plotApps: "NULL"
#mainfont: SourceSansPro
---