4

I have been using \includegraphics with plain TeX without problems until yesterday, when I updated TeXLive and wrote (minimal)

\input miniltx
\input graphicx.sty
\includegraphics{espec.png}
\bye

The compilation showed

! Undefined control sequence.
\Ginclude@graphics ...\Ginput@path \set@curr@file 
                                                  {#1}\edef \uq@curr@file {\...

\Gin@ii ...eys {Gin}{#1}\Gin@esetsize \the \toks@ 
                                                  \endgroup \fi 
l.6 \includegraphics{espec.png}

and stopped.

1 Answers1

6

This is the same fix proposed here, adapted to Plain. The differences are that \makeatletter becomes \catcode`\@=11, \m@ne becomes -1. Also graphicx.sty expects @ to be catcode 11, so we move the \catcode`\@=12 (\makeatother) after loading it:

\input miniltx
% Start fix
\catcode`\@=11
\def\set@curr@file#1{%
  \begingroup
    \escapechar=-1
    \xdef\@curr@file{\expandafter\string\csname #1\endcsname}%
  \endgroup
}
\def\quote@name#1{"\quote@@name#1\@gobble""}
\def\quote@@name#1"{#1\quote@@name}
\def\unquote@name#1{\quote@@name#1\@gobble"}
% End fix
\input graphicx.sty
\catcode`\@=12
\includegraphics{example-image}
\bye