由于错误的 $$o 和 $$i 变量导致 LyX 中的 epstopdf 错误

由于错误的 $$o 和 $$i 变量导致 LyX 中的 epstopdf 错误

我遇到了 LyX 无法将我的文件从 PostScript 转换为 PDF 的问题。我使用的是 Ubuntu 20.04,但这个问题在 Ubuntu 19.10 中也存在,当时我不需要该功能。假设我的文件路径是“~/home/path/to/file/my graph.eps”。当我尝试编译该文件时,系统显示以下消息:

An error occurred while running:
epstopdf
--outfile="0_home_path_to_file_my_graph.pdf"
"0_home_path_to_file_my_graph.eps"

进而

! Package pdftex.def Error: 
File `0_home_path_to_file_my_graph.pdf' 
not found: using draft setting.

我认为问题在于所有'\'' '字符都会转换为下划线'_',除非出于某种原因以不同的方式打印错误消息。

这里的解决方案是什么?我真的不想每次编辑图像时都手动转换所有图像。

谢谢,

德米特里。

答案1

不清楚您是在说您无法在生成的 PDF 中看到图像,还是在 Lyx 中看不到图像。我也遇到了同样的错误。我怀疑可能是因为 Lyx(和 TexLive)安装在 /usr/share 中,而我的用户在那里没有写权限。为了测试这一点,我运行sudo lyx并得到了以下输出:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
convert-im6.q16: not authorized `/tmp/lyx_tmpdir.BlzYGbBd8709/gconverthz8709.eps' @ error/constitute.c/ReadImage/412.
convert-im6.q16: no images defined `/tmp/lyx_tmpdir.BlzYGbBd8709/gconverthz8709.png' @ error/convert.c/ConvertImageCommand/3258.
env: ‘epstopdf’: No such file or directory
support/Systemcall.cpp (291): Systemcall: 'epstopdf --outfile="32_usr_share_lyx_doc_clipart_mobius.pdf" "32_usr_share_lyx_doc_clipart_mobius.eps"' finished with exit code 127
Error: Cannot convert file
----------------------------------------
An error occurred while running:
epstopdf --outfile="32_usr_share_lyx_doc_clipart_mobius.pdf"
"32_usr_share_lyx_doc_clipart_mobius.eps"

env: 'epstopdf': No such file or directory提示我,我实际上缺少该程序/脚本。我已经完成了sudo tlmgr install epstopdf-pkg,但显然没有在我的路径中的任何位置安装脚本(即/usr/bin)。

一旦我下载了来源并手动安装它,文档将编译,我可以看到 pdf 中的图像。我仍然在 Lyx 中收到屏幕显示错误,但我没有收到有关 epstopdf 错误的弹出对话框。有些事情仍然不对劲,但也许这有点帮助。

相关内容