我最近开始在 R 中使用 tikzDevice 创建要在 LaTeX 中编译的绘图。但是,我还没有找到摆脱主标题中粗体字体的方法。
作为示例,我在 R 中创建了以下图表:
library(tikzDevice)
tikz(file = 'example.tex', standAlone = TRUE)
plot(1, main = 'Plot of $\\hat{\\beta}$')
dev.off()
它产生必要的 LaTeX 输出,但引入了 {\bfseries $\hat{\beta}$} 的图
。正如示例中所示,当普通字体的数学与粗体文本配对时,这尤其令人不快。我有兴趣从 R 中删除 \bfseries
,因为我需要在 for 循环中生成多个图。
最佳答案
tikzDevice
只是翻译 R 图。在 R 中,标题默认为粗体。您可以使用 font.main = 1
进行更改:
library(tikzDevice)
tikz(file = 'example.tex', standAlone = TRUE)
plot(1, font.main = 1, main = 'Plot of $\\hat{\\beta}$')
dev.off()
关于r - tikzDevice 主标题不带粗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51977721/