将 pictex 转换为 eps

将 pictex 转换为 eps

我有一个非常古老的 pictex 代码,20 多年前我曾用过纯 tex。有没有合理的方法将其转换为矢量图形 (eps)?

编辑:示例代码

\input pictex

$$
\beginpicture
\setcoordinatesystem units <.6mm,1.1mm>
\setplotarea x from -64 to 104, y from 9 to 38
\arrow <6pt> [.2,.67] from 2 2 to 40 40
\setlinear \plot 32 32 62 2 /
\setlinear \plot 60 4 58 2 /
\arrow <6pt> [.2,.67] from 99 29 to 88 40
\setlinear \plot 66 2 96 32 /
\setlinear \plot 70 2 68 4 /
\setdashes  <2pt>
\linethickness =.3pt
\putrule from -2.2 4 to 102 4
\setsolid
\put {$\vdots$} at 32 0
\put {$\dots$} [l] at 103 24
\multiput{${\bullet}$} at 32 32  96 32
                        16 16  48 16  80 16
          8 8  24 8  40 8  56 8  72 8  88 8
          4 4  12 4  20 4  28 4  36 4  44 4
         52 4  60 4  68 4  76 4  84 4  92 4 /
\endpicture
$$

\bye

答案1

如果我添加\nopagenumbers上面的代码,保存为graph.tex,然后执行

pdftex graph
pdfcrop graph

我得到以下

在此处输入图片描述

如果您确实需要 EPS,那么从 PDF 获取 EPS 很容易。

相当直接地翻译成 TikZ/PGF:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[x=.6mm,y=1.1mm]
\draw[->] (2,2)--(40,40);
\draw (32,32)--(62,2);
\draw (60,4)--(58,2);
\draw[->] (99,29)--(88,40);
\draw (66,2)--(96,32);
\draw (70,2)--(68,4);
\draw[dashed] (-2.2,4)--(102,4);
\node at (32,0) {$\vdots$};
\node at (103,24) {$\dots$};
\foreach \x/\y in {
  32/32, 96/32, 16/16, 48/16, 80/16, 8/8,
  24/8, 40/8, 56/8, 72/8, 88/8, 4/4, 12/4,
  20/4, 28/4, 36/4, 44/4, 52/4, 60/4, 68/4,
  76/4, 84/4, 92/4
} { \node at (\x,\y) {$\bullet$}; }
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容