5

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?

Adam Smith
  • 2,584
  • 2
  • 20
  • 34
DaveRGP
  • 1,430
  • 15
  • 34
  • 1
    I am sorry to say that but your "question" are actually questionS and one of them "What goes into a .sty file?" is a very huge one. In fact you are asking us to write a stile file `.sty` for you. – SabDeM Sep 14 '15 at 13:40
  • 1
    @SabDeM - Yes, there are multiple questions, however, they are linked to the same topic i.e. "how to change the font". To my knowledge a method would include using a .sty. I'm not asking you to write an .sty, I have provided no spec to do so. It is a query as to if that will satisfy the objective, and a request as to what benefits that may have over the current method. – DaveRGP Sep 14 '15 at 14:21
  • I remain to my point because change font in LaTeX is a thing that triggers theoretical and practical consequences and then I think you need power TeX users to have satisfying and exhaustive answers. – SabDeM Sep 14 '15 at 14:25
  • 1
    @SabDeM - That's exactly what I'm hoping for. This is a topic beyond my current experience, and I would like to learn from anyone with more knowledge and experience than me. – DaveRGP Sep 14 '15 at 14:27

0 Answers0