You are here: start » Snippets » tex2eps

tex2eps

The script

#!/bin/sh
 
INPUT=$1
DVI=${INPUT%.*}.dvi
 
if [ -n "$2" ]
then
        OUTPUT=$2
else
        OUTPUT=${INPUT%.*}.eps
fi
 
latex $INPUT
dvips -E -o $OUTPUT $DVI

Usage

Preparation

First create a new LaTeX document containing your PSTricks image:

\documentclass{article}
\usepackage{pst-eps}
\pagestyle{empty}
 
\begin{document}
\TeXtoEPS
% insert your PSTricks image here
\endTeXtoEPS
\end{document}

Conversion

  • tex2eps infile.tex outfile.eps – Converts infile.tex to outfile.eps
  • tex2eps file.tex – Converts file.tex to file.eps

Acknowledgements

The script was based upon the commands described in this entry on this Semibyte wiki entry and put up here so that I don't forget this stuff again ;-).

snippets/tex2eps.txt · Last modified: 2008/03/26 12:35 (external edit)