Re: Vector symbol [message #47382 is a reply to message #47297] |
Mon, 06 February 2006 07:15   |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
Maarten wrote:
> Paolo Grigis wrote:
>
>> Maarten Sneep wrote:
>>
>>> Since you already seem to know (La)TeX, you may be able to use psfrag
>>> to postprocess the eps output from IDL, using the full (La)TeX for the
>>> labels.
>>
>> After reading this post I tried it out, because there are many situations
>> where this might be a valuable addition for a plot, but I have mixed
>> feelings about that... the application of psfrags to IDL plots is not
>> 100% straigthforward (a bit of editing of the EPS file itself often
>> required) and it bothers me that I have to embed the original plot in a LaTeX
>> document to have the final version. Is there a simple way of producing an
>> eps file (with the same size as the original plot) from the dvi output of
>> a LaTeX file containing just the original plot and the psfrag substitution
>> commands?
>
>
> Warning: getting offtopic. Furter question are better directed to
> comp.text.tex
Oh yes, but since the people in this newsgroup are so kind...
>
> Tip 1: use single letter labels in IDL: this makes it a lot easier to
> generate the substitution text. Also ensure that you use hardware fonts
> (say, times) in your plot. Numbers along the axis can be a bit more
> painful, although if you ensure that the values are scaled to a range
> where exponents are not needed, you'll probably be just fine (just add
> the scale factor to the axis label).
Agreed on that, works well with [c] as positional parameter in the \psfrag
command.
>
> Tip 2: The following latex file may help:
> \documentclass{article}
> \usepackage{geometry}
> \usepackage{graphicx}
> \usepackage{psfrag}
>
> \pagestyle{empty}
> \geometry{paperwidth=12cm,paperheight=8cm,margin=0pt}
> \begin{document}
> % define labels here
> \includegraphics[width=12cm,height=8cm]{figure.eps}
> \end{document}
Thanks Maarten, the geometry package is the one I was missing!
Ok, now I've become a true believer, one can indeed get very nice
results going the psfrag way.
In the end I settled for using something like:
latex doc.tex
dvips -o fig.ps doc.dvi
ps2epsi fig.ps fig.epsi
perl -ne 'print unless /^%%BeginPreview/../^%%EndPreview/' < fig.epsi > fig.eps
rm fig.epsi
This uses ps2epsi to handle the final ps->eps transformation
(I found the perl statement somehwere on the web, it just removes
the embedded *preview* in the eps file, which is not just useless,
but really dangerous, since some windows programs seems to mistake
it for the *real* picture...)
I've put a dummy example online at
http://www.astro.phys.ethz.ch/staff/pgrigis/private/fig.eps
which shows the kind of results one can get without *too much* effort
(well, after getting used to it), and it indeed looks nicer than anything
one could conjure up using the Herschey fonts.
Thanks again,
Paolo
>
> Adapt sizes to your liking, make sure the lines you use in IDL are
> thick enough.
>
> Process with
> latex
> and
> dvips -o figure-labeled.eps figure.dvi
>
> This should produce a ps file with width 12 cm and height 8 cm. Convert
> to pdf ans used with pdflatex as you please, although I think the ps
> outout can be included with latex+dvips as well (despite teh fact that
> it isn't eps). The -E flag may be interesting for dvips as well.
>
> Maarten
>
|
|
|