Using spot-color in LaTeX for print-post-processing

I like to use LaTeX to produce nice looking PDF files for printing. So far that has worked pretty well, but in a recent project I ran into issues, so I want to document the solution here. In some printing jobs, there is post-processing involved e.g. when cutting stickers, when putting gold-foil over certain parts of the design or when embossing. In that case, the files need to follow a certain scheme that this areas can be correctly recognized.

In my use-case, the cut-contour lines of a sheet of stickers needed to be given as a separate colour with a certain name. All solutions that I found, where tailored towards proprietary PDF creators like the Adobe Suite or something in this direction. Even harder, if you search for the german words „Volltonfarbe“ in combination with „Latex“ (or even „LaTeX“), you will end up with results offering to buy latex based paint which is not very helpful. „Volltonfarbe“ in this context translates to „spot-color“ and it is very well possible to use spot colors in a LaTeX document.

One added difficulty is, that I’m using a jinja template to programmatically create my tex files as I want to script the generation of cut contours. There is a powerfull, scriptable graphics engine for LaTeX called „tikz“ but unfortunately, it seems to be incompatible with the spotcolour packages. Luckily, I seem not to be the only person running into that issue and the trusty people over at stackoverflow even turned this exact question into a LaTeX package.

So to get things running, follow these steps:

  1. Find the color specification the printing company uses to mark post-processing steps in printing files. In my case, they wanted to have a „Volltonfarbe“ (spot colour) in the CMYK colorspace named kiss_cut in pure magenta. So this would be {cmyk}{0,1,0,0} in LaTeX‘ color notation.
  2. Get the xspotcolor package. At the time of this writing, it was not yet available on CTAN, so I got it over the link in the above mentioned SO question which leads here. There is another package called xespotcolor that might to the same, but I haven’t tested. As I only needed to use the xspotcolor package in one single project, I created the .sty file from it by simply running latex on the .dtx file and putting the resulting file in the same folder as my project.
  3. Create a .tex file loading the xspotcolor package, create a color space, add the spot color to it and simply use it inside a tikz image. Minimal example below:
\documentclass[a4paper]{article}
 

 \usepackage[autodefine]{xspotcolor} % Autodefine option creates a latex color from the pdf color-name
 \usepackage[pass,paperwidth=21cm,paperheight=29.7cm, top=6mm, bottom=6mm, left=6mm, right=6mm, margin=0mm]{geometry}

 \usepackage{tikz}
 \usetikzlibrary{positioning}

 \NewSpotColorSpace{CMYK}
 \AddSpotColor{CMYK}{kiss_cut}{kiss_cut}{0 1 0 0}

 
 \begin{document}
 \pagestyle{empty}

 \SetPageColorSpace{CMYK} %needs to be set on every new page if not globally for the whole document
 \begin{tikzpicture}[remember picture, overlay]
 \draw [draw=kiss_cut] ([yshift=3mm,xshift=3mm]current page.south west) rectangle ([yshift=-3mm,xshift=-3mm]current page.north east);
 \end{tikzpicture}
 

\end{document}