ã¯ããã«
ã¿ãªãããEPSãã¡ã¤ã«ã使ã£ã¦ã¾ããï¼
è¿å¹´ã(La)TeXã®ææ¸ä½æã«ããã¦ã¯ããEPSãã¡ã¤ã«ã使ããªãã¨ããããã¼ã確ç«ãã¦ãã¾ãã ããã¼ã«ã¯ããã©ã«ãã§æã£ã¦ããã¨ãããã¨ã§ããã®è¨äºã§ã¯ãç¾ä»£çãªLaTeXç°å¢ã«ãããEPSãã¡ã¤ã«ã®å¯è½æ§ãæ¢ãããã¨æãã¾ãã
ãã¡ããããEPSãã¡ã¤ã«ã使ããªãã¯ãå®éã«ã¯ããã¼ã§ã¯ããã¾ããã æè¡çãªæ ¹æ ããããã¹ããã©ã¯ãã£ã¹ã®ã²ã¨ã¤ã§ãã ãããã£ã¦ããã®è¨äºã®çã®ç®çã¯ã以ä¸ã®2ç¹ã ã¨ããã¾ãã
- ãã¹ããã©ã¯ãã£ã¹ãããã¼ã¸ã¨è²¶ããªãããã«æè¡çãªèæ¯ãç¥ã
- æ¡ä»¶ãããã°EPSãã¡ã¤ã«ã«ãã¾ã ã¾ã 使ãéããããã¨ã示ã
ã³ã³ãã¥ã¼ã¿ãµã¤ã¨ã³ã¹ã«ã¯ã"All problems in computer science can be solved by another level of indirection"ï¼ãã³ã³ãã¥ã¼ã¿ç§å¦ã®ããããåé¡ã¯ãå¥ã®é層ãæããã¨ã§è§£æ±ºã§ãããï¼ã¨ããæ ¼è¨ãããã¾ã ï¼David Wheelerã¾ãã¯Butler Lampsonï¼ã ä¸è¨ã®2ã§ã¯ãMetaPostã¨ããã¢ããªã±ã¼ã·ã§ã³ãindirectionã¨ãã¦ãEPSãã¡ã¤ã«ãTeXãç´æ¥æ±ããå½¢å¼ã¨ãã¦å©ç¨ããéã示ãããã¨æãã¾ãã
ãã®è¨äºã«ã¤ãã¦
ãã®è¨äºã¯ãTeX Conf 2018ã«ã¦LTçºè¡¨ããã2018å¹´ã§ãTeXã§EPSã使ããã§è©±ãäºå®ã ã£ãå 容ã®ã¡ã¢ãæç« ã¨ãã¦æ¸ æ¸ãããTeX ï¼ LaTeX Advent Calendar 2018ãã®4æ¥ç®ã®è¨äºã¨ãã¦ã¾ã¨ãããã®ã§ãã
ãããã¦æç« ã«ãã¦ã¿ãã¨ããã®è¨äºãå稿ã¨ãã¦èªãã ãã§ã5åã§çµãããªãããªè©±ã ã£ããã
ç®æ¬¡
- ã¯ããã«
- ç®æ¬¡
- (La)TeXææ¸ã«ããã¦EPSã¯ã©ãæ±ãããã
- ãEPSãã¡ã¤ã«ã使ããªãã®æå³
- pdfTeXãdvipdfmxããã¤ãã£ãã«æ±ããEPS
- ããã¾ã§ã®ã¾ã¨ã
- ä¸è¬ã®EPSãPurified EPSã«å¤æãã
- Purified EPSãTeXã«æ¸ãæãã
- ã¾ã¨ã
(La)TeXææ¸ã«ããã¦EPSã¯ã©ãæ±ãããã
LaTeXã§ç»åãæ¿å
¥ãããã¨ãããã£ã¨ãæ´å²ãããã®ã¯ãEPSãã¡ã¤ã«ã\includegraphics
ããæ¹æ³ã§ãããã
EPSå½¢å¼ã§ç¨æããç»åãåãè¾¼ãã¨ããææ³ã¯ãLaTeX以åããTeXã®ã¨ã³ã·ã¹ãã ã§ã¯ä¸è¬çã ã£ãããã§ãplain TeXã«ãepsf.sty
ã¨ããä»çµã¿ãããã¾ãã
epsf.sty
ã®ããã¥ã¢ã«ã§ã¯éçºå±¥æ´ã触ãããã¦ããããããè¦ãã¨ãããªãåæã®ããã«ã¯ãã¼ã¹èªèº«ãæãå
¥ãã¦ããããã§ãï¼åèï¼ã
ããã§æ³¨æãå¿
è¦ãªãã§ãããTeXãã®ãã®ã«ã¯ãä¸è¬ã®EPSãã¡ã¤ã«ã解éããä»çµã¿ãããã¾ããã
\includegraphics
ãæä¾ããgraphicx
ããã±ã¼ã¸ãepsf.styã®
ä»äºã¯ããæçµçãªå°å·ãæ
ãããã¤ã¹ãã¸ã¨EPSãã¡ã¤ã«ã丸æãããã ãã§ãã
ã§ã¯ããæçµçãªå°å·ãæ ãããã¤ã¹ãã¯ãã©ããã£ã¦ä¸¸æããããEPSãã¡ã¤ã«ãç»åã«ãããã¤ã¾ããç´ã«å°å·ããããPDFã«å¤æãããããããã¯ãã¯ã¿ã¼ç»åã¨ãã¦ã¬ã³ããªã³ã°ãããããã®ã§ããããï¼ ããããããæçµçãªå°å·ãæ ãããã¤ã¹ãã¨ã¯ä½ãªã®ã§ããããï¼
æãªããã®TeXã§ããã°ãå稿ã¯DVIã¸ã¨ã³ã³ãã¤ã«ããã¾ãããããã£ã¦ãæçµçãªå°å·ãæ ãããã¤ã¹ã¯ããDVIã¦ã§ã¢ããªã©ã¨ç·ç§°ãããã½ããã¦ã§ã¢ã§ãã
DVIã¦ã§ã¢ãdvipsã§ããã°ãå稿ã§æå®ããã¦ããEPSãã¡ã¤ã«ã®ä¸èº«ã¯ãåºåãããPostScriptã«ãã®ã¾ã¾åãè¾¼ã¾ãã¾ãã ãããGhostscriptãAdobe Distillerããããã¯PostScriptããªã³ã¿ã«æ¸¡ããã¨ã§ããããã®PostScriptå¦çç³»ãæçµçãªç»åãçæãã¾ãã
DVIã¦ã§ã¢ãdvipdfmxã§ããã°ãEPSãã¡ã¤ã«ãæçµçãªç»åã«ããã®ã¯ãä¸è¬ã«ã¯Ghostscriptã¨ããPostScriptå¦çç³»ã®ä»äºã§ãã
ããã¯ãdvipdfmxã®è¨å®ãã¡ã¤ã«ï¼dvipdfmx.cfg
ï¼ã«ããä¸è¬çãªEPSãã¡ã¤ã«ããã£ããGhostscriptãèµ·åãã¦PDFã«å¤æãããã¨ããå
容ã®å¦çãããã©ã«ãã§è¨è¿°ããã¦ããããã§ãã
DVIã¦ã§ã¢ã«ã¯ãXdviãWindviããããã¯dvioutããããã¯Evinceã®ãããªãDVIããã®ã¾ã¾ç»é¢ä¸ã§ãã¬ãã¥ã¼ãããã®ãå¤ã ããã¾ãã ãããã®ã»ã¨ãã©ããPostScriptå¦çç³»ãèªåã§ãã£ã¦ããããã§ã¯ãªããå¤é¨ã®Ghostscriptãå¼ã³åºãã¦EPSãã¡ã¤ã«ãä½ããã®å½¢å¼ã®ç»åã«å¤æãã¦æç»ãã¦ãã¾ãã
ãããã®å ´åãããä¸è¬çãªEPSãã¡ã¤ã«ãæçµçãªç»åã«ããã«ã¯PostScriptå¦çç³»ãå¿ è¦ãã¨ããç¹ããã¤ã³ãã§ãã ããã¯ãEPSãã¡ã¤ã«ããããããã¯ä¸æçµµã®ããã«è¦å®ãããPostScriptã®ã³ã¼ãã£ã³ã°è¦ç´ï¼DSCãDocument Structring Conventionã¨ããã¾ãï¼ã«åºã¥ããã®ã§ãããã¨ãèããã°ãå½ç¶ã ã¨ããã¾ãã PostScriptå¦çç³»ããªãã¨ãTeXã®ã¨ã³ã·ã¹ãã ã¯ä¸è¬ã®EPSãã¡ã¤ã«ãç»åã¨ãã¦åç¾ã§ããªãã¨ããããã§ãã
ããã¦ãããã§ããPostScriptå¦çç³»ã¯ãäºå®ä¸Ghostscriptä¸æã§ãã ãããã©ã¨ã¿ãªãªã½ããã¦ã§ã¢ãå©ç¨ããã«ãPostScriptããã¼ã¹ã¨ããæè¡ãå©ç¨ãããã¨æã£ãããç¾ç¶ã§ã¯Ghostscriptã«é ¼ãããããããTeXããã®ä¾å¤ã§ã¯ãªãã®ã§ãã
ãEPSãã¡ã¤ã«ã使ããªãã®æå³
åç¯ã§è¦ãããã«ãPDFãåºåã¨ãªããããªTeXã®ã¨ã³ã·ã¹ãã ã§ã¯ãä¸è¬ã«ã¯TeXã®ã½ã¼ã¹ã§EPSãã¡ã¤ã«ãåºã¦ãããã³ã«å¤é¨ã®PostScriptå¦çç³»ï¼äºå®ä¸Ghostscriptã§ãããã¨ãå¤ãï¼ãèµ°ãã¾ãã 常èçã«èãã¦ããã¯å¹çãæªãã
ãããããç¾å¨ãã£ã¨ãåºãå©ç¨ããã¦ããTeXã®çµçã¨ã³ã¸ã³ã§ããpdfTeXã¯ããã¤ãã£ãã§PDFã®åãè¾¼ã¿ã«å¯¾å¿ãã¦ãã¾ãï¼åèï¼ã æ¥æ¬èªç°å¢ã§ã¯dvipdfmxãããå©ç¨ããã¦ãã¾ãããããããã¤ãã£ãã§PDFã®åãè¾¼ã¿ã«å¯¾å¿ãã¦ãã¾ãï¼åèï¼ã ãã®ãããEPSãã¡ã¤ã«ã¨ãã¦ç¨æããç»åããã®ã¤ã©Ghostscriptãå¼ã³åºãã¦å¦çããã®ã¯å®å ¨ãªç¡é§ã§ãããæåããGhostscriptã§PDFã«å¤æãã¦ããã°ååãªã®ã§ãã
ãããããã¾ãEPSãã¡ã¤ã«ã(La)TeXææ¸ã«åãè¾¼ãã¨ãã®ç»åã«ä½¿ããªãã¨ãã主張ã®èæ¯ã«ããäºæ ã§ãã
pdfTeXãdvipdfmxããã¤ãã£ãã«æ±ããEPS
EPSãã¡ã¤ã«ãç¾ä»£çãªTeXã®ã¨ã³ã·ã¹ãã ã«ããã¦æ±ãã«ãã代ç©ã§ããã®ã¯ç´ãããªãç¾å®ã§ãã PDFãªãTeXã¨ã³ã¸ã³ããã¤ãã£ãã§æ±ããã®ã«ãããã§EPSãã¡ã¤ã«ã使ãç¶ããã°ãGhostscriptã¨ããåä»ãªã¢ããªã±ã¼ã·ã§ã³ãä½æ¥ããã¼ã«é¢ä¸ãã¦ãã¾ãã¾ãã
ã¨ã¯ãããé·ããTeXã«ãããããã©ã«ãã®ç»åå½¢å¼ã§ãã£ãEPSãã¡ã¤ã«ãå©ç¨ããªããã°ãªããªãããã¥ã¡ã³ããããã§ãããã ã¢ããªã±ã¼ã·ã§ã³ãEPSããåºåãã¦ãããªãå ´åãããã¾ãã ãããããGhostscriptã§PDFã«ãã¦ããã°ããã¨ãè¨ãã¾ããã管çãã¦ãããã¡ã¤ã«ãPDFã§ã¯æ±ãã«ããã¨ããäºæ ããããã¾ãã ãªã«ããEPSã®ä¸èº«ã¯PostScriptã§ãããPostScriptãç¥ã£ã¦ããã°ããã¹ãã¨ãã£ã¿ã§ç´æ¥ç·¨éã§ãã¾ãã ããã¹ããã¡ã¤ã«ãªã®ã§ããã¼ã¸ã§ã³ç®¡çã«ãé½åãããã
ã¯ããã¦ãGhostscriptãèµ·åãããTeXã®ã¨ã³ã·ã¹ãã ã§PostScriptãç´æ¥å¦çãããã¨ã¯ä¸å¯è½ãªã®ã§ããããï¼
å®ã¯ãTeXã®ã¨ã³ã·ã¹ãã ã§ç´æ¥å¦çã§ãããããªEPSãã¡ã¤ã«ãããã¾ãã ãã®ãããªEPSãã¡ã¤ã«ã§ããã°ãç»åã¨ãã¦TeXã®ææ¸ä¸ã§åãè¾¼ãã§ããå¦çä¸ã«Ghostscriptãå¼ã³åºããããã¨ã¯ããã¾ããã EPSãã¡ã¤ã«ä¸ã®PostScriptããpdfTeXãdvipdfmxããç´æ¥è§£éãã¦ç»åã«ãã¦ãããã®ã§ãã
ãã®ãããªEPSãã¡ã¤ã«ã¯ãPurified EPSã¨å¼ã°ãã¦ãã¾ããç´åãããEPSã¨ããããã§ãã å ·ä½çã«ã¯ãMetaPostã¨ããã¢ããªã±ã¼ã·ã§ã³ã«ãã£ã¦çæãããEPSã ããPurified EPSã«ãªãã¾ãï¼åèï¼ã
éè¦ãã¤ãããããç®æãªã®ã§ãMetaPostã¨Purified EPSã«ã¤ãã¦ããå°ã詳ããè¦ã¦ããã¾ãããã
MetaPostã¯ããã¯ã¿ã¼ç»åãçæããããã®ããã°ã©ãã³ã°è¨èªã§ãã MetaPostã«ã¤ãã¦ã¯ã2018å¹´ã®TeX & LaTeXã¢ããã³ãã«ã¬ã³ãã¼ã®åå·ããã®è¨äºï¼åç §ï¼ãã¨ã¦ãåèã«ãªãã¾ãã ãã¨ãã°ãããã«ã©ã ããã¼ãã¨ããåºç社ã®ãã´ãã¼ã¯ãããã¾ããâ¦
ãã®ãã´ã¯ããããªæãã®MetaPostã½ã¼ã¹ã§åç¾ã§ãã¾ãã
prologues := 1; beginfig(1); drawoptions (withcolor (0.6,0.6,0.6)); linecap := butt; linejoin := mitered; fill (26.867201,14.046900)..controls (26.914101,11.453100) and (27.386700,8.511720)..(26.027300,6.519530) ..controls (23.898399,3.402340) and (19.093800,1.851560)..(15.031300,1.777340) ..controls (8.378910,1.660160) and (2.886720,6.957030)..(2.765630,13.613300) ..controls (2.644530,20.269501) and (7.945310,25.761700)..(14.597700,25.878901) ..controls (21.253901,26.000000) and (26.746099,20.703100)..(26.867201,14.046900) --cycle; drawoptions (withcolor (0,0,0)); fill (111.976997,17.812500)..controls (110.969002,18.261700) and (109.785004,17.804701)..(109.339996,16.796900) --(109.188004,16.445299)..controls (109.188004,16.445299) and (109.140999,16.339800)..(109.046997,16.132799) ..controls (108.941002,15.929700) and (108.875000,15.621100)..(108.612999,15.234400) ï¼ã¤ã¥ãï¼
ãªããMetaPostã«ããä¼¼ãååã®ã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦ãã¯ãã¼ã¹ãä½ã£ããã©ã³ãéçºã®ããã®è¨èªããã³å¦çç³»ã®MetaFontãããã¾ãã ååãããä¼¼ã¦ãããã¨ãããããã¨ãããMetaPostã¯MetaFontã«å½±é¿ãåãã¦ãã¾ããããã£ã¨ãã£ã¨æ°ããæ代ã«å¥ã®äººãä½ã£ãå¥ã®ã¢ããªã±ã¼ã·ã§ã³ã§ãã å®éãMetaFontã¯PostScriptã«åãè¾¼ãããããããããã©ã³ããçæããã®ã«å¯¾ããMetaPostã¯PostScriptãEPSãã¡ã¤ã«ã¨ãã¦çæãã¾ãï¼MetaPostã®Postã¯PostScriptã®Postã§ãï¼ã
MetaPostã®å¦ç系㯠mpost
ã¨ããã³ãã³ãã§ãã
ä¸è¨ã®MetaPostã®ã½ã¼ã¹ãã¡ã¤ã«logo.mp
ãmpost
ã³ãã³ãã«æå®ãã¦æ¬¡ã®ããã«å®è¡ããã¨ãEPSãã¡ã¤ã«ãçæããã¾ãã
$ mpost logo.mp This is MetaPost, version 2.00 (TeX Live 2018) (kpathsea version 6.3.0) (/usr/local/texlive/2018/texmf-dist/metapost/base/mpost.mp (/usr/local/texlive/2018/texmf-dist/metapost/base/plain.mp Preloading the plain mem file, version 1.005) ) (./logo.mp [1{psfonts.map}] ) 1 output file written: logo.1 Transcript written on logo.log. $ ls logo.mp logo.1 logo.log
æ¡å¼µåã.eps
ã®ãã¡ã¤ã«ãããã¾ããããlogo.1
ã¨ããã®ãMetaPostã«ãã£ã¦çæãããEPSãã¡ã¤ã«ã§ãã
ä¸èº«ãè¦ãã¨ã以ä¸ã®ããã«ãã馴æã¿ã®PostScriptã³ãã³ãã¨PostScriptã³ã¡ã³ãï¼%%
ã®ã¹ã¿ã¤ã«ã¯æ£ç¢ºã«ã¯DSCã³ã¡ã³ãã¨ããã¾ãï¼ããªããã EPSãã¡ã¤ã«ã§ãããã¨ããããã¾ãã
%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 -1 114 94 %%HiResBoundingBox: 0.00034 -0.00009 113.16754 93.72906 %%Creator: MetaPost 2.00 %%CreationDate: 2018.12.04:1520 %%Pages: 1 %%BeginProlog %%EndProlog %%Page: 1 1 0.6 0.6 0.6 setrgbcolor newpath 26.8672 14.0469 moveto 26.91411 11.4531 27.3867 8.51172 26.0273 6.51953 curveto 23.89839 3.40234 19.0938 1.85156 15.0313 1.77734 curveto 8.3789 1.66016 2.88672 6.95703 2.76563 13.6133 curveto 2.64453 20.2695 7.94531 25.7617 14.5977 25.8789 curveto 21.2539 26 26.7461 20.7031 26.8672 14.0469 curveto closepath fill 0 0 0 setrgbcolor newpath 111.97699 17.8125 moveto 110.96901 18.2617 109.785 17.8047 109.34 16.7969 curveto 109.188 16.4453 lineto 109.188 16.4453 109.141 16.3398 109.047 16.1328 curveto ï¼ã¤ã¥ãï¼
ãã®ãMetaPostãçæããEPSãããããPurified EPSã®æ£ä½ã§ãã æ®å¿µãªããPurified EPSã®æ確ãªä»æ§ã¯ããããããªãã®ã§ãããMetaPostã®ããã¥ã¢ã«ã§ãPurified EPSãã¨åã¥ãããã¦ãããã¨ããããMetaPostãçæããEPSãPurified EPSãã ã¨èãã¦åé¡ãªãã§ãããã
PostScriptã¨ãã¦è¦ãã°ãPurified EPSã¯ãã«ã®EPSããæ©è½ãåãåã£ãDSCã§ãããEPSãã¡ã¤ã«ã®ãµãã»ããã¨ããã¾ãã ãããã£ã¦ãé常ã®EPSã¨åãããã«æ±ãã¾ãã
ããã«ç¹çãã¹ãç¹å¾´ã¨ãã¦ãPurified EPSã¯ãpdfTeXï¼ããã³LuaTeXï¼ãdvipdfmxã«å®å ¨ãªå¦çç³»ãå®è£ ããã¦ãã¾ãã ãããä½ãæå³ãããã¨ããã¨ããTeXã¨ã³ã¸ã³ã«PostScriptã®å¦çç³»ãå®è£ ããã¦ããªãã®ã§EPSãã¡ã¤ã«ã¯ä½¿ãã¹ãã§ã¯ãªããã¨ãããã¹ããã©ã¯ãã£ã¹ããPurified EPSã«ã¯é©ç¨ãããªãã®ã§ãã Purified EPSã¯ããããTeXã®ã¨ã³ã·ã¹ãã ã§ç©æ¥µçã«ä½¿ã£ã¦ããå½¢å¼ã§ããã¨ããããã¾ãã
ã¡ãªã¿ã«ãdvipdfmxã«è³ã£ã¦ã¯ããã®å称ã«åããï¼DVIã§ã¯ãªãï¼çã®Purified EPSãåãåã£ã¦PDFã«å¤æãããªãã·ã§ã³ã¾ã§ç¨æããã¦ãã¾ãã
$ dvipdfmx -M logo.1 # dvipdfmxã«ãDVIãã¡ã¤ã«ã§ã¯ãªãEPSãã¡ã¤ã«ï¼ãã ãPurifiedï¼ã渡ããï¼ logo.1 -> logo.1.pdf 4105 bytes written
ããã¾ã§ã®ã¾ã¨ã
ããã¾ã§ã®è©±ãã¾ã¨ãã¾ãããã
- ä¸è¬ã®EPSãã¡ã¤ã«ã¯ãå®å ¨ãªPostScriptã®å¦çç³»ãæããªãTeXã®ã¨ã³ã·ã¹ãã ã§ã¯ç´æ¥æ±ããªãã®ã§ãå¿ è¦ãªå ´åã«ã¯å¤é¨ã¢ããªã±ã¼ã·ã§ã³ã§ããGhostscriptããã®ã¤ã©èµ·åãã¦å¦çãæãã¦ãã
- ãããããEPSãã¡ã¤ã«ãPDFã«ãã¦ããã°ãç¾ä»£çãªTeXã®ã¨ã³ã·ã¹ãã ã¯PDFãç´æ¥æ±ããã®ã§ããã®ã¤ã©Ghostscriptãèµ·åããããã¨ã¯ãªããªãï¼ãããç¾å¨ã®TeXã¯ã¼ã¯ããã¼ã®ä¸»æµï¼
- ããããããã¹ããã¡ã¤ã«ã§ããEPSãã¡ã¤ã«ã«ã¯ãPDFã«ãªãå©ç¹ããã
- ã¨ããã§ãMetaPostãçæããEPSï¼Purified EPSï¼ã§ãã°ãç¾ä»£çãªTeXã®ã¨ã³ã·ã¹ãã ã«å®å ¨ãªå¦çç³»ãå èµããã¦ãã
ãã®ããã«ç¶æ³ãæ´çããã¨ããã®ã¤ã©Ghostscriptãèµ·åãããã¨ãããã³ããè² ããã«ãããã¹ããã¡ã¤ã«ã¨ãã¦ã®æ±ããããã ãã享åã§ããããããªä½æ¥ããã¼ã®å¯è½æ§ããããã¨ã«æ°ã¥ãã¾ãã ãããä¸è¬ã®EPSãã¡ã¤ã«ããå¯è½ãªå ´åã«ã¯Purified EPSã«å¤æãã¦ãã¾ãã°ããã®ã§ãã
ä¸è¬ã®EPSãPurified EPSã«å¤æãã
ãã°ããpurifyepsã¨ãããã¼ã«ãããã¾ãããã®åã®ã¨ãããEPSãã¡ã¤ã«ãpurifyãã¦ãããã¦ã¼ãã£ãªãã£ã§ãã TeX Liveã«å ¥ã£ã¦ããã®ã§ããµã¤ãã«TeXç°å¢ãã¤ã³ã¹ãã¼ã«ãã¦ããã°å©ç¨å¯è½ã§ãï¼åèï¼ã
ãã®purifyepsãå®æ ã¯ãpstoeditã¨mpostã¨ããå¥ã ã®ãã¼ã«ãé çªã«å¼ã³åºãã ãã®Perlã¹ã¯ãªããã§ãã å段ã®pstoeditããEPSãã¡ã¤ã«ãMetaPostã®ã½ã¼ã¹ãã¡ã¤ã«ã«å¤æãã¦ããã¾ãã å¾æ®µã®mpostã¯ãMetaPostã®å¦çç³»ãã®ãã®ã§ãã å段ã®pstoeditã§çæãããMetaPostã®ã½ã¼ã¹ãã¡ã¤ã«ããå¾æ®µã®mpostã«ããã¦ãPurified EPSãåºåãããã¨ãã寸æ³ã§ãã
purifyepsã使ãã«ã¯ãpstoeditã«ãã©ã³ãããããæå®ãã¦ããã¨ã®EPSãã¡ã¤ã«ã§ä½¿ããã¦ãããã©ã³ããmpostãç¥ã£ã¦ãããã©ã³ãåã«ç½®ãæãã¦ãããå¿
è¦ãããã¾ãã
ããã¯mpost.fmp
ã¨ãã¦ãããªãé·å¤§ãªãã¡ã¤ã«ãpstoeditã«ä»éãã¦ããã¯ãã§ãã
ãããããã®ããã©ã«ãã®mpost.fmp
ã«ç»é²ããã¦ããªããã©ã³ããEPSãã¡ã¤ã«ã§ä½¿ããã¦ãããã対å¿ããtfmãèªåã®ç°å¢ã«æã£ã¦ããªãã£ããããã¨ãå¤æãã³ã±ã¾ãã
ãã®å ´åã¯ãã¨ã©ã¼ã¡ãã»ã¼ã¸ããã¨ã«ãPostScriptãã©ã³ãåã¨å¯¾å¿ããtfmåãããªãè¡ãmpost.fmp
ã«è¿½è¨ãã¦ãããã°ãã¨ããããéãã¾ãã
対å¿ããtfmåã¯ãã¶ã£ã¡ãããªãã§ãããã®ã§ãã¨ããããcmr10ã§ãæå®ãã¦ããã¦å¤æãéãã¦ã¿ã¾ãããã
ãã¨ãã¡ãã£ã¨ç½ ããã£ã¦ãç´ ã®purifyepsã ã¨Ghostscriptãæå³ä¸æãªã¨ã©ã¼ãåãåºãå¯è½æ§ãããã¾ãã
ããã¯ãpstoeditã§Ghostscriptã®DELAYBIND
ãªãã·ã§ã³ãæã«æå®ããã¦ããããã§ãã
DELAYBIND
ã¯ãPostScriptã®bind
ã³ãã³ãã®åä½ãã¡ãã£ã¨å¤ãããã¨ã§ãæ¨æºã©ã¤ãã©ãªã®ã³ãã³ãåãä¸æ¸ããã¦ãããããªå ´åã§ãåé¡ãªãæ±ããããã«ããããã®Ghostscriptç¬èªã®ä»æãã§ãï¼åèï¼ã
ããããAdobe Distillerãé ãæã£ã¦ããinternaldict
è¾æ¸ãæä½ããsuperexec
ã¨ããã³ãã³ããsystemdict
ã«ãã£ãã®ãåãé¤ããã¨ãã«ãå¯ä½ç¨ãããã®ã§åãé¤ããã¦ãã¾ãã¾ããï¼åèï¼ã
çµæã¨ãã¦ãAdobe Illustratorãªã©ã§çæãããEPSã®å¤ãã¯ãç´ ã®pstoeditï¼ãããã£ã¦purifyepsï¼ã§å¤æãããã¨ããã¨æå³ä¸æãªPostScriptã¨ã©ã¼ãåãåºãã¦çµäºããããã§ãã
pstoeditã¯ãDELAYBIND
ãç¡å¹ã«ããGhostscriptã®-dNOBIND
ãªãã·ã§ã³ãæå¹ã«ããããã«ã-nb
ã¨ãããªãã·ã§ã³ãæå®ãã¦ããã¾ãã
ãããããããpurifyepsããå®ç¾ããæ段ã¯ããã¾ããã
ãã®ãããpurifyepsã®ã½ã¼ã¹ã§pstoeditãå¼ã³åºãã¦ããç®æã«ç´æ¥-nb
ãªãã·ã§ã³ãæ¸ãå ãããããªãããã§ãã
以ä¸ã®ããã«pstoeditãå¼ã³åºãã¦ããç®æãããã¯ããªã®ã§ãããã«-nb
ãªãã·ã§ã³ã追è¨ãã¾ãããã
ï¼çç¥ï¼ # Utilize pstoedit to convert from EPS to MetaPost. my $mpfile = $tempbase . ".mp"; executeCommand "pstoedit -ssp -mergetext -f mpost -fontmap \"$fontmap\" \"$infile\" \"$mpfile\""; ï¼çç¥ï¼
Perlã¹ã¯ãªãããªã®ã§ããã¹ãéã£ã¦ãããã£ã¬ã¯ããªã«ããpurifyepsã¨ãããã¡ã¤ã«ãç´æ¥ããã£ã¦ãã¾ãã°ç®çã¯éæããã¾ãã
Purified EPSãTeXã«æ¸ãæãã
ãããã¦å¤æã§ããPurified EPSã¯ã\includegraphic
ã§èªã¿è¾¼ãã§ããGhostscriptãèµ·åãããã¨ããªãpdfTeX/LuaTeXãdvipdfmxã ãã§PDFã®ç»åã«ãªãã¾ãã
å¤æåã®ä¸è¬ã®EPSãã¡ã¤ã«ãèªã¿è¾¼ãã ã¨ãã«æ¯ã¹ã¦ãçéã§å¦çãçµããã¾ãã
ããã§æºè¶³ãã¦ããããã§ãããããã§ããã«ãPurified EPSãTeXã½ã¼ã¹ãã®ãã®ã«å¤æã§ããªããèãã¦ã¿ã¾ãããã
ãªãã§ãããªãã¨ãèãããã¨ããã¨ãç»åãå¤é¨ãã¡ã¤ã«ã§ã¯ãªãTeXã½ã¼ã¹ã§æã£ã¦ãããã¨ã«ã¯ã次ã®ãããªã¡ãªãããèããããããã§ãã
- æ¬æã¨åãã¹ãã¼ã ã§å³ä¸ã®ãã©ã³ããæ±ããï¼æ°å¼ãæ¥æ¬èªãï¼
- å³ä¸ã®é·æãçµçãã¦ããããï¼æ°å¼ãæ¥æ¬èªãï¼
- å³ä¸ã§è注ãç¸äºåç §ãç´¢å¼ã使ãã
ã¤ã¾ããã¡ãªãããããªãã è£è¶³ãã¦ããã¨ãå®ã¯ããã¾ã§ã®è©±ã¯ãã¹ã¦å³ä¸ã®ãã©ã³ããASCIIã§ãããã¨ãåæã¨ãã¦ãã¦ãEPSãã¡ã¤ã«ä¸ã§æ¥æ¬èªã使ããã¦ããã¨purifyepsãæ¥æ¬èªãã¢ã¦ãã©ã¤ã³åãã¦ãã¾ãã®ã§ããã ããTeXã½ã¼ã¹ã«ã§ãã¦ãã¾ãã°ãæ¥æ¬èªã使ããããã«è¨å®ããTeXã§å¦çããã ãã§å³ä¸ã«æ¥æ¬èªãåãè¾¼ãã¾ãã
幸ããæè¿ã®TeXã«ã¯ãPGFã¨ããé«åº¦ãªãã¯ã¿ã¼ç»åã®ããã®ä»çµã¿ãããã¾ãã PGFã¯ã人éãæ¸ãã¨ãã«ã¯TikZã¨ããç¬èªã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ãã®ã§ãããPGFãã®ãã®ã¯ããªãPostScriptã«è¿ãã·ã³ã¿ãã¯ã¹ã§ãããããã«ãç´æ¥å¤æã§ããããªé°å²æ°ããã¾ãï¼åèï¼ã ãããå©ç¨ããã°ãPurified EPSãTeXã®ãã¯ãã«ã§ãããã§ãã
åããã¨ãèãã人ã¯ãããã®ã§ããã§ã«eps2pgfã¨ããJava製ã®å¤æãã¼ã«ãä½ã£ã¦ãã人ãéå»ã«ãã¾ããï¼åèï¼ã ç¾å¨ã¯Sourceforgeã«ãã¹ãããã¦ãããã®ã®ã½ã¼ã¹ããªãç¶æ ã§ãã¡ã³ããããã¦ãªããããªãã§ãããã¨ãããããã¦ã³ãã¼ããã¦ä½¿ã£ã¦ã¿ãã¨ãããªãã«æºè¶³ã®ããçµæãå¾ããã¾ããã
$ java -jar eps2pgf.jar logo.1 -o logo.tex
çµæã¨ãã¦çæãããTeXãã¡ã¤ã«ã¯ã pgfpicture ç°å¢ã«PGFã®ã³ãã³ãã並ãã ãããªç¶æ ã§ãã
% Created by Eps2pgf 0.7.0 (build on 2008-08-24) on Tue Dec 04 15:38:00 JST 2018 \begin{pgfpicture} \pgfpathmoveto{\pgfqpoint{0cm}{-0cm}} \pgfpathlineto{\pgfqpoint{3.992cm}{-0cm}} \pgfpathlineto{\pgfqpoint{3.992cm}{3.307cm}} \pgfpathlineto{\pgfqpoint{0cm}{3.307cm}} \pgfpathclose \pgfusepath{clip} \definecolor{eps2pgf_color}{rgb}{0.6,0.6,0.6}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color} \pgfpathmoveto{\pgfqpoint{0.948cm}{0.496cm}} \pgfpathcurveto{\pgfqpoint{0.949cm}{0.404cm}}{\pgfqpoint{0.966cm}{0.3cm}}{\pgfqpoint{0.918cm}{0.23cm}} \pgfpathcurveto{\pgfqpoint{0.843cm}{0.12cm}}{\pgfqpoint{0.674cm}{0.065cm}}{\pgfqpoint{0.53cm}{0.063cm}} \pgfpathcurveto{\pgfqpoint{0.296cm}{0.059cm}}{\pgfqpoint{0.102cm}{0.245cm}}{\pgfqpoint{0.098cm}{0.48cm}} \pgfpathcurveto{\pgfqpoint{0.093cm}{0.715cm}}{\pgfqpoint{0.28cm}{0.909cm}}{\pgfqpoint{0.515cm}{0.913cm}} \pgfpathcurveto{\pgfqpoint{0.75cm}{0.917cm}}{\pgfqpoint{0.944cm}{0.73cm}}{\pgfqpoint{0.948cm}{0.496cm}} \pgfpathclose \pgfusepath{fill} \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color} \pgfpathmoveto{\pgfqpoint{3.95cm}{0.628cm}} \pgfpathcurveto{\pgfqpoint{3.915cm}{0.644cm}}{\pgfqpoint{3.873cm}{0.628cm}}{\pgfqpoint{3.857cm}{0.593cm}} ï¼ã¤ã¥ãï¼
ããã¯ããå®å ¨ã«TeXãªã®ã§ãuplatexã§ãpdflatexã§ã好ããªãã®ã§PDFã«ããã°ããã§ãããã ãã¡ããããµã¤ãã«TeXã½ã¼ã¹ã¨ãã¦ç·¨éã§ããã®ã§ãLaTeXã®ããã±ã¼ã¸ã®æ©è½ããã«ã«ä½¿ãã¾ãã
% Created by Eps2pgf 0.7.0 (build on 2008-08-24) on Tue Dec 04 15:38:00 JST 2018 \begin{pgfpicture} \pgfpathmoveto{\pgfqpoint{0cm}{-0cm}} \pgfpathlineto{\pgfqpoint{4cm}{-0cm}} \pgfpathlineto{\pgfqpoint{4cm}{4.0cm}} \pgfpathlineto{\pgfqpoint{0cm}{4.0cm}} \pgfpathclose \pgfusepath{clip} % è¿½è¨ \pgftext[x=2cm,y=3.7cm,rotate=0]{% \fontsize{12}{12}\selectfont\parbox{4cm}{\centering ã©ã ããã¼ã}} \pgftext[x=2.12cm,y=2.5cm,rotate=-65]{% \fontsize{18}{10}\selectfont\scsnowman[hat=true,muffler=red,arms=true]} \pgftext[x=3.73cm,y=0.95cm,rotate=80]{% \fontsize{18}{10}\selectfont\scsnowman[hat=true,muffler=red,arms=true]} % ããã¾ã§è¿½è¨ \definecolor{eps2pgf_color}{rgb}{0.6,0.6,0.6}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color} \pgfpathmoveto{\pgfqpoint{0.948cm}{0.496cm}} \pgfpathcurveto{\pgfqpoint{0.949cm}{0.404cm}}{\pgfqpoint{0.966cm}{0.3cm}}{\pgfqpoint{0.918cm}{0.23cm}} \pgfpathcurveto{\pgfqpoint{0.843cm}{0.12cm}}{\pgfqpoint{0.674cm}{0.065cm}}{\pgfqpoint{0.53cm}{0.063cm}} \pgfpathcurveto{\pgfqpoint{0.296cm}{0.059cm}}{\pgfqpoint{0.102cm}{0.245cm}}{\pgfqpoint{0.098cm}{0.48cm}} \pgfpathcurveto{\pgfqpoint{0.093cm}{0.715cm}}{\pgfqpoint{0.28cm}{0.909cm}}{\pgfqpoint{0.515cm}{0.913cm}} \pgfpathcurveto{\pgfqpoint{0.75cm}{0.917cm}}{\pgfqpoint{0.944cm}{0.73cm}}{\pgfqpoint{0.948cm}{0.496cm}} \pgfpathclose \pgfusepath{fill} \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color} \pgfpathmoveto{\pgfqpoint{3.95cm}{0.628cm}} \pgfpathcurveto{\pgfqpoint{3.915cm}{0.644cm}}{\pgfqpoint{3.873cm}{0.628cm}}{\pgfqpoint{3.857cm}{0.593cm}} ï¼ã¤ã¥ãï¼
以ä¸ã§ãPostScriptãããç¨åº¦èªãã¦ãã¸ã¨ãæã§èª¿æ´ããæ°åã¨ãã©ã³ãã®ä½ç½®ã微調æ´ããå¿èåããã人ã«ã¨ã£ã¦ã¯ãå®ã«å¿«é©ãªããã¹ããã¼ã¹ã®å³ç°å¢ãå¾ããããã¨ããããã¾ããã
ã¾ã¨ã
MetaPostããã®ã¾ã¾ä½å³ã®ããã®ãã¼ã«ã¨ãã¦ä½¿ãã«ã¯ãã¼ãã«ãé«ããã§ãããç»åç·¨éã½ããã§çæããEPSãã¡ã¤ã«ãæ¬ç¨¿ã®ææ³ã§TeXã«ããããã®ä¸éå½¢å¼ã¨ãã¦ã¯é åãããã¾ããã
ãã ãããã®å¤æãã¹ã«ããpstoeditã¨ããå½¢ã§Ghostscriptãé¢ä¸ãã¾ããTeXã¯Ghostscriptããé¢ãã¦ã¯çãã¦ãããªãã®ã§ãã
ã¨ããã§ã©ã ããã¼ãã¨ããä¼ç¤¾ã§ã¯ããå¤ãEPSãæ´»ç¨ãã¦ããã¥ã¡ã³ããä½ããããã¨ãã£ããä»äºãããããªæãã§ããã¨å¹çããå¼ãåãããã¨ãå¯è½ã§ãã èè ãåæã®ã½ã¼ã¹ã«ããã¡ã¿æ å ±ããã«æ´»ç¨ãããããã¼ã¸ã§ã³ç®¡çãããããã¹ãæãã®ã§äººåã§å¤æããããªããã¨ãã£ãããã¥ã¡ã³ãé¢é£ã®ãæ©ã¿ãããã¾ããããä¸è¨ã®ãã©ã¼ã ãããé£çµ¡ãã ããã