PURIFYEPS(1)

๐Ÿ“ฆ version 2026.0, in alpine 3.24

๐Ÿ’– NAME ๐Ÿ’–

purifyeps โ€” the girlboss utility that makes an Encapsulated PostScript file work with both dvips and pdflatex. yes bestie, both. at the same time. no cap. ๐Ÿ’…


โœจ SYNOPSIS โœจ

purifyeps --help

purifyeps --version

purifyeps [--fontmap=.fmp file] [.eps input file [.eps output file]]

purifyeps --make-man[=filename] [--section=section]

purifyeps --make-ps-man[=filename] [--section=section]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so here's the tea. โ˜• pdflatex has a bunch of genuinely cute features, but its biggest glow-down compared to standard latex+dvips is that it is unable to read ordinary Encapsulated PostScript (EPS) files โ€” and EPS is literally the most common graphics format in the whole LaTeX world. it's giving tragedy. ๐Ÿ˜ญ

pdflatex can read only the following types of graphics files:

  • PDF โ€” most people who use pdflatex convert their documents to PDF using a utility such as epstopdf. this works great and preserves the vector nature of the original EPS. unfortunately, dvips does not read PDF, so if your document has to be processed with both latex+dvips and pdflatex, you have to maintain two versions of the graphic. pain.
  • PNG โ€” PNG is a bitmap format and therefore scales poorly (blurry era, we don't claim her). also, dvips does not read PNG, so again: two versions of the graphic must be maintained if you want both latex+dvips and pdflatex to work. ๐Ÿ™ˆ
  • JPEG โ€” JPEG is a bitmap format and therefore scales poorly. also, dvips does not read JPEG, so two versions of the graphic must be maintained if the document is to be processed with both latex+dvips and pdflatex.
  • MPS โ€” probably the least-used pdflatex-compatible graphics format, ngl. MPS is actually a stylized version of EPS that MetaPost outputs. like PDF, MPS is a vector format and remains as such when imported into a pdflatex document. and also like PDF, dvips does not read MPS, so two versions of the graphic must be maintained if the document is to be processed with both latex+dvips and pdflatex.

so yeah. rough out here. ๐Ÿ˜ฎโ€๐Ÿ’จ

but here's the insight behind purifyeps, and it ate: there are only a few, small differences between MPS and EPS, and a file can be converted into a format that matches both the MPS and EPS specifications simultaneously. icon behavior, honestly.

purifyeps inputs an EPS file, uses pstoedit's "mpost" filter to convert the file to MetaPost (.mp), runs mpost on the file to convert it to MPS, and finally performs some touchups on the result to convert the file back to EPS โ€” all while preserving its ability to be parsed by pdflatex. โœจ


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • --help โ€” displays "Usage" and "Options" from the purifyeps documentation.
  • -V, --version โ€” displays the purifyeps version number, copyright, and license. the receipts, basically. ๐Ÿงพ
  • --fontmap=.fmp file โ€” specifies the name of a file that tells purifyeps how to map from TeX font names to PostScript font names. [Default: mpost.fmp]
  • --make-man [=filename]] [--section=section] โ€” automatically creates a Unix man page for purifyeps. section specifies the section [default: 1 (User Commands)]. filename defaults to purifyeps.1 or an analogous filename if section is specified.
  • --make-ps-man [=filename]] [--section=section] โ€” automatically creates a PostScript version of the purifyeps documentation. the documentation is formatted like a Unix man page. section specifies the section [default: 1 (User Commands)]. filename defaults to purifyeps.ps.

in normal operation (i.e., when not run with "--help", "--make-man", or "--make-ps-man"), purifyeps takes the name of an input file and an output file. ๐Ÿ’ซ the same filename can safely be used for both files โ€” she's chill like that. if the output filename is omitted, output will go to the standard output device. if the input filename is omitted, purifyeps will read from the standard input device.


๐ŸŒธ EXAMPLES ๐ŸŒธ

create a PostScript version of the purifyeps documentation, but call it happydoc.ps instead of the default, purifyeps.ps:

