Specify Font type on R Markdown

How can I specify a font type ie 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, eg 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}
链接地址: http://www.djcxy.com/p/24970.html

上一篇: IntelliJ IDEA报告合同违规警告

下一篇: 在R Markdown上指定字体类型