11

I am writing a document with a strict requirement to use arial 12 point. I have modified my output yml in bookdown like this:

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 has no effect on the output other than I was forced to install some extra font packages in MikTex package manager, but even after this was done, there was no change to the actual document output, yet the top of the _main.tex looks like this:

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

Why doesn't it honour my choice of font? I also tried Lato, a similar font, but the document always comes back with the default serif family font.

julianhatwell
  • 1,074
  • 1
  • 8
  • 17
  • 1
    it seems that the font size = 12 does change things, but there are only two possible font sizes, 12 and 'not 12'. If I had to produce a document with 14, 16, 20 etc, it would just revert to the smaller unknown font size. – julianhatwell Jun 21 '17 at 13:10
  • Still can't see to change the font though. Very frustrating. – julianhatwell Jun 21 '17 at 13:10
  • Have you tried adding `\renewcommand{\familydefault}{\sfdefault}` to `preamble.tex`? See also https://tex.stackexchange.com/questions/23957/how-to-set-font-to-arial-throughout-the-entire-document/23960#23960. – Ralf Stubner Jan 25 '18 at 12:00

2 Answers2

3

Try adding the following lines to your preamble.tex:

\usepackage{fontspec}
\setmainfont{Arial}
Martin Smith
  • 3,687
  • 1
  • 24
  • 51
0

The default article documentclass (but even the book one you selected) only supports 10, 11 and 12. If you want more choice you should use the KOMA equivalents.

mirh
  • 514
  • 8
  • 14