无法在 LuaLaTex (MikTeX) 中包含 SVG 图像

无法在 LuaLaTex (MikTeX) 中包含 SVG 图像

我在将 .svg 图像包含到文档中时遇到了问题(我在 Windows 10 上使用 MikTeX)。我在这里找到了相关的问答,我想我知道需要采取哪些步骤才能导入 svg 图像:

  • 我在 PATH 中有 inkscape
  • 我添加了--shell-escape--write18选项(都试过了)

这些是我的设置:

设置

我复制粘贴了以下示例这个答案

\documentclass{article}
\usepackage{svg}
\usepackage{amsmath}
\begin{document}

\begin{figure}[htbp]
  \centering
  \includesvg{image}
  \caption{svg image}
\end{figure}

\end{document}

但我仍然收到此错误:

This is LuaHBTeX, Version 1.12.0 (MiKTeX 20.12)
 restricted system commands enabled.
(./test.tex
LaTeX2e <2020-10-01> patch level 2

 L3 programming layer <2020-12-07> xparse <2020-03-03>
("C:/Program Files/MiKTeX/tex/latex/base/article.cls"
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
("C:/Program Files/MiKTeX/tex/latex/base/size10.clo"))
("C:/Program Files/MiKTeX/tex/latex/svg/svg.sty"
("C:/Program Files/MiKTeX/tex/generic/iftex/iftex.sty")
("C:/Program Files/MiKTeX/tex/latex/koma-script/scrbase.sty"
("C:/Program Files/MiKTeX/tex/latex/koma-script/scrlfile.sty"
("C:/Program Files/MiKTeX/tex/latex/koma-script/scrlfile-hook.sty"
("C:/Program Files/MiKTeX/tex/latex/koma-script/scrlogo.sty")))
("C:/Program Files/MiKTeX/tex/latex/graphics/keyval.sty"))
("C:/Program Files/MiKTeX/tex/generic/pdftexcmds/pdftexcmds.sty"
("C:/Program Files/MiKTeX/tex/generic/infwarerr/infwarerr.sty")
("C:/Program Files/MiKTeX/tex/generic/ltxcmds/ltxcmds.sty"))
("C:/Program Files/MiKTeX/tex/latex/trimspaces/trimspaces.sty")
("C:/Program Files/MiKTeX/tex/latex/graphics/graphicx.sty"
("C:/Program Files/MiKTeX/tex/latex/graphics/graphics.sty"
("C:/Program Files/MiKTeX/tex/latex/graphics/trig.sty")
("C:/Program Files/MiKTeX/tex/latex/graphics-cfg/graphics.cfg")
("C:/Program Files/MiKTeX/tex/latex/graphics-def/luatex.def")))
("C:/Program Files/MiKTeX/tex/latex/tools/shellesc.sty"))
("C:/Program Files/MiKTeX/tex/latex/xcolor/xcolor.sty"
("C:/Program Files/MiKTeX/tex/latex/graphics-cfg/color.cfg"))
("C:/Program Files/MiKTeX/tex/latex/transparent/transparent.sty"
("C:/Program Files/MiKTeX/tex/latex/auxhook/auxhook.sty"))
("C:/Program Files/MiKTeX/tex/latex/pgf/systemlayer/pgfsys.sty"
("C:/Program Files/MiKTeX/tex/latex/pgf/utilities/pgfrcs.sty"
("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfutil-common.tex"
("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfutil-common-lists.tex"))
 ("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfutil-latex.def")
("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfrcs.code.tex"
("C:/Program Files/MiKTeX/tex/generic/pgf/pgf.revision.tex")))
("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgfsys.code.tex"
("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfkeys.code.tex"
("C:/Program Files/MiKTeX/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex"))
("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgf.cfg")
("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgfsys-luatex.def"
("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def")))
 ("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex"
) ("C:/Program Files/MiKTeX/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
")) ("C:/Program Files/MiKTeX/tex/latex/amsmath/amsmath.sty"
For additional information on amsmath, use the `?' option.
("C:/Program Files/MiKTeX/tex/latex/amsmath/amstext.sty"
("C:/Program Files/MiKTeX/tex/latex/amsmath/amsgen.sty"))
("C:/Program Files/MiKTeX/tex/latex/amsmath/amsbsy.sty")
("C:/Program Files/MiKTeX/tex/latex/amsmath/amsopn.sty"))
("C:/Program Files/MiKTeX/tex/latex/l3backend/l3backend-luatex.def")
(./test.aux) ("C:/Program Files/MiKTeX/tex/latex/base/ts1cmr.fd")
("C:/Program Files/MiKTeX/tex/context/base/mkii/supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:/Program Files/MiKTeX/tex/latex/epstopdf-pkg/epstopdf-base.sty"
("C:/Program Files/MiKTeX/tex/latex/grfext/grfext.sty"
("C:/Program Files/MiKTeX/tex/generic/kvdefinekeys/kvdefinekeys.sty"))
("C:/Program Files/MiKTeX/tex/latex/kvoptions/kvoptions.sty"
("C:/Program Files/MiKTeX/tex/generic/kvsetkeys/kvsetkeys.sty")))

Package svg Warning: You didn't enable `shell escape' (or `write18')
(svg)                so it wasn't possible to launch the Inkscape export
(svg)                for `image.svg' on input line 8.


! Package svg Error: File `image_svg-tex.pdf' is missing.

See the svg package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8   \includesvg{image}
                      
? 

image.svg在与 tex 文档相同的文件夹中有一个文件。我需要它来与 LuaLaTeX 配合使用,但我也尝试了 pdfLaTeX,得到了同样的错误...编译器抱怨我didn't enable 'shell escape' (or 'write18'),那么我做错了什么?我是否违反了设置中的语法?

相关内容