|
From: Harald H. <h.h...@tu...> - 2005-02-14 17:26:58
|
On Mon, 14 Feb 2005, Hans-Bernhard Broeker wrote:
> Harald Harders wrote:
>
> > set title '\hello'
> > why is it saved as
> > set title "\\hello"
> > ?
>
> Because by the time 'save' operates, it no longer knows if you
> originally use '' or "" quotes.
And that is a shortcoming of the current gnuplot sourcecode. Why does
gnuplot analyse the string when it is input and then forgets which
quotation marks have been used? In my opinion, Gnuplot should just store
the original string including the quotation marks in memory and postpone
to analyse the string to the time when it uses the string. Then, 'save'
and 'show' could output the original string with the originally used
quotation marks. And this would not change any functionality.
> And because there are some things in a
> string that could only have gotten in there using "" syntax, most
> importantly literal linebreaks. So, at that point, always using ""
> syntax and escaping all non-printable characters on their out from
> internal storage to the file is the only available option.
If you want to analyse the string immediately when inputting it and want
to use either "" or '' in all outputs, you of course have to use "". But
there is no need to do so.
set title '\nhello'
should be saved as
set title '\nhello'
and
set title "\\nhello"
should be saved as
set title "\\nhello"
> >>And while we're at it: I have serious usability reservations about the
> >>'header' option. It's barely usable for your example prefixing two
> >>simple \usepackage lines --- this really should be a header taken from a
> >>file, instead.
> >
> >
> > I don't agree. It is useful to be able to make some local header additions
> > in a gnuplot script.
>
> I'm not debating that. I'm debating the user interface to getting that
> effect. Two shortish LaTeX command lines may still reasonably fit into
> a single gnuplot command line, but there comes a point at which it
> becomes highly repetitive and stressful command line editing. That's
> why I requested taking these header snippets from a separate file as an
> additional option, not as a replacement of the existing one.
I could of course add an option 'header file "<filename>"' that inputs
filename. Then, the question is if <filename> should be written as
\input{filename}
to the output file or if gnuplot should read in <filename> and write the
contents to the output file.
Another possibility that already exists is to use
set terminal epslatex header '\input{filename}'
> Come to think of it, maybe I'm simply against the entire "standalong"
> thingy --- it's not doing anything that a typical LaTeX user can't
> easily do with a quickly typed framework document instead.
Have you had a look at the header that is produced by gnuplot when using
'standalone'? It's not that easy to write it. It automatically selects the
same fontsize for the output as the plot uses for calculating space of
text. It sets the correct page size for dvips, VTeX, and pdflatex (which
really is hard to do by hand for pdflatex). I don't understand why you
dislike to type in one word ('standalone') instead of multiple lines of
code.
--
Harald Harders
h.h...@tu...
http://www.harald-harders.de
|