Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

插入EPS图片导致编译错误(ghostscript) #82

Closed
YanlongLi opened this issue Nov 6, 2015 · 10 comments
Closed

插入EPS图片导致编译错误(ghostscript) #82

YanlongLi opened this issue Nov 6, 2015 · 10 comments

Comments

@YanlongLi
Copy link
Contributor

当运行xelatex thesis的时候编译报错,错误信息如下

(/usr/share/texmf-dist/tex/latex/listings/lstmisc.sty) [11]) [12]
(./tex/chapter03.tex
第三章
Error: /typecheck in resourcestatus
Operand stack:
   false   ct_StyleDicts   --dict:0/4(L)--   Adobe-Japan1   --dict:0/4(L)--   Serif   HeiseiMin-W3-83pv-RKSJ-H   Font   HeiseiMin-W3-83pv-RKSJ-H   (HeiseiMin-W3-83pv-RKSJ-H)   true   --nostringval--   --nostringval--   0
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1977   1   3   %oparray_pop   1976   1   3   %oparray_pop   --nostringval--   1960   1   3   %oparray_pop   1852   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1931   8   8   %oparray_pop
Dictionary stack:
   --dict:1202/1684(ro)(G)--   --dict:0/20(G)--   --dict:88/200(L)--   --dict:57/75(L)--   --dict:2/10(L)--   --dict:39/70(L)--   --dict:0/4(L)--   --dict:0/4(L)--   --dict:17/17(ro)(G)--
Current allocation mode is local
Current file position is 91048
GPL Ghostscript 9.18: Unrecoverable error, exit code 1
[13
xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.

系统环境:

  • archlinux
  • texlive 2015
  • TeX Gyre Font西文字体和Adobe四款中文字体已安装
@weijianwen
Copy link
Collaborator

怎么会引用到Adobe-Japan1HeiseiMin-W3这些日文编码区域的东西?你确定你编译的是sjtuthesis附带的示例文档,没有对其内容进行过编辑?

@YanlongLi
Copy link
Contributor Author

我是clone下来以后直接编译的,没有做过任何修改。我把texlive重新安装以后还是不行。
以下是完整的log.

http://bl.ocks.org/YanlongLi/93efed3928fac9b62390

@weijianwen
Copy link
Collaborator

我在 MacTeX 上不能重现这个问题,在编译日志中也没有看到调用ghostscript。我担心是ghostscript的问题,使用ghostscript /typecheck error在Google搜索能找到不少类似条目。

http://www.cnblogs.com/atison/p/3480092.html

建议再进一步确定是哪一段代码触发该问题:

  1. 注释正文第11页用lstlist插入的两段代码;
  2. 注释插入PDF和EPS图片(有字型嵌入);

@YanlongLi
Copy link
Contributor Author

注释掉包含eps文件的代码后能够正常编译,问题是出在gs转换eps文件的时候,同时我用gs转换esp文件时候报如上的错误。

@weijianwen
Copy link
Collaborator

我这边gs版本是:

$ gs -v
GPL Ghostscript 9.16 (2015-03-30)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.

请问用gs转换eps操作是用了哪个命令?

@YanlongLi
Copy link
Contributor Author

$ gs -v
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.

转换用的ps2pdf命令,用gs命令也无法打开文件sjtulogo.eps。报的错误是一样的。
找了另外一个eps文件转换没有问题。
怀疑是不是我这个版本的ghostscript的bug。

@weijianwen
Copy link
Collaborator

好的,临时解决方案是不插入EPS图,尽可能用PDF或者其他格式替代,待ghostscript更新后看这个问题是否还存在。

这个issue我先关了。

@YanlongLi
Copy link
Contributor Author

嗯。应该是这个bug,
ghostscript fails on some EPS files
我这里安装完整的texlive-lang包还是不行,反正就是eps文件字体的原因。先暂时用pdf替代吧。

@weijianwen
Copy link
Collaborator

最近升级以后,我在 Mac OS X 下也踩到了这个坑,编译的错误提示是:

GPL Ghostscript 9.16: Can't find initialization file gs_init.ps.
xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.

临时的解决办法就是不插入EPS文件。考虑到EPS文件受众面越小,后面就干脆不要给插入EPS图片的例子了。

@weijianwen weijianwen reopened this Dec 10, 2015
@weijianwen weijianwen changed the title xelatex thesis 编译报错 插入EPS图片导致编译错误(ghostscript) Dec 10, 2015
@billryan
Copy link
Contributor

@YanlongLi
TeX 下使用 EPS 插图估计是上古时代的用法了,历史遗留问题。

插图首推 PDF, 其次如 png 等,如果遇到非 PDF/png 等图片,先转换下,Windows 下虚拟打印(Foxit Reader/CUPS-PDF)输出 PDF 即可,Linux/OS X 下可使用 imagemagick, Matlab/matplotlib 等最好设置直接输出 PDF.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants