
環境を使用している古いフィギュアがたくさんありますpicture
。フィギュアをコンパイルするには、dvi->dvips->ps2pdf
ツールチェーンを使用する必要があります。
これらの写真の色をrgb
モデルからcmyk
パントンカラーに変更する必要があります。この質問、スポットカラーを定義することができました。問題は、マクロで直接使用すると\special
、PDF ビューア (evince) で黒く表示されることです。
定義されたスポットカラーを使用するように dvips に指示するにはどうすればよいでしょうか?
ムウェ
\begin{filecontents*}{spot_color.pro}
TeXDict begin
/RedSpotCMYK [0 1 0 0] def
/RedSpotSpot (RedSpot) def
/RedSpotDef RedSpotCMYK aload pop RedSpotSpot findcmykcustomcolor def
/XC@RedSpot{RedSpotDef 1.0 setcustomcolor}XCdef
end
\end{filecontents*}
\documentclass{minimal}
\usepackage[prologue]{xcolor}
\usepackage[tightpage,active,psfixbb]{preview}
\setlength\PreviewBorder{2mm}
\PreviewEnvironment{picture}
\definecolor{RedSpot}{cmyk}{0 1 0 0}
\usepackage{eepic}
\begin{document}
\setlength{\unitlength}{0.254mm}
\begin{picture}(340,225)(100,-420)
% This compiles but arrow shows black
\special{RedSpot 1}\allinethickness{0.508mm}\path(110,-395)(170,-300)\special{sh 1}\path(170,-300)(167,-302)(168,-303)(169,-304)(170,-300) % Plain Solid Arrow
% This has compilation error:
% ps2pdf spotcolor-picture.ps
% Error: /undefined in TeXcolorRedSpot
% \special{color RedSpot 1}\allinethickness{0.508mm}\path(110,-395)(170,-300)\special{sh 1}\path(170,-300)(167,-302)(168,-303)(169,-304)(170,-300) % Plain Solid Arrow
% With the CMYK model it shows correctly
% \special{color cmyk 0 1 0 0}\allinethickness{0.508mm}\path(110,-395)(170,-300)\special{sh 1}\path(170,-300)(167,-302)(168,-303)(169,-304)(170,-300) % Plain Solid Arrow
\special{color cmyk 1 0 0 0}\allinethickness{0.508mm}\path(110,-395)(380,-310)\special{color cmyk 1 0 0 0}\path(380,-310)(377,-310)(377,-311)(377,-312)(380,-310) % Plain Solid Arrow
\end{picture}
\end{document}
コンパイルには次のコマンドを使用します
latex spotcolor-picture.tex
dvips -h tex.pro -h xcolor.pro -h spot_color.pro spotcolor-picture.dvi
ps2pdf spotcolor-picture.ps
答え1
色の名前は でXC@RedSpot
、 special 内では任意の単語は使用できません。これらは通常キーワードです。PostScript を文字通り挿入したい場合は を使用できますps: keyword
。
以下は機能するようです (プレビューと他の色は削除しました。テストが複雑になります)。
\begin{filecontents*}{spot_color.pro}
TeXDict begin
/RedSpotCMYK [0 1 0 0] def
/RedSpotSpot (RedSpot) def
/RedSpotDef RedSpotCMYK aload pop RedSpotSpot findcmykcustomcolor def
/XC@RedSpot{RedSpotDef 1.0 setcustomcolor}XCdef
end
\end{filecontents*}
\documentclass{article}
\usepackage{eepic}
\begin{document}
\setlength{\unitlength}{1mm}
abc
\begin{picture}(10,10)
\special{ps: XC@RedSpot 1 setcolor}
\put(0,0){\line(1,1){10}}
\put(0,10){\line(1,-1){10}}
\end{picture}
\end{document}
これも機能するようです(ただし、色に色合いを追加することはできません:
\begin{picture}(10,10)
\special{color push XC@RedSpot}
\put(0,0){\line(1,1){10}}
\put(0,10){\line(1,-1){10}}
\special{color pop XC@RedSpot}
\end{picture}