summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/xespotcolor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-22 21:23:11 +0000
committerKarl Berry <karl@freefriends.org>2015-03-22 21:23:11 +0000
commitf9f6d883fba9f42dd455383a0bf1a13a0c193841 (patch)
treec838e9a47085037041b771620e2bea6898c477bc /Master/texmf-dist/source/xelatex/xespotcolor
parent7dda79a619cf02db4cdb8b8882245bd8da077b0c (diff)
xespotcolor (22mar15)
git-svn-id: svn://tug.org/texlive/trunk@36597 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xespotcolor')
-rw-r--r--Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx58
1 files changed, 34 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx
index 9dd7cd83c92..107545eec8c 100644
--- a/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx
+++ b/Master/texmf-dist/source/xelatex/xespotcolor/xespotcolor.dtx
@@ -29,12 +29,12 @@
% Apostolos Syropoulos (asyropoulos@yahoo.com)
%
%\fi
-% \CheckSum{98}
+% \CheckSum{106}
% \iffalse This is a Metacomment
%
%<xespotcolor, >\ProvidesFile{xesporcolor.sty}
%
-%<xespotcolor, > [2015/03/18 v1.1 Package `xespotcolor.sty' (bug fix release)]
+%<xespotcolor, > [2015/03/21 v1.2 Package `xespotcolor.sty' (bug fix release)]
%
% \begin{macrocode}
%<*driver>
@@ -53,37 +53,38 @@
% \fi
%\MakeShortVerb{\|}
%\StopEventually{}
-%\title{The \textsf{xespotcolor} package}
+%\title{The \textsf{xespotcolor} package:\\ Spot Colors for \XeLaTeX\ \&\ \LaTeX}
%\author{Apostolos Syropoulos\\
% Xanthi, Greece\\
% \texttt{asyropoulos@yahoo.com}}
-% \date{2015/03/18}
+% \date{2015/03/21}
%\maketitle
% \begin{abstract}
% A spot color is one that is printed with its own ink. Typically, printers use spot colors
% in the production of books or other printed material. The \textsf{spotcolor} package
% by Jens Elstner is a first attempt to introduce the use of spot colors with pdfLaTeX.
% The \textsf{xespotcolor} package is a reimplementation of this package so to be usable with
-% \XeLaTeX. As such, it has the same user interface and the same capabilities.
+% \XeLaTeX\ and \LaTeX+\texttt{dvipdfmx}. As such, it has the same user interface and the same capabilities.
%\end{abstract}
%
%\section{Introduction}
%
% Using spot colors with \XeLaTeX\ is very important since most printers use spot colors in the
% production of books and magazines. The \textsf{spotcolor} package makes it possible to use
-% spot colors with pdf\LaTeX\ but it cannot be used with \XeLaTeX. In the following I first
-% describe how to translate certain pdf\TeX\ code snippets into \XeTeX\ and then I present the
-% code of the package. Thus one can view this text as a short tutorial on how to port pdf\TeX\
-% code to \XeTeX\ as well as a description of the functionality of the \textsf{xespotcolor} package.
-% Since the package is a port of a pdf\TeX\ package, it has the same functionality as the original
-% package.
+% spot colors with pdf\LaTeX\ but it cannot be used with \XeLaTeX\ or \LaTeX. In what follows I first
+% describe how to translate certain pdf\TeX\ code snippets into \XeTeX\ or \TeX+\texttt{dvipdfmx}
+% and then I present the code of the package. Thus one can view this text as a short tutorial on how to port
+% pdf\TeX\ code to \XeTeX\ or \TeX+\texttt{dvipdfmx} as well as a description of the functionality of the
+% \textsf{xespotcolor} package. Since the package is a port of a pdf\TeX\ package, it has the same functionality
+% as the original package.
%
-% \section{Porting pdf\TeX\ code to \XeTeX}
%
-% Translating pdf\TeX\ code, which adds PDF code to the output file, to \XeTeX\ is not a straightforward exercise
-% since pdf\TeX\ provides primitive commands that directly access and modify the structure of the resulting PDF file.
-% In the case of \XeTeX\ one has to use |\special| commands that pass code to the driver. In this particular case,
-% I had to translate code snippets like the following one:
+% \section{Porting pdf\TeX\ code to \XeTeX\ or \TeX+\texttt{dvipdfmx}}
+%
+% Translating pdf\TeX\ code, which adds PDF code to the output file, to \XeTeX\ or \TeX+\texttt{dvipdfmx} is not a
+% straightforward exercise since pdf\TeX\ provides primitive commands that directly access and modify the structure of
+% the resulting PDF file. In the case of \XeTeX\ and \TeX\ one has to use |\special| commands that pass code to the driver.
+% In this particular case, I had to translate code snippets like the following one:
% \begin{center}
% |1. \newcount\theCNTa |\\
% |2. \newcount\theCNTb |\\
@@ -142,17 +143,26 @@
%<*xespotcolor>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xespotcolor}
- [2015/03/18 v.1.1, Package for adding Spot Color support to XeLaTeX.]
+ [2015/03/21 v.1.2, Package for adding Spot Color support to LaTeX/XeLaTeX.]
% \end{macrocode}
-% The package needs three packages in to operate properly: \textsf{graphics}, \textsf{color}, and \textsf{everypage}.
-% The first two packages must be loaded with the \texttt{xetex} option, since auto-detection does not work in this case.
+% The package needs three packages in order to operate properly: \textsf{graphics}, \textsf{color}, and \textsf{everypage}.
+% The first two packages must be loaded with a driver/engine option, since auto-detection does not work in this case.
+% Since the package can be used with either \LaTeX\ or \XeLaTeX\ and the \texttt{dvipdfmx}/\texttt{xdvipdfmx} driver, respectively,
+% it is necessary to load these packages with the proper options. Akira Kakuto, who actually discovered that the package can be used
+% with \LaTeX, suggested the following code to properly load these packages:
% \begin{macrocode}
-\RequirePackage[xetex]{graphics}
-\RequirePackage[xetex]{color}
+\RequirePackage{ifxetex}
+\ifxetex
+ \RequirePackage[xetex]{graphics}
+ \RequirePackage[xetex]{color}
+\else
+ \RequirePackage[dvipdfmx]{graphics}
+ \RequirePackage{color}
+\fi
\RequirePackage{everypage}
% \end{macrocode}
-% The original package defines two ``boolean'' variables that are set when the package is loaded with the \texttt{hks} and
-% the \texttt{pantone} options, respectively. When these variables are true, then the package pre-loads color values in the
+% The original package defines two ``Boolean'' variables that are set when the package is loaded with the \texttt{hks} and/or
+% the \texttt{pantone} options, respectively. When these variables are set to true, then the package pre-loads color values in the
% corresponding color space (i.e., ``hks'' and ``pantone''). These color values are stored in two separate source files.
% These files are part of the original package distribution.
% \begin{macrocode}
@@ -265,7 +275,7 @@
%\end{center}
% The code that follows has been taken and subsequently modified from \texttt{xetex.def},
% which is {\em not yet} part of the Standard LaTeX ``Graphics Bundle.'' Note that these command work only
-% if the \texttt{xdvipdfm-x} driver has been patched to recognize the \texttt{spot} command.
+% with \texttt{xdvipdfm-x} driver revision 36553 and later.
% \begin{macrocode}
\def\color@spotcolor#1#2{\c@lor@@spotcolor#2\@@#1}
\def\c@lor@@spotcolor#1,#2\@@#3{%