[pdftex] Color and graphicx

Heiko Oberdiek oberdiek at uni-freiburg.de
Thu Feb 23 20:38:37 CET 2006


Hello Robin,

On Wed, Feb 22, 2006 at 12:03:09PM +0000, Robin Fairbairns wrote:

> > I got the following off the pdftex archives to use color in a pdftex document.
> > 
> >    \input miniltx
> >    \def\Gin at driver{pdftex.def}
> >    \input color.sty
> >    \resetatcatcode
> >    \definecolor{yellow}{rgb}{1,0,0}
> >    \textcolor{yellow}{This is stuff.}
> >    \vfill
> >    \bye
> > 
> > This is fine until I add \input graphicx
> 
> you should \input graphicx.sty -- graphicx.tex resets \Gin at driver to dvips.
> 
> (i guess you did, but...)
> 
> > to the mix. Adding it before color.sty produces "!undefined control
> > sequence ..."
> > and adding it after produces a busy loop.
> 
> this is a pdftex.def effect; it attempts to do things
> \AtBeginDocument, which is a null command in miniltx (but does the
> "right thing" in latex).
> 
> one of the things it does isn't idempotent, and it's obviously getting
> confused when loaded twice.  i would claim it doesn't need to do these
> things at all if it's running under miniltx (it patches up a couple of
> latex instances for use in a coloured document).
> 
> this explains the busy loop you experienced.
> 
> i've not investigated the "undefined command" thing.
> 
> however, i don't maintain pdftex.def -- heiko?

I have updated pdftex.def: 2006/02/23 v0.03n.

  https://developer.berlios.de/projects/pdftex-def/

The following should work now:

  \input miniltx
  \def\Gin at driver{pdftex.def}
  \input color.sty
  \input graphicx.sty
  \resetatcatcode

  \textcolor{red}{This is red.}
  \includegraphics{s1.png}
  \bye

Your sincerely
  Heiko <oberdiek at uni-freiburg.de>



More information about the pdftex mailing list