[OS X TeX] \colordvi in plain tex

Bruno Voisin bvoisin at mac.com
Sun Mar 6 11:55:21 EST 2005

Le 6 mars 05, à 16:32, rbmjk at alltel.net a écrit :

> It seems that the TeXShop version of plain tex does not support
> \colordvi . Any idea on how to get color in plain tex?

It's difficult to answer such a question without being given more 
background. It seems colordvi is an input file for dvips, not a 
command. Assuming this is the case and you're trying to \input this 
file in plain TeX and use one of the commands it defines, then either:

- Use TeXShop in TeX and Ghostscript mode (in the Typeset menu). This 
will tell TeXShop to process a .tex file by applying the sequence a 
commands tex -> dvips -> ps2pdf. Then you' ll be able to \input the 
file colordvi.tex, namely


and use all the predefined colors from color.pro, namely


- Use TeXShop in its default pdfTeX mode. You'll get similar color 
functionality from pdfcolor.tex, namely


For example, a while back I wrote a local letter macro file requiring 
some color output. To be able to use a command \Color identical to that 
from colordvi.tex with either dvips, pdfTeX or Textures I defined (with 
\ifpdf and \iftextures additional commands, not shown here, testing 
whether we're using pdfTeX and Textures):

	\ifpdf  %% for pdfTeX
	  \input pdfcolor
	  \iftextures  %% for Textures
	    \def\Color#1#2{\special{color push}\special{color cmyk #1}#2%
	      \special{color pop}}
	  \else  %% otherwise (ie dvips)
	    \def\Color#1#2{\special{color push cmyk #1}#2\special{color pop}}

and then

	\def\darkblue#1{\Color{1. .43 0. .18}{#1}}
	\darkblue{Some text}

Beware though: in case you're looking for the predefined colors, it 
seems the syntax is different with either dvips and colordvi.tex, or 
pdfTeX and pdfcolor.tex:

- With colordvi.tex, the predefined colors are commands taking 
arguments, such as \NavyBlue{Some text}.

- With pdfcolor.tex, the predefined colors are declarations, such as 
{\NavyBlue Some text}, similar to {\textColor{NavyBlue} Some text} from 
colordvi.tex. Actually \NavyBlue then is \pdfsetcolor{\cmykNavyBlue}, 
with \pdfsetcolor similar to colordvi's \textColor and \cmykNavyBlue 
similar to colordvi's NavyBlue.

The colordvi.tex commands are documented in the dvips manual 
/Library/teTeX/share/texmf.tetex/doc/programs/dvips.pdf. However, I 
couldn't see anything about the pdfcolor.tex commands in the pdfTeX 
manual /Library/teTeX/share/texmf.tetex/doc/pdftex/manual/pdftex-a.pdf.

Hope this helps,

Bruno Voisin
--------------------- 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 Post: <mailto:MacOSX-TeX at email.esm.psu.edu>

More information about the MacOSX-TeX mailing list