After a fair amount of trying to work out what a .sty is, if I can apply a .css and what YAML can do, I've found a method to successfully and simply set fonts in a .PDF output.
I go to the YAML header in the .Rmd and use:
fontfamily:arev
I spent a long time trying to work out why sansfont
wasn't working, and I think the reason is because my latex engine is set to pdflatex
, not xelatex
or lualatex
. I've tried both these options, which result in the process hanging and having to be aborted. I have MiKTeX 2.9 installed, so question one:
How do I change the engine to stop the process hanging?
Secondly, I've seen some documentation, and understand in theory the idea of having a .sty file in the folder as a kind of settings file for the LaTeX rendering, though I've been unable to find a straightforward explanation to what it needs to contain, and what it can do. So question two:
What goes into a .sty file, and what would it add to my work flow?
Thirdly, I've finally found here the clue that pushed me fron sansfont
to fontfamily
, though the documentation says
fontfamily
font package to use for LaTeX documents (with pdflatex): TeXLive has bookman (Bookman), utopia or fourier (Utopia), fouriernc (New Century Schoolbook), times or txfonts (Times), mathpazo or pxfonts or mathpple (Palatino), libertine (Linux Libertine), arev (Arev Sans), and the default lmodern, among others.
Which helps a bit, but "among others" is fantasically vague, and doesn't indicate further resource.
What "others" are available. How can I check what might be available in my current setup?
EDIT
Extra credit: I have also realised that the ggplot2
objects I am compiling the report for all have their own font set, which in my case is presumably the setting from themes.
What is the easiest way to match the selection of font in the YAML header with the ggplot2 objects?