%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % CMYK-HAX.TEX: % E This is a set of TeX macros supporting color separation and % substitution using TeX/PostScript environment. Needs DVIPS and % COLORDVI from standard DVIPS distribution. % % P Zestaw makr TeX-owo-PostScript-owych do tworzenia wyci/ag/ow barwnych % i podmiany kolor/ow. Wsp/o/lpracuje ze sterownikiem DVIPS % i zestawem makr COLORDVI (ze standardowej dystrybucji DVIPS-a); % % % AUTHORS' COORDINATES: % BOP s.c. % ul. Piastowska 70, 80-363 Gda\'nsk, Poland % tel. +48 58 53-46-59 % email: jacko@ipipan.gda.pl % % HISTORY: % VERSION 0.5, 28 IV 1995: % E version released during the GUST annual meeting Bacho\TeX'95. % P wersja udost/epniona podczas Bacho\TeX'95. % VERSION 0.51, 5 V 1995: % E macro \CMYKinit added (it places necessary def's in a PS prolog). % P dodane zosta/lo makro inicjalizacyjne `\CMYKinit', % kt/ore umieszcza w prologu PS u/zywane definicje. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \edef\slashcatcode {\the\catcode`\/} \catcode`\/12 % \def\CMYKinit {\special {! userdict begin /ori_setcmykcolor where {pop} {/ori_setcmykcolor /setcmykcolor load def} ifelse /ori_fill where {pop} {/ori_fill /fill load def} ifelse /ori_eofill where {pop} {/ori_eofill /eofill load def} ifelse /ori_stroke where {pop} {/ori_stroke /stroke load def} ifelse /ori_setgray where {pop} {/ori_setgray /setgray load def} ifelse /ori_show where {pop} {/ori_show /show load def} ifelse /setcmykcolor {ori_setcmykcolor} def % /trueunit {0 matrix defaultmatrix matrix currentmatrix matrix invertmatrix matrix concatmatrix dtransform dup mul exch dup mul add sqrt} def /truebp {trueunit} def /truept {72.27 div 72 mul trueunit} def /truemm {25.4 div 72 mul trueunit} def /truecm {2.54 div 72 mul trueunit} def /truein {72 mul trueunit} def /truedd {72.27 div 1238 mul 1157 div 72 mul trueunit} def /truecc {72.27 div 1238 mul 1157 div 12 mul 72 mul trueunit} def end}} % \def\CMYKgray {\special {! userdict begin /setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} def } end} % \def\PSbegingroup {\begingroup \special{ps: save }} \def\PSendgroup {\special{ps: restore }\endgroup} % \def\forcolor #1{\def\thecolor{#1}} \def\checkcolor {\thecolor\space count 4 lt {(Not CMYK ) print} if k_ eq exch y_ eq and exch m_ eq and exch c_ eq and } % \def\changefill #1{% \edef\changefills{\changefills \checkcolor {#1 ori_setcmykcolor} if }} \def\changestroke #1{% \edef\changestrokes{\changestrokes \checkcolor {#1 ori_setcmykcolor} if }} \def\changecolor #1{% \edef\changecolors{\changecolors \checkcolor {#1 ori_setcmykcolor} if }} \def\addfill #1{% \edef\addfills{\addfills \checkcolor {addfill} if }% \edef\changefills{\changefills \checkcolor {#1 ori_setcmykcolor} if }} \def\addstroke #1{% \edef\addstrokes{\addstrokes \checkcolor {addstroke} if }% \edef\changestrokes{\changestrokes \checkcolor {#1 ori_setcmykcolor} if }} \def\addcolor #1{\addstroke{#1}\addfill{#1}} \def\delfill {% \edef\delfills{\delfills \checkcolor {delfill} if }} \def\delstroke {% \edef\delstrokes{\delstrokes \checkcolor {delstroke} if }} \def\delcolor {% \edef\delcolors{\delcolors \checkcolor {delfill delstroke} if }} \def\strokehook #1{% \edef\strokehooks{\strokehooks \checkcolor {#1} if }} \def\fillhook #1{% \edef\fillhooks{\fillhooks \checkcolor {#1} if }} \def\strokeup {% \edef\changestrokes{\changestrokes \checkcolor {upstroke} if }} \def\fillup {% \edef\changestrokes{\changestrokes \checkcolor {upfill} if }} % \def\setCMYKchange{% \edef\changestrokes{}% \edef\changefills{}% \edef\changecolors{}% \edef\addstrokes{}% \edef\addfills{}% \edef\delstrokes{}% \edef\delfills{}% \edef\delcolors{}% \edef\strokehooks{}% \edef\fillhooks{}% } % \def\fillinitials{% /to_fill true def /to_stroke false def /to_upstroke false def } \def\strokeinitials{% /to_fill false def /to_stroke true def /to_upstroke true def } % \def\useCMYKchange{% \special{ps: userdict begin % /addfill {/to_fill true def} def /delfill {/to_fill false def} def /upfill {/to_upstroke false def} def /addstroke {/to_stroke true def upstroke} def /delstroke {/to_stroke false def} def /upstroke {/to_upstroke true def} def % /do_stroke {to_stroke {gsave \changestrokes \strokehooks ori_stroke grestore} if} def % /eofill {userdict begin \fillinitials \delfills \delcolors \addstrokes currentpoint to_upstroke {} {do_stroke} ifelse to_fill {gsave \changefills \fillhooks ori_eofill grestore} if to_upstroke {do_stroke} if newpath moveto end} def % /fill {userdict begin \fillinitials \delfills \delcolors \addstrokes currentpoint to_upstroke {} {do_stroke} ifelse to_fill {gsave \changefills \fillhooks ori_fill grestore} if to_upstroke {do_stroke} if newpath moveto end} def % /stroke {userdict begin \strokeinitials \delstrokes \delcolors \addfills currentpoint to_upstroke {} {do_stroke} ifelse to_fill {gsave \changefills \fillhooks ori_eofill grestore} if to_upstroke {do_stroke} if newpath moveto end} def % /show {userdict begin \fillinitials \delcolors to_fill {ori_show} {false charpath currentpoint newpath moveto} ifelse end} def % /setcmykcolor {userdict begin /k_ exch def /y_ exch def /m_ exch def /c_ exch def c_ m_ y_ k_ ori_setcmykcolor \changecolors end} def end}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\cyan {1 0 0 0} \def\magenta {0 1 0 0} \def\yellow {0 0 1 0} \def\black {0 0 0 1} % \def\ScreenFrequency {} \def\Cangle {15} \def\Mangle {75} \def\Yangle {0} \def\Kangle {45} % \def\PSscreen #1{\ifx\ScreenFrequency\empty currentscreen exch pop #1 exch setscreen \else currentscreen exch pop exch pop \ScreenFrequency\space exch #1 exch setscreen \fi} % \def\projectCMYK #1{% \edef\projectcolor{#1}% \special{ps: userdict begin \ifx\projectcolor\cyan /ori_setcmykcolor {pop pop pop 1 exch sub ori_setgray} def \PSscreen\Cangle \else \ifx\projectcolor\magenta /ori_setcmykcolor {pop pop exch pop 1 exch sub ori_setgray} def \PSscreen\Mangle \else \ifx\projectcolor\yellow /ori_setcmykcolor {pop exch pop exch pop 1 exch sub ori_setgray} def \PSscreen\Yangle \else \ifx\projectcolor\black /ori_setcmykcolor {exch pop exch pop exch pop 1 exch sub ori_setgray} def \PSscreen\Kangle \fi \fi \fi \fi end}} % \def\CMYKlabels #1{{#1% #1 is a font csname \Cyan{CYAN} \Magenta{MAGENTA} \Yellow{YELLOW} \Black{BLACK}}} % \CMYKinit % \catcode`\/\slashcatcode % \endinput