# Converting pictex to eps

I have a very old pictex code which I used more than 20 years ago with plain tex. Is there a sensible way to convert it to vector graphics (eps)?

EDIT: the sample code

\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

• Welcome to TeX.SE. Without seeing the underlying code, it's going to be difficult to provide specific advice.
– Mico
Nov 22, 2015 at 10:57
• It's pretty straightforward - basically just a planar graph with straight edges
– R W
Nov 22, 2015 at 11:25
• It is probably easier to convert your top level tex input to pstricks or tikz and get scalable drawing that way, than to convert the pictex generated diagram. Would be easier to be specific if you posted an example to test... Nov 22, 2015 at 12:46
• Yes - that's what I meant. I have added the code.
– R W
Nov 22, 2015 at 13:41

If I add \nopagenumbers to the code above, saved as graph.tex, then do

pdftex graph
pdfcrop graph


I get the following

Getting an EPS from the PDF is easy, if you really need EPS.

A rather straightforward translation into 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}


• Thank you, but this is not quite what I meant, since (as far as I understand) pictex renders lines as bunches of dots, and this is what one gets after running pdftex (the lines are jagged at high zoom levels). I would rather like to get something scalable.
– R W
Nov 23, 2015 at 11:59
• @RW Reimplementing PiCTeX to use modern tools such as TikZ/PGF can surely be done. But I don't think it's worth the pain. Nov 23, 2015 at 12:35
• @RW I added a translation into TikZ Nov 23, 2015 at 12:49