dvi -> ps -> pdf의 \special에서 별색을 사용하는 방법은 무엇입니까?

dvi -> ps -> pdf의 \special에서 별색을 사용하는 방법은 무엇입니까?

나는 환경을 사용하는 오래된 인물을 많이 가지고 있습니다 picture. 수치를 컴파일하려면 툴체인을 사용해야 합니다 dvi->dvips->ps2pdf.

rgb이 사진의 색상을 모델 색상 cmyk과 팬톤 색상으로 변경해야 합니다 . 답변을 사용하여이 질문,나는 별색을 정의합니다. 내 문제는 매크로에서 직접 사용하면 \specialPDF 뷰어(evince)에서 검은색으로 표시된다는 것입니다.

정의된 별색을 사용하도록 dvips에 어떻게 지시해야 합니까?

MWE

\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이며 특수 단어 안에 임의의 단어를 사용할 수 없으며 일반적으로 키워드입니다. 포스트스크립트를 문자 그대로 삽입하려면 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}

관련 정보