6

I would like to specify pantone colors. spotcolor.sty seems to to the trick when compiled with pdfLaTeX:

\documentclass{article}
\usepackage{color}
% \usepackage{xcolor} % Does not work
\usepackage[pantone]{spotcolor}

\SetPageColorSpace{PANTONE}%
\definecolor{mycolor}{spotcolor}{PANTONE273PC,1.0}%

\begin{document}

{\color{mycolor}\rule{4cm}{3cm}}

\textcolor{mycolor}{Colored text}

\end{document}

but spotcolorit is incompatible with xcolor which is loaded by TikZ. Is it somehow possible to get xcolor and TikZ to work together with spotcolor so I can do something like:

\documentclass{article}
\usepackage{tikz}
\colorlet{mycolor}{blue}

% Does not work
% \usepackage[pantone]{spotcolor}
% \SetPageColorSpace{PANTONE}%
% \definecolor{mycolor}{spotcolor}{PANTONE273PC,1.0}%

\begin{document}

\begin{tikzpicture}
    \node[fill=mycolor,minimum width=4cm,minimum height=3cm] (rule) {};
    \node[mycolor,anchor=north west] at (rule.south west) {Colored text};
\end{tikzpicture}

\end{document}

Edit:

I can load xcolor after defining my pantone colors but TikZ still does not like it:

\documentclass{article}
\usepackage{ltxcmds}
\usepackage{color}
\usepackage[pantone]{spotcolor}
\SetPageColorSpace{PANTONE}%
\definecolor{mycolor}{spotcolor}{PANTONE273PC,1.0}%
\usepackage{xcolor}
% \usepackage{tikz}

\begin{document}

{\color{mycolor}\rule{4cm}{3cm}}

\textcolor{mycolor}{Colored text}

\colorlet{mysecondcolor}{red}

{\color{mysecondcolor}\rule{4cm}{3cm}}

\textcolor{mysecondcolor}{Colored text}

\makeatletter
\ltx@ifpackageloaded{tikz}{%
\begin{tikzpicture}
    \node[fill=mycolor,minimum width=4cm,minimum height=3cm] (rule) {};
    \node[mycolor,anchor=north west] at (rule.south west) {Colored text};
\end{tikzpicture}}{}
\makeatother

\end{document}
1

2 Answers 2

1

it is simple to declare a package as loaded:

\makeatletter
    
\@namedef{[email protected]}{}

\makeatother
\RequirePackage{color}
\documentclass{article}

\usepackage{tikz}

....

but that won't solve your problem, pgf relies heavy on the xcolor routines. It has a lot of macros which are unknown to package color, e.g. \colorlet

1
  • Yes, I know. But as you note, it doesn't solve the problem in this case. Sep 21, 2011 at 7:00
1

This is not a direct answer, in fact it is an obvious hack for your problem but I think you don't need to insist on PANTONE colors since they will be probably shifted to the closest #Hex value. If you can't find a workaround, you can simply define your color via \definecolor{oranga}{cmyk}{0,0.5,1,0} or \definecolor{chameleon}{rgb}{0.54118, 0.88627, 0.20392} % #8ae234 (I took this color from tango palette. )

If you plan to have gazillion of places to use pantone colors and spotcolor still causes problems, you can read the color definition from the spotcolorpantone.tex file by yourself with a macro (it is in CMYK format and the file is fairly structured) and use as above.

You can also obtain the same list from the source codes of the webpages such as this. Sorry if this solution is too obvious for you, but I had the same problem for a poster and ended up using what I've described above.

1
  • Thanks. This is basically what I do now. I tell the printer that color X1 is Pantone Y1 and color X2 is color Y2. However, I would like to have this in the pdf file. Sep 21, 2011 at 6:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .