I am looking for at way to plot graphs in R, using LaTeX fonts.
In the documentation for pdfFonts in R, it states that:
There are also mappings for "ComputerModern", "ComputerModernItalic" and, as from R 3.1.0, "ArialMT" (Monotype Arial).
When using pdf(file = outputFile, width=11.692, height=8.267, family = "ComputerModern") I get the following error message:
Error in pdf(file = outputFile, width = 11.692, height = 8.267, family = "ComputerModern", :
unknown family 'ComputerModern'
Execution halted
I am using R version 3.2.2 (2015-08-14). How can I use LaTeX fonts in R? Preferable without installing extra libraries.


fontcmpackage that can be used with theextrafontpackage (see here). I've never had much luck getting that to work. Instead, I've had luck installingcm-unicodeand using it as "CMU Serif" withextrafont. – Adam Liter Dec 16 '15 at 22:37extrafontprovides the commandembed_fonts()to allow you to do this, which is discussed in the link from my first comment. You can also useCairoPDF()from theCairopackage to embed fonts, which is something I've had more success with than usingextrafont'sembed_fonts().tikzDeviceis a good solution, too, though! – Adam Liter Dec 17 '15 at 17:49tikzDeviceandknitrhttps://tex.stackexchange.com/a/330486/11604 – Fran Oct 07 '19 at 21:27