LyX,在 Ubuntu 下将 PDF 转换为可加载格式时出错

LyX,在 Ubuntu 下将 PDF 转换为可加载格式时出错

我有与报告相同的问题Lyx,转换为可加载 PDF 格式时出错但我使用的是 Ubuntu 18.04,并且仅针对 Windows 和 MacOS 描述了解决方案。

如果我从命令行运行 LyX,则会出现以下 stderr 消息:

convert-im6.q16: not authorized `/tmp/lyx_tmpdir.mJCcewM29047/gconverts29047.eps' @ error/constitute.c/ReadImage/412.
convert-im6.q16: no images defined `/tmp/lyx_tmpdir.mJCcewM29047/gconverts29047.png' @ error/convert.c/ConvertImageCommand/3258.

LyX wiki 解决方案https://wiki.lyx.org/LyX/FiguresInLyX也不适用,因为我的版本是:

ImageMagick 6.9.7-4

Ghostscript 9.25 (2018-09-13)

我的/etc/ImageMagick-6/policy.xml样子是:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
<!--
...(comments excised for brevity)...
-->
<policymap>
  <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> 
-->
  <policy domain="resource" name="memory" value="256MiB"/>
  <policy domain="resource" name="map" value="512MiB"/>
  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
  <policy domain="resource" name="area" value="128MB"/>
  <policy domain="resource" name="disk" value="1GiB"/>
  <!-- <policy domain="resource" name="file" value="768"/> -->
  <!-- <policy domain="resource" name="thread" value="4"/> -->
  <!-- <policy domain="resource" name="throttle" value="0"/> -->
  <!-- <policy domain="resource" name="time" value="3600"/> -->
  <!-- <policy domain="system" name="precision" value="6"/> -->
  <!-- not needed due to the need to use explicitly by mvg: -->
  <!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
  <!-- use curl -->
  <policy domain="delegate" rights="none" pattern="URL" />
  <policy domain="delegate" rights="none" pattern="HTTPS" />
  <policy domain="delegate" rights="none" pattern="HTTP" />
  <!-- in order to avoid to get image with password text -->
  <policy domain="path" rights="none" pattern="@*"/>
  <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/>
  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="EPI" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
  <policy domain="coder" rights="read|write" pattern="LABEL" />
</policymap>

答案1

解决方案是编辑 ImageMagick 的policy.xml文件。尽管我提供给 LyX 的是 PDF,而 LyX 最终得到的是 PNG,但它缺少 EPS (PS) 的权限。

因此,/etc/ImageMagick-6/policy.xml我改变了

<policy domain="coder" rights="none" pattern="PS" />

<policy domain="coder" rights="read|write" pattern="PS" />

诊断全都感谢@ScottKosty;请参阅我的问题后面的评论。

相关内容