I have created a PDF in RMarkdown with the fancyhdr package in LaTeX. I'm trying to find a solution in which I can insert a horizontal line as a footer (just above the page number), as well as the page number in the right hand corner similar to the image I have attached. Additionally, is there a way in which I can change the color of all the hyperlinks (such as the table of contents) from the default black color to the same color as in the image?
My YAML is as follows
---
title: "Template for a Dynamic Report for Work"
Uni_Logo: Tex/logo.jpg
Author1: "Tangeni Shatiwa"
# ----- Manage headers and footers:
#BottomLFooter: $Title$
#BottomCFooter:
#TopLHeader: \leftmark # Adds section name at topleft. Remove comment to add it.
BottomRFooter: "\\footnotesize Page \\thepage" # Add a '#' before this line to remove footer.
addtoprule: TRUE
addfootrule: TRUE # Use if footers added. Add '#' to remove line.
toc: TRUE
numbersections: TRUE # Should sections (and thus figures and tables) be numbered?
fontsize: 11pt # Set fontsize
linestretch: 1.2 # Set distance between lines.
link-citations: TRUE # This creates dynamic links to the papers in reference list.
linkcolor: blue
output:
pdf_document:
includes:
in_header: "header.tex"
---
and the contents of the header.tex file are as follows
\usepackage{fancyhdr}
\usepackage{titling}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\setlength{\headheight}{50pt}
\lhead{\includegraphics[width = .2\textwidth]{logo.jpg}}
\fancyfoot[R]{\thepage}
\renewcommand{\footrulewidth}{0pt}
\pretitle{%
\begin{center}
\LARGE
\includegraphics[width=4cm,height=6cm]{logo.jpg}\\[\bigskipamount]
}
\posttitle{\end{center}}


