latex编译过程-关于嵌入所有字体

我们的初始目的是想在编译的过程中嵌入所有字体

参考

我们进行了设置,但是不起作用,后发现使用pdflatex编译时是不会调用 ps2pdf的

然后,我们就需要了解编译过程

 

1. 通常,我们使用texstudio,只需要简单的按一下编译按钮,就可以完成整个包括bib的编译。但是,实际上这个按钮后面有一系列的动作。

2.假设我们自己在cmd命令行里使用pdflatex从头编译一个tex源文件,需要以下步骤(其中xxx是tex源文件名)

    (1)pdflatex   xxx                      生成xxx.aux以及pdf文件,但是这时pdf文件没有ref条目,正文的引用全是问号

    (2)bixtex    xxx        需要xxx.aux并生成bib相关文件

    (3)pdflatex xxx        在pdf里面加入了ref的条目,但是正文内容引用仍然是问号

    (4)pdflatex  xxx        这一步将问号全替换为了正确的ref条目编号

3. 除了使用pdflatex,还可以使用编译链对tex文件进行编译,  

参考https://guides.lib.wayne.edu/latex/compiling

 

      latex    xxx

发现编译不过

https://tex.stackexchange.com/questions/287140/how-to-include-pdf-image-in-latex/287143  使用latex编译图片必须是ps或eps,不能是pdf版的

 

4. 这里说加入相应字体的包https://latex.org/forum/viewtopic.php?t=193

可以编译通过,但是仍然不解决问题。后来在hotcrp上上传,然后检查格式,出现以下信息

This document violates the final version requirements. Errors are:

  • Missing font: “Helvetica” not embedded, first referenced on page 3.
  • Missing font: “ZapfDingbats” not embedded, first referenced on page 4.
  • Bad font: Type3 font “DejaVuSans” first referenced on page 9.

Final versions that violate the requirements will not be accepted. However, the automated format checker uses heuristics and can make mistakes, especially on figures.

The boldface errors are serious and must be fixed immediately. HotCRP can try to embed the missing fonts for you. Download this document and check it for errors; if it looks good, upload it as the new final version: [PDF] Final version with embedded fonts

而第三页是用R生成的一个pdf图,第9页是用python生成的一个pdf图。因此,可以推测是图片问题。打开对应图片看字体,的确是。而page4上的pdf图既缺少Helvetica也缺少ZapfDingbats

 

 

5. 于是思路变为,将对应的图片字符集嵌进入,也可以解决问题了。

cmd里 使用命令  ps2pdf  -dPDFSETTINGS#/prepress  fig_no_embedded.pdf    fig_embedded.pdf

其他命令pdf13 pdf14等对应不同的adobe版本

注意红体字部分,是#不是=,很多回答使用=是编译不过的。

 

新问题:对python生成的图使用该命令后,原来的字体没有了,嵌入了很多新字体。虽然字体都是嵌入状态,但是字变成点状字了,有锯齿,无能放大扩展,包括图片部件也是。

参考https://stackoverflow.com/questions/9054884/how-to-embed-fonts-in-pdfs-produced-by-matplotlib

matplotlib.rc('pdf', fonttype=42)  可解决
 
 

posted on 2018-08-26 10:58  longbigfish  阅读(1180)  评论(0编辑  收藏  举报

导航