I'm new to the RMarkdown >> LaTeX >> PDF pipeline. I'm trying to change the fonts in my final PDF, but I don't know what package to install for any given font. This post works for changing the font to Source Sans Pro, but I don't know what package to install for any other fonts.
I'm using TinyTeX as my LaTeX distribution, which according to documentation is supposed to install packages automatically.
My first attempt was to simply name a different font as my mainfont in the YAML header, e.g. Bera Sans, which is included in the LaTeX font catalogue, and let TinyTeX worry about the rest.
---
title: "example"
output:
pdf_document:
includes:
in_header: "header.tex"
mainfont: BeraSans
---
However, here, nothing happens and the default RMarkdown font gets used instead.
My second attempt was to follow the usage instructions for Bera Sans, linked above, and add "\usepackage[scaled]{berasans}" to my header.tex file as below.
\usepackage[scaled]{berasans}
\usepackage[T1]{fontenc}
\usepackage{pdflscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
Again, this results in the default RMarkdown font.