I have recently started using tikzDevice in R to create plots to be compiled in LaTeX. However, I haven't found a way to get rid of the boldface font in the main caption.
As an example, I create the following graph in R:
library(tikzDevice)
tikz(file = 'example.tex', standAlone = TRUE)
plot(1, main = 'Plot of $\\hat{\\beta}$')
dev.off()
Which produces the necessary LaTeX output but introduces {\bfseries Plot of $\hat{\beta}$}
. This is particularly unpleasant when, as in the example, math in normal font is paired with bold face text. I'm interested in removing the \bfseries
from within R, as I need to produce several plots within a for loop.
tikzDevice
just translates the R plot. And in R titles are in bold by default. You can change that usingfont.main = 1
: