用 overleaf 生成 PDF/A 遇到 Type 3 font 等问题的解决办法

有些国际上的学术会议要求用 PDF/A 格式提交。
如果工具链是 Win10 + overleaf + Pyplot 那么你有可能遇到如下问题:

  1. 常见的 PDF/A 格式生成教程,与 overleaf 许多模板使用的编译器(LaTeX编译器)冲突,因为这些教程使用的是 pdfLaTeX;
  2. 用 Acrobat 等工具强行转换 pdf 到 PDF/A 格式,出现多个失败报错,其中包括发现有内容使用了 Type 3 font type,通常是某些图片使用了非矢量的字体;仔细检查可以发现,这是 Pyplot 生成的 eps 文件在 LaTeX 生成 pdf 的过程中自动使用了位图字体(即使我已经设置了 fonttype=42),而且是仅有部分字符使用了位图字体(我出现的是 ‘2’, ‘5’)
  3. 在 overleaf 中切换编译器到 pdfLaTeX,发现某些 eps 柱状图中,居然会丢失一部分 bar;

还有些奇怪的问题,此处不一一列举了。
解决方案是:

  1. 用 pyplot 按 pdf 格式生成图片,保证图片中的所有字符都是矢量的;
  2. 在 overleaf 中用 pdfLatex 编译,否则上述 pdf 格式的图片 可能报错 no bounding size;
  3. 生成的 pdf 本身还不属于 PDF/A,但应保证没有位图字体(可放大查看图片中小字符是否有锯齿),此时使用 Acrobat 或其他工具转化(建议到 PDF/A-2b 稍微宽松些),即可成功
Initial Win CP for (console input, console output, system): (CP936, CP936, CP936) I changed them all to CP936 Rc files read: NONE Latexmk: This is Latexmk, John Collins, 27 Dec. 2024. Version 4.86a. No existing .aux file, so I&#39;ll make a simple one, and require run of *latex. Latexmk: applying rule &#39;pdflatex&#39;... Rule &#39;pdflatex&#39;: Reasons for rerun Category &#39;other&#39;: Rerun of &#39;pdflatex&#39; forced or previously required: Reason or flag: &#39;Initial setup&#39; ------------ Run number 1 of rule &#39;pdflatex&#39; ------------ ------------ Running &#39;pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:/Users/91643/Downloads/CS_structure/template/document.tex"&#39; ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (c:/Users/91643/Downloads/CS_structure/template/document.tex LaTeX2e <2024-11-01> patch level 2 L3 programming layer <2025-01-18> (./bistuthesis.cls Document Class: bistuthesis 2024/01/01 BISTU Thesis Template (c:/texlive/2025/texmf-dist/tex/latex/tools/array.sty) (c:/texlive/2025/texmf-dist/tex/latex/arydshln/arydshln.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjustbox.sty (c:/texlive/2025/texmf-dist/tex/latex/xkeyval/xkeyval.sty (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkeyval.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/xkvutils.tex (c:/texlive/2025/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/adjcalc.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/trimclip.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def))) (c:/texlive/2025/texmf-dist/tex/latex/collectbox/collectbox.sty) (c:/texlive/2025/texmf-dist/tex/latex/adjustbox/tc-pdftex.def)) (c:/texlive/2025/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty) (c:/texlive/2025/texmf-dist/tex/latex/varwidth/varwidth.sty)) (c:/texlive/2025/texmf-dist/tex/latex/tools/tabularx.sty) (c:/texlive/2025/texmf-dist/tex/latex/multirow/multirow.sty) (c:/texlive/2025/texmf-dist/tex/latex/tools/calc.sty) (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amssymb.sty (c:/texlive/2025/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (c:/texlive/2025/texmf-dist/tex/latex/ragged2e/ragged2e.sty) (c:/texlive/2025/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexbook.cls (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (c:/texlive/2025/texmf-dist/tex/latex/l3kernel/expl3.sty (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)) Document Class: ctexbook 2022/07/14 v2.5.10 Chinese adapter for class book (CTEX) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexhook.sty) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexpatch.sty) (c:/texlive/2025/texmf-dist/tex/latex/base/fix-cm.sty (c:/texlive/2025/texmf-dist/tex/latex/base/ts1enc.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (c:/texlive/2025/texmf-dist/tex/latex/base/book.cls Document Class: book 2024/06/29 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/bk10.clo)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJKutf8.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/ifpdf.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty)) (c:/texlive/2025/texmf-dist/tex/latex/base/inputenc.sty) (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJK.sty (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/mule/MULEenc.sty) (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJK.enc)) (c:/texlive/2025/texmf-dist/tex/latex/base/fontenc.sty)) (c:/texlive/2025/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty (c:/texlive/2025/texmf-dist/tex/latex/cjkpunct/CJKpunct.spa)) (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJKspace.sty) (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.bdg) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctexspa.def)) (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber.sty (c:/texlive/2025/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/ctex-c5size.clo) (c:/texlive/2025/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def)) (c:/texlive/2025/texmf-dist/tex/latex/ctex/config/ctex.cfg) (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty (c:/texlive/2025/texmf-dist/tex/latex/cjk/texinput/CJKulem.sty (c:/texlive/2025/texmf-dist/tex/generic/ulem/ulem.sty))) (c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.sty (c:/texlive/2025/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) c:/texlive/2025/texmf-dist/tex/latex/fontspec/fontspec.sty:101: Fatal Package fontspec Error: The fontspec package requires either XeTeX or (fontspec) LuaTeX. (fontspec) (fontspec) You must change your typesetting engine to, (fontspec) e.g., "xelatex" or "lualatex" instead of (fontspec) "latex" or "pdflatex". Type <return> to continue. ... l.101 \msg_fatal:nn {fontspec} {cannot-use-pdftex} Latexmk: Getting log file &#39;document.log&#39; Latexmk: Examining &#39;document.fls&#39; Latexmk: Examining &#39;document.log&#39; Latexmk: Errors, so I did not complete making targets Latexmk: Sometimes, the -f option can be used to get latexmk to try to force complete processing. But normally, you will need to correct the file(s) that caused the error, and then rerun latexmk. In some cases, it is best to clean out generated files before rerunning latexmk after you&#39;ve corrected the files. Collected error summary (may duplicate other messages): pdflatex: Command for &#39;pdflatex&#39; gave return code 1 Refer to &#39;document.log&#39; and/or above output for details C:\texlive\2025\bin\windows\runscript.tlu:922: command failed with exit code 12: perl.exe c:\texlive\2025\texmf-dist\scripts\latexmk\latexmk.pl -synctex=1 -interaction=nonstopmode -file-line-error -pdf -outdir=c:/Users/91643/Downloads/CS_structure/template c:/Users/91643/Downloads/CS_structure/template/document 报错是什么原因?
最新发布
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值