How to change font and point size in bookdown pdf?

I am writing a paper with a strict requirement to use arial 12 points. I changed my yml output in bookdown as follows:

site: bookdown::bookdown_site
fontsize: 12pt
fontfamily: arial
documentclass: book
output: 
  bookdown::pdf_book:
    includes:
      in_header: preamble.tex
    keep_tex: yes
    toc_depth: 3
    toc_appendix: yes
clean: [packages.bib, bookdown.bbl]

      

but it does not affect the result other than I had to install additional font packages in MikTex package manager, but even after that there were no changes in the actual release of the document, but the top of the _main.tex looks like this:

\documentclass[12pt,]{book}
\usepackage[]{arial}
\usepackage{amssymb,amsmath}

      

Why isn't he evaluating my choice of font? I also tried Lato, a similar font, but the document always comes back with the default serif font.

+6


source to share


2 answers


Try adding the following lines to preamble.tex

:



\usepackage{fontspec}
\setmainfont{Arial}

      

+1


source


The default document class for an article (but even for the book of your choice) only supports 10, 11, and 12. If you want more choices, you should use the KOMA equivalents.



0


source







All Articles