【问题标题】:LaTeX Error: File `type1cm.sty' not foundLaTeX 错误:找不到文件“type1cm.sty”
【发布时间】:2022-01-23 01:59:25
【问题描述】:

我需要在 MacOS 上从 matplotlib 导出一个没有 type 3 字体的图形。 我发现我必须设置以下rc参数:

    matplotlib.rcParams['pdf.fonttype'] = 42
    matplotlib.rcParams['ps.fonttype'] = 42

但是,我的情节图例仍然是 type 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.

我通过 macports(如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}'

谁能帮帮我?

【问题讨论】:

    标签: matplotlib latex


    【解决方案1】:

    您似乎缺少一个乳胶包装(type1cm)。这可能不是您已经安装的 texlive 或 texlive-latex-extra 软件包的一部分。尝试使用sudo port install texlive-type1cm 安装texlive-type1cm,它应该提供缺少的包。

    【讨论】:

    • 您好,感谢您的回答!不幸的是,如果我尝试安装 texlive-type1cm 我收到错误 Error: Port texlive-type1cm not found
    • 从我这里看到的trac.macports.org/wiki/TeXLivePackages type1cm 应该包含在texlive-latex-extra 中……恐怕我在这里帮不上忙……为了调试,我可能会创建一个独立的乳胶文件并尝试导入该包。
    猜你喜欢
    • 2021-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-06
    • 2014-09-16
    • 2015-05-25
    • 1970-01-01
    相关资源
    最近更新 更多