# [texhax] How to add math text to existing ps figure file

Pavel Minev Penev pavpen at berkeley.edu
Tue Jul 20 05:32:34 CEST 2004

On Mon, Jul 19, 2004 at 05:27:56PM -0500, Olsen, Bill wrote:
> I would like some ideas for how to add text to postscript files that I am including in a LaTeX document.
> I want to use LaTeX to generate the text, so that the fonts and math symbols will match the rest of my document.
> I need to place the text at specific places in the figures, and in some cases I will need to place the text on a white background that covers part of the figure.
>
> My figures consist of schematic drawings with axes, lines, curves, etc., which need labels.  So far, I have made my own postscript files from my own reseach code (Fortran) which knows the physical problems being worked on.  Some of the figures I could re-build from scratch, and include placeholders in the ps output for text, but some of the figures are pretty old and I doubt that I could find the original code to re-created them - for those I would just like to edit the ps files from scratch.
>
> I would also be interested in learning a drawing environment for relatively simple figures.
>
> I don't know where to begin.
> My thanks to anyone who can point me in a fruitful direction.

A simple environment that can solve your problem (maybe a bit
simplistically) is the PSTricks package.  Look at this piece of my old
physics homework:

[-- Start <hw9.ltx> from line 122 to line 137: ------------------------]
\begin{wrapfigure}{l}{8cm}
\vspace{-0.5cm}
\begin{pspicture}(8cm,4cm)
\psset{yunit=1cm,xunit=1cm}
\psset{linewidth=1pt}
\rput[bl](0,0){\includegraphics[natwidth=8cm,natheight=4cm]{p1}}
\psdot(5.36,2)
\rput[b](5.36,2.1){$P$}
\rput[tl](5.36,1.95){$\underbrace{\hspace{1.6cm}}_{\hbox{$r$}}$}
\psline{->}(3,0.4)(5,0.4)
\rput[b](4,0.75){$I$}
\rput[r](1.4,0.4){$\infty \cdots$}
\rput[r](1.4,3.6){$\infty \cdots$}
\end{pspicture}
\vspace{-1cm}
\end{wrapfigure}
[-- End <hw9.ltx> from line 122 to line 137. --------------------------]

It includes <p1.eps> (which is a problem model created by POV-Ray) and
overlays a few labels and an axis.  There is, however, a package
specifically for your case: PSfrag.  Also, a not so simple to use, but
certainly powerful package is XYpic (and so is the MetaPost system, I've
heard).  There are other packages for specific tasks (displaying
diagrams, borad games, elecrical circuits, binary trees, and others).
If you have texdoctk, you may try looking under Graphics'' and
Diagrams''.

Luck and vision,
--
Pav

http://www.againsttcpa.com/  ,.,    My type: Dvorak.
http://swpat.ffii.org/     ,:'',
{o ! o}
Gain your human right of   ] -+- [  My GPG/PGP key is now available at
privacy: use cryptography!  \ ! /   x-hkp://search.keyserver.net:11371.
-'
shell\$ gpg --keyserver x-hkp://search.keyserver.net:11371 --recv-key 164C028F

`