Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

converting eps/psfrag pics for pdflatex use

666 views
Skip to first unread message

Bas van Dorp

unread,
Jun 2, 2003, 9:11:49 AM6/2/03
to
Hi,

My question seems rather simple. I have a lot of pictures that rely on
psfrag to be printed, but I want to use pdflatex. Of course I can make
the pictures again, using different methods to apply labels, but
sometimes psfrag is the only way.

Is there a way to convert .eps files with psfrag replacements to .pdf
files of (roughly) the same size so they can be included in a pdf
document with pdftex? I now have this:

%filename: convert.tex
\documentclass{article}
\pagestyle{empty}
\usepackage{graphics,psfrag}
\begin{document}
\psfrag{a}{$\alpha$}
\includegraphics{test2}
\end{document}

This creates a convert.dvi file with the correct psfrag replacements.

I then run:
dvips -E -o convert.eps convert

And then:
epstopdf convert.eps

This creates a convert.pdf file with the psfrag replacements on the
correct position, but somehow the bounding box is too large. For pictures
made with laprint, the boundig box is much too large. Any ideas on this?

Bas

Rolf Niepraschk

unread,
Jun 2, 2003, 9:29:02 AM6/2/03
to
Bas van Dorp wrote:
> Hi,
>
> My question seems rather simple. I have a lot of pictures that rely on
> psfrag to be printed, but I want to use pdflatex. Of course I can make
> the pictures again, using different methods to apply labels, but
> sometimes psfrag is the only way.
>
> Is there a way to convert .eps files with psfrag replacements to .pdf
> files of (roughly) the same size so they can be included in a pdf
> document with pdftex? I now have this:
>
> %filename: convert.tex
> \documentclass{article}
> \pagestyle{empty}
> \usepackage{graphics,psfrag}
> \begin{document}
> \psfrag{a}{$\alpha$}
> \includegraphics{test2}
> \end{document}
>
> This creates a convert.dvi file with the correct psfrag replacements.
>
> I then run:
> dvips -E -o convert.eps convert
>
> And then:
> epstopdf convert.eps
>

Try the following
%--------------------------------------
% mydocument.tex
\documentclass{article}
\pagestyle{empty}
\usepackage{ps4pdf}
\PSforPDF{\usepackage{graphics,psfrag}}
\begin{document}
\PSforPDF[trim=0mm 0mm 0mm 0mm]{%
\psfrag{a}{$\alpha$}%
\includegraphics{test2}%
}
\end{document}
%--------------------------------------

latex mydocument.tex
dvips -o mydocument-pics.ps mydocument.dvi
ps2pdf mydocument-pics.ps
pdflatex mydocument.tex

%--------------------------------------

Maybe a modified trim parameter can be useful...

...Rolf
--
|| Rolf Niepraschk c/o Physikalisch-Technische Bundesanstalt ||
|| Abbestr. 2-12; D-10587 Berlin, Germany ||
|| Tel/Fax: ++49-30-3481-316/490, email: Rolf.Ni...@ptb.de ||

José Carlos Santos

unread,
Jun 2, 2003, 9:28:15 AM6/2/03
to

Try the ps4pdf package or the pdftricks package.

Best regards

Jose Carlos Santos

--
Direct access to this group with http://web2news.com
http://web2news.com/?comp.text.tex
To contact in private, remove n5o9s-0p4aa6m

Bas van Dorp

unread,
Jun 2, 2003, 9:53:14 AM6/2/03
to
>
> Try the following
> %--------------------------------------
> % mydocument.tex
> \documentclass{article}
> \pagestyle{empty}
> \usepackage{ps4pdf}

This works great! (on the one matlab figure I tried)

Thanks Rolf,

Greetings,

Bas

0 new messages