自搭Overleaf无法编译IEEE模板的解决方法 2022-05-18 日常 暂无评论 861 次阅读 在自搭的Overleaf上编译不了IEEE模板。编译日志在:overleaf根目录/data/sharelatex/data/compiles/项目号/output.log >编译日志后几行 >``` >LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <9> not available >(Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. >! Font OT1/ptm/bx/n/9=ptmb7t at 9.0pt not loadable: Metric (TFM) file not found >. > > relax >l.1090 \@IEEEtunefonts > >I wasn't able to read the size data for this font, >so I will ignore the font specification. >[Wizards can fix TFM files using TFtoPL/PLtoTF.] >You might try inserting a different font spec; >e.g., type `I\font='. > >! Font \OT1/ptm/b/n/9=nullfont not loadable: Metric (TFM) file not found. > > \relax >l.1090 \@IEEEtunefonts > >I wasn't able to read the size data for this font, >so I will ignore the font specification. >[Wizards can fix TFM files using TFtoPL/PLtoTF.] >You might try inserting a different font spec; >e.g., type `I\font='. > >! Font OT1/ptm/m/it/9=ptmri7t at 9.0pt not loadable: Metric (TFM) file not foun >d. > > relax >l.1090 \@IEEEtunefonts > >I wasn't able to read the size data for this font, >so I will ignore the font specification. >[Wizards can fix TFM files using TFtoPL/PLtoTF.] >You might try inserting a different font spec; >e.g., type `I\font='. > >LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <9> not available >(Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. > >! Font OT1/ptm/bx/it/9=ptmbi7t at 9.0pt not loadable: Metric (TFM) file not fou >nd. > > relax >l.1090 \@IEEEtunefonts > >I wasn't able to read the size data for this font, >so I will ignore >``` 日志最后说“找不到字体”,中间反复出现“找不到Metric (TFM).” ## 解决方法 安装字体(在宿主机装,不是在overleaf容器装) 1. 安装字体工具,过程中会出现协议,需要输入yes继续 ``` sudo apt-get install texlive-fonts-recommended ``` 2. 让字体生效 ``` fc-cache ``` ## 在容器安装字体 1. 进入overleaf容器 ``` docker exec -it sharelatex /bin/bash ``` 2. 修改软件源(用`cat /etc/issue`看到操作系统是ubuntu 18.04的,版本代号bionic) ``` mv /etc/apt/sources.list /etc/apt/sources.list.bak echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" >/etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse" >>/etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse" >>/etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >>/etc/apt/sources.list apt-get update ``` 3. 安装字体工具,过程中会出现协议,需要输入yes继续 ``` apt install texlive-fonts-recommended ``` 4. 让字体生效 ``` fc-cache ``` 再次编译,终于不是字体问题了,但有新的报错:`! LaTeX Error: File 'cite.sty' not found.` ## 1. 进入容器 ``` docker exec -it sharelatex /bin/bash ``` 2. 配置tlmgr ``` apt install xzdec cd ~ tlmgr init-usertree ``` 3.升级tlmgr ``` cd usr/local/texlive wget http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh sh update-tlmgr-latest.sh -- --upgrade ``` ## 相关链接 - [Overleaf - Github](https://github.com/overleaf/overleaf) - [IEEE 模板](https://www.ieee.org/conferences/publishing/templates.html) - [在Linux(Ubuntu)下安装Arial、Times New Roman等字体](https://www.cnblogs.com/xia-weiwen/p/10336896.html) - [Metric (TFM) file not found](https://github.com/jgrassler/mkdocs-pandoc/issues/1) - [部署自己的overleaf,告别龟速外网](https://www.modb.pro/db/142079) 标签: none 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