\includegraphics 在 XeLaTeX 中未定义,但在 TexLive 2017 中的 LaTeX 中定义正常

\includegraphics 在 XeLaTeX 中未定义,但在 TexLive 2017 中的 LaTeX 中定义正常

我最近从 TexLive 2016 升级到了 TexLive 2017。升级后,\includegraphics 现在会抛出“未定义控制序列”错误 — 但只有当我使用 XeLaTeX 排版时才会出现这种情况... 在常规 LaTeX 下,它运行正常。如果我切换回 TeXLive 2016,它在 XeLaTeX 下也能正常工作。

我试过了:

  • 不同的文件类型
  • 重新安装 graphics/graphicx
  • 不同的 TeX 编辑器/命令行

任何帮助都将非常感激。

梅威瑟:

\documentclass[letterpaper,12pt]{article}
\usepackage{graphicx}
\begin{document}
    Hello world
    \includegraphics{test.png}
\end{document}

日志:

This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex 2017.9.11)  13 SEP 2017     14:22
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**/Users/abraver/Desktop/tmp/textest/untitled.tex
(/Users/abraver/Desktop/tmp/textest/untitled.tex
LaTeX2e <2017-04-15>
Babel <3.12> and hyphenation patterns for 84 language(s) loaded.
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (/Users/abraver/Library/texmf/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
(/Users/abraver/Library/texmf/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
) (/Users/abraver/Library/texmf/tex/latex/graphics/graphics.sty
Package: graphics 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
(/Users/abraver/Library/texmf/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
) (/usr/local/texlive/2017/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: xetex.def on input line 90.
(/usr/local/texlive/2017/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2017/06/24 v5.0h Graphics/color driver for xetex
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
) (/Users/abraver/Desktop/tmp/textest/untitled.aux)
\openout1 = `untitled.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
File: test.png Graphic file (type bmp)
! Undefined control sequence.
\Ginclude@bmp #1->\Gin@log 
                           {<#1>}\bgroup \def \@tempa {!}\special {pdf:image...
l.12 \includegraphics{test.png}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


Overfull \hbox (161.9937pt too wide) in paragraph at lines 12--13
[][] 
 []

[1

] (/Users/abraver/Desktop/tmp/textest/untitled.aux) ) 
Here is how much of TeX's memory you used:
 568 strings out of 492998
 7215 string characters out of 6134491
 66519 words of memory out of 5000000
 4607 multiletter control sequences out of 15000+600000
 3648 words of font info for 15 fonts, out of 8000000 for 9000
 1348 hyphenation exceptions out of 8191
 25i,4n,19p,220b,107s stack positions out of 5000i,500n,10000p,200000b,80000s

Output written on /Users/abraver/Desktop/tmp/textest/untitled.pdf (1 page).

答案1

您发布的日志文件中显示的未定义命令不是\Gin@log\includegraphics这很可能是因为您使用的是graphics.sty来自一个安装的命令,但使用的是xetex.def来自另一个位置的命令。

您有 1999 年的 graphics.sty 的本地副本!!!!

/Users/abraver/Library/texmf/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

以及 2017 年 xetex 特定部分的副本,xetex.def

/usr/local/texlive/2017/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2017/06/24 v5.0h Graphics/color driver for xetex

相关内容