diff options
author | Karl Berry <karl@freefriends.org> | 2016-01-02 22:50:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-01-02 22:50:58 +0000 |
commit | f1a73737fea00318ecf19afd2d3b672d5770c6d8 (patch) | |
tree | 8a762de24b0080212aeeb2626e0f151baf9757c5 /Master/texmf-dist/tex/xelatex | |
parent | 715eef9af8dbfecd729022ab22ca9c05caa0e16c (diff) |
xespotcolor (2jan16)
git-svn-id: svn://tug.org/texlive/trunk@39257 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty | 89 |
1 files changed, 59 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty b/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty index 562639327c9..384995054b3 100644 --- a/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty +++ b/Master/texmf-dist/tex/xelatex/xespotcolor/xespotcolor.sty @@ -6,7 +6,7 @@ %% %% xespotcolor.dtx (with options: `xespotcolor') %% -%% (c) Copyright 2014-2015 Apostolos Syropoulos +%% (c) Copyright 2014-2016 Apostolos Syropoulos %% This program can be redistributed and/or modified under the %% terms of the LaTeX Project Public License Distributed from %% http://www.latex-project.org/lppl.txt; either @@ -36,24 +36,34 @@ %% Right brace \} Tilde \~} %% \ProvidesFile{xesporcolor.sty} - [2015/03/21 v1.2 Package `xespotcolor.sty' (bug fix release)] + [2016/01/02 v2.0 Package `xespotcolor.sty'] \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xespotcolor} - [2015/03/21 v.1.2, Package for adding Spot Color support to LaTeX/XeLaTeX.] + [2016/01/02 v.2.0, Package for adding Spot Color support to LaTeX/XeLaTeX.] \RequirePackage{ifxetex} +\RequirePackage{everypage} +\@ifpackageloaded{xcolor}{\let\use@xcolor\relax}{} +\DeclareOption{hks}{\let\use@hks\relax} +\DeclareOption{pantone}{\let\use@pantone\relax} +\DeclareOption{xcolor}{\let\use@xcolor\relax} +\ProcessOptions +\ifx\use@xcolor\undefined \ifxetex - \RequirePackage[xetex]{graphics} - \RequirePackage[xetex]{color} + \@ifpackageloaded{graphics}{}{\RequirePackage[xetex]{graphics}} + \@ifpackageloaded{color}{}\RequirePackage[xetex]{color} \else - \RequirePackage[dvipdfmx]{graphics} - \RequirePackage{color} + \@ifpackageloaded{graphics}{}{\RequirePackage[dvipdfmx]{graphics}} + \@ifpackageloaded{color}{}\RequirePackage{color} \fi -\RequirePackage{everypage} -\newif\ifhks\hksfalse -\newif\ifpantone\pantonefalse -\DeclareOption{hks}{\hkstrue} -\DeclareOption{pantone}{\pantonetrue} -\ProcessOptions +\else +\ifxetex + \@ifpackageloaded{graphics}{}{\RequirePackage[xetex]{graphics}} + \@ifpackageloaded{xcolor}{}{\RequirePackage[xetex]{xcolor}} +\else + \@ifpackageloaded{graphics}{}{\RequirePackage[dvipdfmx]{graphics}} + \@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}} +\fi\fi +\@ifpackageloaded{tikz}{\global\pgf@sys@pdf@colorspaces@existsfalse}{} \def\NewSpotColorSpace#1{% \expandafter\newtoks\csname #1\endcsname% \csname #1\endcsname{}% @@ -65,33 +75,52 @@ \newcount\colorprofilecnt \newtoks\mycolorprofilename \def\AddSpotColor#1#2#3#4{% - \mycolorprofilename={@mycolorprofile\the\colorprofilecnt}% - \edef\mycolorprofile{\the\mycolorprofilename - <</C0[0 0 0 0]/FunctionType 2/C1[#4]/Domain[0 1]/N 1>>}% - \edef\mycolor{[/Separation/#3 /DeviceCMYK \the\mycolorprofilename]}% - \edef\tempcs{/#2 \mycolor}% - \expandafter\csgrab\expandafter{\tempcs}{\csname #1\endcsname}% - \special{pdf:obj \mycolorprofile}% - \special{pdf:obj @myowncolor\the\colorprofilecnt \mycolor}% - \advance\colorprofilecnt by1% + \mycolorprofilename={@mycolorprofile\the\colorprofilecnt}% + \edef\mycolorprofile{\the\mycolorprofilename + <</C0[0 0 0 0]/FunctionType 2/C1[#4]/Domain[0 1]/N 1>>}% + \edef\mycolor{[/Separation/#3 /DeviceCMYK \the\mycolorprofilename]}% + \edef\tempcs{/#2 \mycolor}% + \expandafter\csgrab\expandafter{\tempcs}{\csname #1\endcsname}% + \special{pdf:obj \mycolorprofile}% + \special{pdf:obj @myowncolor\the\colorprofilecnt \mycolor}% + \advance\colorprofilecnt by1% } \def\SetPageColorResource#1{% - \AddEverypageHook{\special{pdf:put @resources <</ColorSpace <<#1>>>>}}% + \AddEverypageHook{\special{pdf:put @resources <</ColorSpace <<#1>>>>}}% }% \def\SetPageColorSpace#1{% -\expandafter\SetPageColorResource\expandafter{\the\csname #1\endcsname}% + \expandafter\SetPageColorResource\expandafter{\the\csname #1\endcsname}% }% \def\SpotColor#1#2{% -\special{pdf:literal /#1 cs /#1 CS #2 sc #2 SC}% - \aftergroup\reset@color% + \special{pdf:literal /#1 cs /#1 CS #2 sc #2 SC}% + \aftergroup\reset@color% }% +\ifx\use@xcolor\undefined \def\color@spotcolor#1#2{\c@lor@@spotcolor#2\@@#1} \def\c@lor@@spotcolor#1,#2\@@#3{% - \c@lor@arg{#2}% - \edef#3{spot #1 #2}% + \c@lor@arg{#2}% + \edef#3{spot #1 #2}% } -\ifhks\input{spotcolorhks}\fi -\ifpantone\input{spotcolorpantone}\fi +\else +\XC@sdef\XC@mod@spotcolor{spotcolor} +\def\@@xespotcolordef@xspc#1,#2\@@{spot #1 #2} +\let\o@XC@definec@lor@xspc\XC@definec@lor +\def\XC@definec@lor[#1]#2[#3]#4#5% +{% + \expandafter\ifx\csname XC@mod@#4\endcsname\XC@mod@spotcolor + \expandafter\xdef\csname\string\color @#2\endcsname + {\noexpand\xcolor@{}{\@@xespotcolordef@xspc#5\@@}{spotcolor}{#5}}% + \else + \o@XC@definec@lor@xspc[#1]{#2}[#3]{#4}{#5}% + \fi +}% +\gdef\pgfsys@color@spotcolor@stroke#1#2{\special{pdf:literal /#1 CS #2 SC}} +\gdef\pgfsys@color@spotcolor@fill#1#2{\special{pdf:literal /#1 cs #2 sc}} +\gdef\pgfsys@color@spotcolor#1#2{\pgfsys@color@spotcolor@stroke{#1}{#2}% + \pgfsys@color@spotcolor@fill{#1}{#2}} +\fi +\ifx\use@hks\undefined\else\input{spotcolorhks}\fi +\ifx\use@pantone\undefined\else\input{spotcolorpantone}\fi \endinput %% %% End of file `xespotcolor.sty'. |