Dear help list Does anybody know if it is possible to somehow tell R to let LaTeX handle the fonts for postscript plots produced by R? It is for a thesis and I have MANY figures. These are created by R scripts dynamically as the document is compiled, using the Make system. I see that I can `manually' specify the font family each time I call the postscript device, but I am looking for a better way. I would like to do it in a way that allows me to specify the font only once, and the same font will then be used throughout. There is too much text to use PSFrag. Thanks for your help! Karen [[alternative HTML version deleted]]
On Nov 8, 2012, at 7:00 AM, Karen Kotschy <karen.kotschy at gmail.com> wrote:> Dear help list > > Does anybody know if it is possible to somehow tell R to let LaTeX handle > the fonts for postscript plots produced by R? > > It is for a thesis and I have MANY figures. These are created by R scripts > dynamically as the document is compiled, using > the Make system. I see that I can `manually' specify the font family each > time I call the postscript device, but I am looking > for a better way. I would like to do it in a way that allows me to specify > the font only once, and the same font will then be > used throughout. There is too much text to use PSFrag. > > Thanks for your help! > KarenTake a look at ?ps.options, which is referenced in ?postscript in the Details and See Also sections there. Regards, Marc Schwartz
Perhaps you can use ps.options(family = "...") to set the font family globally. If you really want to control R fonts through LaTeX, you can try the tikzDevice package (optionally with knitr) following the instructions in https://github.com/yihui/knitr-examples/blob/master/059-tikz.Rnw This allows you to generate R plots with font style consistent with your main document. Two other examples: https://github.com/downloads/yihui/knitr/knitr-manual.pdf and https://github.com/downloads/yihui/knitr/knitr-graphics.pdf Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, Nov 8, 2012 at 7:00 AM, Karen Kotschy <karen.kotschy at gmail.com> wrote:> Dear help list > > Does anybody know if it is possible to somehow tell R to let LaTeX handle > the fonts for postscript plots produced by R? > > It is for a thesis and I have MANY figures. These are created by R scripts > dynamically as the document is compiled, using > the Make system. I see that I can `manually' specify the font family each > time I call the postscript device, but I am looking > for a better way. I would like to do it in a way that allows me to specify > the font only once, and the same font will then be > used throughout. There is too much text to use PSFrag. > > Thanks for your help! > Karen