1

I recently upgraded from TexLive 2016 to TexLive 2017. After the upgrade, \includegraphics now throws an "Undefined control sequence" error—but only if I typeset with XeLaTeX... It works without issue under regular LaTeX. It also works fine under XeLaTeX if I switch back to TeXLive 2016.

I've tried:

  • Different filetypes
  • Reinstalling graphics/graphicx
  • Different TeX editors/command line

Any help would be very much appreciated.

MWE:

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

Log:

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).
0
5

The undefined command, as shown in the log file you posted is \Gin@log not \includegraphics. Most likely this is because you are using graphics.sty from one installation but a xetex.def from a different place.

You have a local copy of graphics.sty from 1999!!!!

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

and a 2017 copy of the xetex-specific part, 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
2
  • you just want to delete (at least)/Users/abraver/Library/texmf/tex/latex/graphics/ and so use the package that will be installed under /usr/local/texlive/2017/texmf-dist/tex/latex – David Carlisle Sep 13 '17 at 19:50
  • Thanks kindly, @davidcarlisle, that was indeed the issue. – A. Braver Sep 13 '17 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.