gpt4 book ai didi

R Sweave Computer Modern 字体使用

转载 作者:行者123 更新时间:2023-12-04 11:54:30 25 4
gpt4 key购买 nike

我已经安装了 R 包 extrafontfontcm .然后尝试在 Sweave 中使用 Computer Modern 字体绘制数据:

<<test,fig=TRUE,echo=False>>=
plot(na, family="CM Roman")
@

但它失败并出现错误:
> grDevices::pdf.options(useDingbats = FALSE); utils::Sweave('test.Rnw', encoding='UTF-8')
Writing to file test.tex
Processing code chunks with options ...
1 : echo keep.source term verbatim (test.Rnw:76)
2 : keep.source term verbatim pdf (label = test, test.Rnw:80)

Error: chunk 2 (label = test)
Error in axis(side = side, at = at, labels = labels, ...) :
invalid font type
In addition: Warning messages:
1: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
2: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
3: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
4: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
5: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
6: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
7: In axis(side = side, at = at, labels = labels, ...) :
font family 'CM Roman' not found in PostScript font database
Error in rle(filenames) : 'x' must be an atomic vector
Calls: <Anonymous> -> <Anonymous> -> RweaveTryStop
Execution halted
loadfonts(device="postscript")显示字体为 already registered with postscriptFonts()
我如何将它与 Sweave 一起使用?

最佳答案

您确定您使用的是正确的名称吗?试试这个,看看结果是否有用:

> names(postscriptFonts() )
[1] "serif" "sans" "mono" "AvantGarde"
[5] "Bookman" "Courier" "Helvetica" "Helvetica-Narrow"
[9] "NewCenturySchoolbook" "Palatino" "Times" "URWGothic"
[13] "URWBookman" "NimbusMon" "NimbusSan" "URWHelvetica"
[17] "NimbusSanCond" "CenturySch" "URWPalladio" "NimbusRom"
[21] "URWTimes" "ComputerModern" "ComputerModernItalic" "Japan1"
[25] "Japan1HeiMin" "Japan1GothicBBB" "Japan1Ryumin" "Korea1"
[29] "Korea1deb" "CNS1" "GB1"

在审查时,我看到 pdf.options 参与其中,您可能还需要检查:
 > names( pdfFonts() )

关于R Sweave Computer Modern 字体使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16090580/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com