On Saturday 06 December 2003 04:16, Dave Tweten wrote: > Thank you all for attempting to enlighten me. Even the suggestions I > didn't follow helped me understand the alternatives. > > I said: > >... will I have to figure out the syntax well enough to roll my own? > > I decided to roll my own. The reason is the attraction of making LyX work > off the gnuplot file instead of the *.eps file, with the associated risk > that the *.eps file will become out-of-date. > > My strategy is as follows: > > 1. Cat the last attachment on this message and > lib/external_templates to ~/.lyx/external_templates. > Unfortunately, LyX only supports substitution for > lib/external_templates, not additions to it. That means > I get to cat again every time I upgrade LyX (groan).
The code changed in this area but I don't know how, in 1.4.0cvs > 2. Put copies of the previous two attachments, eps.gnuplot and > ascii.gnuplot into any directory that contains Gnuplot plot > files. My solution for this problem is a script that wraps the call to gnuplot, and adds the necessary declaration for output. Usually I enter also a preamble with some of the default values for my drawings. > 3. Make each Gnuplot plot file (*.gnu) self-contained. It should > contain all commands and all data required to create the plot. > LyX will be tracking the plot files. If they only contain > commands and the data are elsewhere, changes in data won't cause > LyX to remake the *.eps file (or the ASCII text). An example is > the first attachment to this message. Since I sometimes use long data files for graphics this is not always handy. > While at it, I discovered a buglet in $$Sysdir/scripts/general_command_wrap > per.py. The statement that prints the redirection message left out a > blank before the file name: > > --- general_command_wrapper.py.orig Thu Nov 13 14:40:21 2003 > +++ general_command_wrapper.py Fri Dec 5 15:24:21 2003 > @@ -13,7 +13,7 @@ > os.close(0) > sys.stdin = open(sys.argv[1],"r") > if sys.argv[2] != "-": > - print "Redirecting" + sys.argv[2] > + print "Redirecting " + sys.argv[2] > os.close(1) > os.close(2) > sys.stdout = open(sys.argv[2],"w") I fixed that at my tree for 1.3.x and I will commit it soon, for 1.4 that file is no more. :-) > Some things I don't like: > > 1. Eps.gnuplot and ascii.gnuplot should not exist. There ought to > be a way to tell Gnuplot to select a terminal type from the > command line. I don't the way. That is why I prefer the wrapper. :-) > 2. So what is the "standard" file name extension of Gnuplot command > files? I used *.gnu, but Richard Stallman might have other ideas > about what that extension should be used for. Interestingly in some of their examples they use .plt I have been using gnp, but I guess that it is a question of personal taste here. :-) > 3. I only care about the LaTeX format. I didn't test Ascii, DocBook, > and LinuxDoc. Should there be others? No. > Any comments or criticisms will be appreciated. With the wrapper you don't need to use inset external. You can gnuplot to the graphic supported formats. :-) -- José Abílio LyX and docbook, a perfect match. :-)