![XeLaTeX 无法在命令提示符中加载图片](https://linux22.com/image/395701/XeLaTeX%20%E6%97%A0%E6%B3%95%E5%9C%A8%E5%91%BD%E4%BB%A4%E6%8F%90%E7%A4%BA%E7%AC%A6%E4%B8%AD%E5%8A%A0%E8%BD%BD%E5%9B%BE%E7%89%87.png)
我一直在使用 TeXworks,它运行良好。最近,我正在使用命令提示符测试此行:
xelatex foo.tex
该文件的内容如下:
\documentclass[a4paper,14pt,twoside]{book}
\usepackage{graphicx}
\graphicspath{ {./img/} }
\begin{document}
\includegraphics{38}
\end{document}
这是一个 tex 文件,在 TeXwork(使用 XeLaTeX 编译)上可以完美运行,但无法通过命令提示符运行。错误消息如下:
! Unable to load picture or PDF file './img/38.png'.
有趣的是,我的对应台词是
\includegraphics{38}
所以看起来它确实找到了我的文件“38.png”。
我正在 Win10 工作站上工作。
TeXwork 的工作日志文件:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2018-12-01>
(d:/texlive/2018/texmf-dist/tex/latex/base/book.cls
Document Class: book 2018/09/03 v1.4i Standard LaTeX document class
(d:/texlive/2018/texmf-dist/tex/latex/base/bk10.clo))
(d:/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty
(d:/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty)
(d:/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty
(d:/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty)
(d:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(d:/texlive/2018/texmf-dist/tex/latex/graphics-def/xetex.def)))
LaTeX Warning: Unused global option(s):
[14pt].
(./foo.aux) [1] (./foo.aux) )
Output written on foo.pdf (1 page).
SyncTeX written on foo.synctex.gz.
Transcript written on foo.log.
不工作的日志:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(D:\Documents\LaTex/foo.tex
LaTeX2e <2018-12-01>
(d:/texlive/2018/texmf-dist/tex/latex/base/book.cls
Document Class: book 2018/09/03 v1.4i Standard LaTeX document class
(d:/texlive/2018/texmf-dist/tex/latex/base/bk10.clo))
(d:/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty
(d:/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty)
(d:/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty
(d:/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty)
(d:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(d:/texlive/2018/texmf-dist/tex/latex/graphics-def/xetex.def)))
LaTeX Warning: Unused global option(s):
[14pt].
(D:\Documents\LaTex/foo.aux)
! Unable to load picture or PDF file './img/38.png'.
<to be read again>
}
l.6 \includegraphics{38}
我该如何解决?谢谢!