\documentclass{book}
\usepackage{xcolor}
\definecolor{newcolor}{cmyk}{.5,0,0,0}
\begin{document}
\textcolor{newcolor}{Sample text}
\end{document}
Asked
Active
Viewed 1,469 times
3
Fran
- 80,769
ramani sadheesh
- 105
-
This question could use a short bit of text explaining what the code snippet is supposed to be. – rubenvb Feb 05 '20 at 16:00
2 Answers
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}
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}
David Purton
- 25,884
-
-
\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 Oct 24 '20 at 05:16 -
1@MadyYuvi it looks like the
\definecolorline is wrong. You've just defined a CMYK colour. – David Purton Oct 24 '20 at 08:03 -
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}
Fran
- 80,769
-
Strictly speaking, the RGB or CMYK presentation is some approximate. Is it possible to define strong PANTONE color in LaTeX? – Mr. Sandman Feb 05 '20 at 07:00
-

