我需要从matplotlib导出一个在MacOS上没有类型3字体的图形。我发现必须设置以下rc参数:
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
然而,我的情节的图例仍然是3型字体。
所以我试着
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.usetex'] = True
不幸的是,这会产生以下错误消息
RuntimeError: latex was not able to process the following string: b'lp'
Here is the full report generated by latex:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(/Users/FPJ21JY/.matplotlib/tex.cache/a35fe2eb053428dbc0f7479b65fdb72f.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(/usr/local/texlive/2021basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/local/texlive/2021basic/texmf-dist/tex/latex/base/size10.clo))
! LaTeX Error: File `type1cm.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.5 \usepackage
{type1ec}^^M
No pages of output.
Transcript written on a35fe2eb053428dbc0f7479b65fdb72f.log.
我通过macport安装了乳胶(如this thread中所建议的)
sudo port install texlive texlive-latex-extra
然而,问题仍然存在。
在胶乳安装和重新启动我的系统后,我收到以下错误
RuntimeError: latex was not able to process the following string:
b'\\n\\\\begin{figure}\\n \\\\centering\\\\leavevmode\\n \\\\psfrag{psmarker0}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 20 %}}\\n\\\\psfrag{psmarker1}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 40 %}}\\n\\\\psfrag{psmarker2}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 60 %}}\\n\\\\psfrag{psmarker3}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 80 %}}\\n\\\\psfrag{psmarker4}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 100 %}}\\n\\\\psfrag{psmarker5}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily Training Progress}}\\n\\\\psfrag{psmarker6}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 0 %}}\\n\\\\psfrag{psmarker7}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 20 %}}\\n\\\\psfrag{psmarker8}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 40 %}}\\n\\\\psfrag{psmarker9}[bl][bl][1][0.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily 60 %}}\\n\\\\psfrag{psmarker10}[bl][bl][1][90.000000]{\\\\fontsize{8.000000}{10.000000}\\\\color[rgb]{0.150,0.150,0.150} {\\\\sffamily Accuracy of the adversary network}}\\n \\\\includegraphics*[angle=0]{/private/var/folders/dh/pdrb38k971x8m88wytxg4klw0000gq/T/tmp_0z8vuur/tmp.ps}\\n\\\\end{figure}'
有人能帮帮我吗?
发布于 2021-12-21 17:43:04
您似乎缺少了一个乳胶包(type1cm)。这可能不是你已经安装的文本生活或文本乳胶包的一部分。尝试使用texlive-type1cm
安装sudo port install texlive-type1cm
,这将提供缺少的包。
发布于 2022-04-27 20:52:21
试着安装两个‘文本-乳胶-额外’和‘厘米-超级’。
https://stackoverflow.com/questions/70438972
复制相似问题