Specify the font type on R Markdown

How can I specify ie Tahoma font type in R Markdown. To define my document, I use the following:

 --- 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 the caption for the drawings - as shown in 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) 
+7
r knitr r-markdown
source share
1 answer

Here is an example of using LaTeX code. You need a separate 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 Catalog , for example. Palatino Sans Serif:

 \usepackage{palatino} \renewcommand{\familydefault}{\sfdefault} % sans serif \fontfamily{ppl}\selectfont 

To use Tahoma through LaTeX, please see here or here ,

The R markup file looks like this, and you can also use LaTeX fontsize commands to resize the label:

 --- output: pdf_document: includes: in_header: mystyle.sty --- \begin{huge} ![Figure 2: the caption of the picture](picture.png) \end{huge} 
+3
source share

All Articles