|
From: Harald H. <h.h...@tu...> - 2005-02-13 22:29:04
|
> I use LaTeX almost exclusively for documents, but I've come in at the
> middle of this conversation. I'm very used to including the epslatex
> output in a LaTeX file.
If using LaTeX for the whole document, using \input to include the plot
generated by gnuplot is the best solution, of course. I have never done
this before since the epslatex terminal was not capable of the important
features of the postscript terminal. This problem is solved now, as you
may have noticed.
> Or I create a simple little file with all the
> necessary header information, then compile that and convert the figure to
> EPS using the -E option of dvips.
This can be done now using 'set terminal epslatex standalone'. You don't
have to handle an additional header file then, because gnuplot produces
everything you need. You even can omit the -E switch of dvips since the
generated header file preserves the correct BoundaryBox, when using
latex->dvips and when using epstopdf->pdflatex. There ist one difference:
The new syntax produces the BoundingBox that is given by the 'set size'
command while dvips -E cuts off all white space. If you, for example,
produce white space around your plot, using 'set size', it is kept in your
final postscript file.
> So I guess your standalone option is supposed to allow someone to create a
> file to circumvent the process I described above. I can see that as being
> useful for some 3rd party program that wants to generate a no-brainer
> latex file for a user.
It's not only useful for 3rd party programmes. Since it has been
available, I often use it because I find it is easier to add the keyword
'standalone' to the 'set terminal' line than to edit an additional LaTeX
file. Another advantage is that you don't have to take care that the font
sizes match in the gnuplot and the LaTeX file since the fontsize given in
the 'set terminal' line is also used by the surrounding LaTeX code. And,
the input encoding given in Gnuplot is also used by LaTeX, automatically.
Dan, just try the 'standalone' option. Maybe you can give me feedback what
can be improved.
> (But wouldn't a more generic format be in order,
> where one could simply append gnuplot output to an open file?)
What do you mean by that? Could you please explain it in more detail?
> But I can't ever see myself using such a thing, unless you could
> convince me of some time savings.
As mentioned above. Just try it. For example, if you want a standalone
plot with Times in 12pt size, use:
set terminal epslatex standalone header '\usepackage{mathptmx}' '' 12
As you see here, the 'header' option gives access to additional commands
in the header of the LaTeX file. If you have more complex additions that
shall apply to more than one gnuplot file, you may use the file
'gnuplot.cfg'. If using this, you also don't have to rerun gnuplot.
What I often do is to add some code at the end of my gnuplot file:
set terminal epslatex standalone rounded color linewidth 2 \
header '\usepackage{mathpmtx}' '' 12
set output 'myplot.tex'
...
set output
!epstopdf myplot-inc.eps
!pdflatex myplot
This produces a plot in pdf format by simply starting
gnuplot myplot.gpl
Dan, if you have additinal questions or suggestions, just mail me.
BTW: I have received two additional mails by you that cannot be displayed
by my pine.
Regards
Harald
--
Harald Harders
h.h...@tu...
http://www.harald-harders.de
|