purifyeps --make-ps-man=happydoc.ps

create a Unix man page for purifyeps (in the usual roff format), but indicate that it belongs in section "LOCAL" instead of the default of section 1:

purifyeps --make-man --section=LOCAL

purify sample.eps (mpost.fmp is in the current directory):

purifyeps sample.eps sample.eps

purify sample.eps (mpost.fmp is in a different location):

purifyeps --fontmap=/usr/share/pstoedit/mpost.fmp sample.eps sample.eps

rename the purified version while purifying:

purifyeps sample.eps sample-pure.eps

do the same, but in a Unix pipeline:

cat sample.eps | purifyeps > sample-pure.eps

when you run purifyeps, you should see the output from both pstoedit and mpost, followed by a success message from purifyeps:

% cat sample.eps | purifyeps > sample-pure.eps
pstoedit: version 3.30 / DLL interface 107 (build Mar 14 2002) :
Copyright (C) 1993 - 2001 Wolfgang Glunz
Interpreter finished. Return status 0
This is MetaPost, Version 0.641 (Web2C 7.3.1)
(/tmp/purifyeps-jdeGPkh9.mp [1] )
1 output file written: purifyeps-jdeGPkh9.1
Transcript written on purifyeps-jdeGPkh9.log.

File seems to have been purified successfully.

๐Ÿ“ FILES ๐Ÿ“

  • mpost.fmp โ€” file containing mappings between TeX and PostScript font names. see "NOTES" for a description of this file's contents. ๐Ÿ‘€

๐Ÿ’€ BUGS ๐Ÿ’€

error reporting could definitely stand to be improved, bestie. ๐Ÿ˜ญ error messages produced by pstoedit and mpost are sometimes silently ignored. also, errors sometimes cause purifyeps to leave temporary files (purifyeps-#####) lying around. she's messy like that sometimes.

purifyeps is subject to all of the limitations that affect pstoedit and especially the "mpost" backend to pstoedit. as a result, purifyeps ignores certain PostScript constructs, such as nonuniformly scaled text.


๐Ÿงš NOTES ๐Ÿงš

purifyeps needs a file that tells it how to map from TeX font names to PostScript font names. this file must contain two, space-separated columns. the first lists a PostScript font name, and the second lists the TeX equivalent. blank lines and lines that start with "%" are ignored. the following is a sample .fmp file:

% This is a sample font map for purifyeps.
Times-Bold                           ptmb
Times-Italic                         ptmri
Times-Roman                          ptmr
Helvetica                            phvr
Helvetica-Bold                       phvb
Helvetica-Oblique                    phvro
Courier                              pcrr
Courier-Bold                         pcrb
Courier-Oblique                      pcrro

note that this is exactly the same format that pstoedit uses. by default, purifyeps looks in the current directory for a font map called mpost.fmp. the "--fontmap" command-line option tells purifyeps to use a different font map, which will typically be the mpost.fmp file that comes with pstoedit. ๐Ÿซถ

once you create purified EPS files with purifyeps, you need to instruct pdflatex to use them. the pdfLaTeX configuration of the "graphics" and "graphicx" packages (pdftex.def) normally ignores .eps files. putting the following LaTeX code in your document's preamble tells pdflatex that all .eps files are in MPS format:

% Tell pdfLaTeX that all .eps files were produced by MetaPost.
\usepackage{graphicx} % or graphics
\usepackage{ifpdf}
\ifpdf
  \DeclareGraphicsRule{.eps}{mps}{*}{}
  \makeatletter
    \g@addto@macro\Gin@extensions{,.eps}
  \makeatother
\fi

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

dvips(1), epstopdf(1), latex(1), mpost(1), pdflatex(1), pstoedit(1)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Scott Pakin, scott+peps@pakin.org


aww and that's the whole page, bestie!! ๐Ÿฅน this was purifyeps version v1.1, dated 2010-11-28. thanks for reading, you're literally the main character of this man page now. slay, periodt, go purify some EPS files. ๐Ÿ’–โœจ๐ŸŽ€
๐Ÿ“ฆ where this page comes from