XeLaTeX 无法在命令提示符中加载图片

XeLaTeX 无法在命令提示符中加载图片

我一直在使用 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}

我该如何解决?谢谢!

相关内容