4
\documentclass{book}

\usepackage{xcolor}

\definecolor{newcolor}{cmyk}{.5,0,0,0}

\begin{document}

\textcolor{newcolor}{Sample text}

\end{document}
1
  • This question could use a short bit of text explaining what the code snippet is supposed to be.
    – rubenvb
    Commented Feb 5, 2020 at 16:00

2 Answers 2

8

If you are using pdflatex or lualatex, you can use the colorspace package:

You can give the alternate colour in either RGB, CMYK, or Lab.

However, I notice that colorspaceconverts the RGB values to CMYK, so maybe it's best to stick with CMYK or Lab alternate colours. (This is noted in the manual.) In fact I think it's definitely better not to use the RGB model, since the conversion to CMYK is done using the simple xcolor formulas which make no attempt to use colour management. So an RGB alternate colour will look quite different (as shown in the example below).

\documentclass{article}

\usepackage[illuminant=d50]{colorspace}
\definespotcolor{PANTONE 300 C (CMYK)}{PANTONE 300 C CMYK}{0.99,0.5,0.0,0.0}
\definespotcolor{PANTONE 300 C (RGB)}{PANTONE 300 C RGB}[RGB]{0 94 184}
\definespotcolor{PANTONE 300 C (Lab)}{PANTONE 300 C Lab}[alt=lab]{35.78,-9.69,-62.01/0.99,0.5,0.0,0.0}

\begin{document}

\textcolor{PANTONE 300 C (CMYK)}{PANTONE 300 C (alt = CMYK: 0.99, 0.5, 0.0, 0.0)}

\textcolor{PANTONE 300 C (RGB)}{PANTONE 300 C (alt = RGB: 0, 94, 184)}

\textcolor{PANTONE 300 C (Lab)}{PANTONE 300 C (alt = Lab: 35.78, -9.69, -62.01; illuminant = d50)}

\end{document}

MWE output


If you are using xelatex, you can use the xespotcolor package. This package isn't as feature filled as the colorspace package.

\documentclass{article}

\usepackage{xespotcolor}

\NewSpotColorSpace{PANTONE}
\AddSpotColor{PANTONE}{PANTONE300C}{PANTONE\SpotSpace 300\SpotSpace C}{0.99 0.5 0 0}
\SetPageColorSpace{PANTONE}
\definecolor{PANTONE 300 C}{spotcolor}{PANTONE300C, 1.0}

\begin{document}

\textcolor{PANTONE 300 C}{PANTONE 300 C (alt = CMYK: 0.99, 0.5, 0.0, 0.0)}

\end{document}

MWE output

4
  • Excellent and useful suggestion...you rocks...
    – MadyYuvi
    Commented Feb 5, 2020 at 11:53
  • \NewSpotColorSpace{PANTONE} \AddSpotColor{PANTONE} {PANTONE286UC100} {PANTONE\SpotSpace 286\SpotSpace UC} {0.90 0.75 0.01 0} \definecolor{PANTONE286UC100}{cmyk}{0.90,0.75,0.01,0} \usepackage{tcolorbox} \tcbuselibrary{skins} \begin{tcolorbox}[enhanced jigsaw,colback=white,colframe=PANTONE286UC100,boxrule=3pt,arc=5pt] The content of this chapter has been published in the SRRW conference in 2017. The work of this chapter is also extended to handle the ER problem. \end{tcolorbox} what error I did? Kindly suggest....
    – MadyYuvi
    Commented Oct 24, 2020 at 5:16
  • 1
    @MadyYuvi it looks like the \definecolor line is wrong. You've just defined a CMYK colour. Commented Oct 24, 2020 at 8:03
  • Thanks, now the problem was fixed....
    – MadyYuvi
    Commented Oct 24, 2020 at 8:21
2
\documentclass{book}
\usepackage{xcolor}
\definecolor{newcolor}{cmyk}{1,.56,0,.03} % PANTONE 300 c
% or ...
%       \definecolor{newcolor}{RGB}{0,94,184} 
%       \definecolor{newcolor}{HTML}{005EB8} 

\begin{document}
\textcolor{newcolor}{Sample text}
\end{document}
2
  • Strictly speaking, the RGB or CMYK presentation is some approximate. Is it possible to define strong PANTONE color in LaTeX? Commented Feb 5, 2020 at 7:00
  • @Mr.Sandman See if this question is what you are looking for.
    – Fran
    Commented Feb 5, 2020 at 7:18

You must log in to answer this question.

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