(c) 2006 Johannes Grosse jgrosse@mppmu.mpg.de
MathPSfrag is a Mathematica package that allows automatic generation of LaTeX labels for graphics exported as EPS.
To create all examples you will also have to download
CustomTicks.m
by Mark Caprio. This can be obtained from
http://library.wolfram.com/infocenter/MathSource/5599/. Note that
the example notebook also runs without it, though it will complain
once about not finding CustomTicks.m
and skip one example.
Copy MathPSfrag.m
to a place where Mathematica can find it.
(For the example file MathPSfrag-Example.nb
, it suffices to set
the $Path
variable in one of the first lines.)
Enter the path, where you want to create the example graphics
with SetDirectory
. (In MathPSfrag-Example.nb
, this is done
in one of the first lines. You will probably want to adjust the
path according to your needs.)
Inside Mathematica, run MathPSfrag-Example.nb
.
For each plot two files are created with the suffices -psfrag.tex
and -psfrag.eps
. Each pair will be merged by latex during
runtime to yield one plot with TeX labels.
Run latex MathPSfrag-Example.tex
. (In the first ten lines
there is a \graphicsdir
directive that should point to
the location of the generated graphics files. Again you will
probably want to change its definition, e.g. to ./
to make
LaTeX look for the graphics in the same directory where
MathPSfrag-Example.tex
resides.)
The manual's source as well as a PostScript or PDF version can be obtained from http://www.arxiv.org/abs/cs.GR/0510087 or one of its mirrors.
The following files are contained:
MathPSfrag.m
The actual package that allows to create LaTeX labels. It can be included by
Needs["MathPSfrag`"]
provided that the .m
file is in Mathematica's search
path ($Path
).
MathPSfrag.nb
The fully documented source of the .m
package.
MathPSfrag-Example.nb
This creates the graphics required for translating the manual and demonstrates the features provided by MathPSfrag.
MathPSfrag-Example.tex
LaTeX Document which demonstrates how to include the graphics
into a publication. There is a \graphicsdir
command within
the first ten lines that should point to the location of the
graphics files created by MathPSfrag-Example.nb
.
unpsfrag
A bash
shell script which transforms a pair of
"EPS file + tex replacement rules" to a stand-alone EPS file,
which can be included using only the usual \includegraphics
macro. However, it is better to keep the two separate files
since editing the tex replacement rules with a simple text
editor allows to change the labels without rerunning
Mathematica and unpsfrag
. Also font changes in the LaTeX
document (say \usepackage{mathpazo}
) are automatically
taken care of with the latter approach.
This script requires ps2eps
.
ex_hold-psfrag.eps
and ex_hold-psfrag.tex
The example graphics that require CustomTicks. (So you can translate the example LaTeX code without CustomTicks.)
cpc-licence.txt
The licence covering the files above.
(Non-legalese, non-binding summary:
You may use it for free as long as you do not earn money
with it and you are required to quote my paper
if you use it in a publication.)