How can I specify a font type i.e Tahoma
on R Markdown. I am using the following to define my document
---
bibliography: bibliography.bib
csl: nature.csl
documentclass: article
fontsize: 12pt
linkcolor: blue
mainfont: Arial
output:
pdf_document:
fig_caption: Yes
---
How can I also specify the font size of figure captions -- like for the figure below
![Figure 2: The impact of malaria disease the factors within the bednet that in turn affect infections and other health issues](climate_change.png)
Here an example using LaTeX-code. You need a seperate style-file in the same folder of your R markdown file, where you define the font-family.
In the style-file (mystyle.sty) you can define any font from the LaTeX Font Catalogue, e.g. Palatino Sans Serif:
\usepackage{palatino}
\renewcommand{\familydefault}{\sfdefault} % sans serif
\fontfamily{ppl}\selectfont
For a way to use Tahoma via LaTeX, please have a look here, or here.
The R markdown file looks like this and you can also use LaTeX fontsize commands to change the size of the caption:
---
output:
pdf_document:
includes:
in_header: mystyle.sty
---
\begin{huge}
![Figure 2: the caption of the picture](picture.png)
\end{huge}
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