[OS X TeX] MacTeX inputs

Bruno Voisin bvoisin at mac.com
Mon Nov 13 16:32:29 CET 2006


Le 13 nov. 06 à 16:08, Alan Munn a écrit :

> A previous message by Julian Aguirre will solve this problem.  
> (Bruno's suggestion of loading graphicx before color doesn't work  
> for me, but this does.)
>
> At 11:43 AM +0100 11/8/06, Julian Aguirre wrote:
>
>> I found out that using the color and graphicx package with  
>> *pdftex* produced errors. The following code, provided by Dan in  
>> the comp.text.tex list, works:
>>
>> \input miniltx
>> \makeatletter
>> \def\Gin at driver{pdftex.def}
>> \input color.sty
>> \@namedef{ver at pdftex.def}{}
>> \input graphicx.sty
>> \resetatcatcode
>>
>> \textcolor{red}{Hello}
>> \includegraphics[width=.4\hsize]{image.pdf}

Sorry, I wasn't clear enough. What I meant is that, as far as the  
ordering is concerned, loading graphicx.tex before color.tex solves  
the issue.

But yes, either way, graphicx.tex and color.tex assume your are using  
dvips, not pdfTeX nor XeTeX, because of the hardwired \def\Gin at driver 
{dvips.def}.

Actually, with modern TeX you don't have to specify the driver file  
manually: TeX does it for you (it detects automatically which driver  
is used -- dvips, pdfTeX, XeTeX --, and picks up the appropriate  
driver file -- dvips.def, pdftex.def, xetex.def -- transparently).  
That is, provided you don't specify the extension of your included  
graphical file yourself, and let TeX pick it up depending on the  
settings within the driver file.

Thus, you can simply replace the calls to graphicx.tex and color.tex  
(including Julian Aguirre's code) by:

\input miniltx
\input graphicx.sty
\input color.sty

or

\input miniltx
\input color.sty
\input graphicx.sty

At least that works here on my current TeXLive-based setup, and I  
can't see why it wouldn't work on a teTeX-based setup. I tested it --  
all in plain TeX -- with all three of dvips, pdfTeX and XeTeX, and  
the input file:

> \magnification=\magstep1
> \input miniltx
> \input graphicx.sty
> \input color.sty
>
> One can use pen color by
>
> {\color{red} This line is red.}
>
> Or one can insert a picture by:
>
> \includegraphics[scale=0.5]{Logo}
>
> \bye

If case that doesn't work, could you please, Louis, post an example  
somewhere, or send it to me off-list?

In case the selection of the driver in TeXShop is the cause of the  
problem for you: this is done either through the Typeset menu (Pdftex  
selects pdfTeX, "TeX and Ghostscript" selects dvips), or through the  
engine-selecting scroll-down menu in the toolbar of the TeXShop  
editing window.

Bruno------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list