首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >LaTeX错误:未找到文件`type1cm.sty‘

LaTeX错误:未找到文件`type1cm.sty‘
EN

Stack Overflow用户
提问于 2021-12-21 16:55:32
回答 2查看 1.6K关注 0票数 0

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

代码语言:javascript
运行
复制
    matplotlib.rcParams['pdf.fonttype'] = 42
    matplotlib.rcParams['ps.fonttype'] = 42

然而,我的情节的图例仍然是3型字体。

所以我试着

代码语言:javascript
运行
复制
    matplotlib.rcParams['ps.useafm'] = True
    matplotlib.rcParams['pdf.use14corefonts'] = True
    matplotlib.rcParams['text.usetex'] = True

不幸的是,这会产生以下错误消息

代码语言:javascript
运行
复制
    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中所建议的)

代码语言:javascript
运行
复制
sudo port install texlive texlive-latex-extra

然而,问题仍然存在。

在胶乳安装和重新启动我的系统后,我收到以下错误

代码语言:javascript
运行
复制
    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}'

有人能帮帮我吗?

EN

回答 2

Stack Overflow用户

发布于 2021-12-21 17:43:04

您似乎缺少了一个乳胶包(type1cm)。这可能不是你已经安装的文本生活或文本乳胶包的一部分。尝试使用texlive-type1cm安装sudo port install texlive-type1cm,这将提供缺少的包。

票数 0
EN

Stack Overflow用户

发布于 2022-04-27 20:52:21

试着安装两个‘文本-乳胶-额外’和‘厘米-超级’。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70438972

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档