It is possible to have MetaPost generate structured PostScript directly
by including the command prologues:=1;
at the beginning of the
MetaPost input.
However, this "generally doesn't work when you use TeX
fonts."1
This is a significant problem if your labels contain math mode
material, and you haven't already taken steps to ensure that appropriate
fonts will be used in the PS output.
In the following, I describe the only way I've found to convert an EPS image to PNG format while still using TeX fonts. There may be other and better ways of doing this, but I haven't found them.
3DLDFmp.1
Include the EPS image in a TeX file
which looks like this:
\advance\voffset by -1in \advance\hoffset by -1in \nopagenumbers \input epsf \epsfverbosetrue \def\epsfsize#1#2{#1} \setbox0=\vbox{\epsffile{3DLDFmp.1}} \vsize=\ht0 \hsize=\wd0 \special{papersize=\the\wd0,\the\ht0} \box0 \bye
Do not name this file 3DLDFmp.1.tex
!
While this worked fine for me on a DECalpha Personal Workstation
running under Tru64 Unix 5.1, with TeX, Version 3.1415
(C version 6.1), and dvipsk 5.58f,
it failed on a PC Pentium II XEON under Linux 2.4,
with TeX, Version 3.14159 (Web2C 7.4.5), and
dvips(k) 5.92b, kpathsea version 3.4.5,
with the following error message:
``No BoundingBox comment found in file examples.1; using defaults''
The resulting PS image had the wrong size and the the graphic was positioned improperly.
Apparently, it confuses the EPSF macros when the name of an
included image is the same as \jobname
.
So, for this example, let's call it 3DLDFmp.1_.tex
.
You don't really need to call the macro \epsfverbosetrue
. If you
do, it will print the measurements of the bounding box and other information
to standard output.2
tex 3DLDFmp.1_.tex
.
dvips -o 3DLDF.1.ps 3DLDFmp.1_.dvi
.
convert 3DLDF.1.ps 3DLDFmp.1.png
.
display
' utility, which can be used to display the
PNG image:
display 3DLDFmp.1.png
It can be included in an HTML document as follows:
<img src="3DLDFmp.1.png" alt="[Fig. 1]."
Please note! The PNG files for this manual are now called
filename 3DLDF1.png
, 3DLDF2.png
, ...,
3DLDF199.png
,
because I wasn't able to write files
with names like 3DLDFmp.<
number>.png
to a CD-R (Compact
Disk, Recordable), when `number' had more than one digit.