|
From: Philipp K. J. <ja...@ie...> - 2014-11-08 03:14:07
|
How much experience do people have with the Lua/Tikz
terminal? I have been experimenting with it a bit,
and I found some of the behavior bizarre (not to
mention obscure).
Below is a log of various sessions. Three problems
that I seem to have narrowed down: when I try to
write successively to more than one file during one
gnuplot session, the subsequent tex files do not
compile. Tex stops at some point, waiting for input.
(See session 2 below.)
When using arrows, gnuplot fails to create the proper
lua script (which is bad), but when I then try to
exit gnuplot, it gets completely wedged, continuously
spewing messages about "Missing Lua context". One has
to kill it from a separate shell. (Session 3)
I can use arrows when I set the terminal option
"gparrows". I tried this after seeing something
about "misusing the angle value" in the doc. I am
not sure, though, what the doc is really saying -
what should I do if I want to use Lua/Tikz-arrows?
Finally, how do I include Tex constructs in text labels
(which, I assume, is the whole point). The documentation
does not seem to be mention that at all. I tried the
same syntax as in the epslatex terminal, namely simply
including Tex code:
set label "Hello $\int e^{-x}$" at 0,0
but this only led to one of those tex files that
don't compile. (Session 6)
At this point, I find it all rather obscure. I also
wonder whether it is worthwhile trying to figure this
out - what can this terminal do that none of the
others can do? I searched the web a little and did
not find much.
Any experiences, insights, opinions?
Best,
Ph.
SESSION TRANSCRIPTS FOLLOW
SESSION 1
plot sin(x)
set t tikz standalone
set o 't1.tex'
replot
set o
shell> pdflatex t1.tex : OK
============================================================
SESSION 2
plot sin(x)
set t tikz standalone
set o 't2.tex'
replot
set o
set o 't3.tex'
replot
shell> pdflatex t2.tex : OK
shell> pdflatex t3.tex :
Preview: Fontsize 10pt
Preview: PDFoutput 1
Overfull \hbox (10.65929pt too wide) in paragraph at lines 1083--1083
[][]
Preview: Tightpage 0 0 0 0
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}])
*
============================================================
SESSION 3
plot sin(x)
set arrow from -5,-.4 to 2,.6
set t tikz standalone
set o 't4.tex'
replot
.../rc52/staging/share/gnuplot/5.0/lua/gnuplot-tikz.lua:346:
attempt to concatenate local 'direction' (a nil value) stac
BUT THEN:
I wish to quit gnuplot using ^D, but it doesn't terminate,
instead it prints FOREVER (unstoppable, must close window):
Missing Lua context! No script?
============================================================
SESSION 4
plot sin(x)
set arrow from -5,-.4 to 2,.6
set t tikz standalone gparrows
set o 't5.tex'
replot
shell> pdflatex t5.tex : OK
============================================================
SESSION 5
plot sin(x)
set label "Hello"
set t tikz standalone
set o 't6.tex'
replot
shell> pdflatex t6.tex : OK
============================================================
SESSION 6
plot sin(x)
set label "Hello $\int e^{-x}$" at 0,0
set t tikz standalone
set o 't7.tex'
replot
shell> pdflatex t7.tex :
Preview: Fontsize 10pt
Preview: PDFoutput 1
Overfull \hbox (10.65929pt too wide) in paragraph at lines 561--561
[][]
Preview: Tightpage 0 0 0 0
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}])
*
|
|
From: Christoph B. <us...@be...> - 2014-11-08 07:21:02
|
Am 08.11.2014 04:13, schrieb Philipp K. Janert: > > I can use arrows when I set the terminal option > "gparrows". I tried this after seeing something > about "misusing the angle value" in the doc. I am > not sure, though, what the doc is really saying - > what should I do if I want to use Lua/Tikz-arrows? There had been problems with some changes in the general arrow drawing code. That is fixed in the 5.0 branch but wasn't yet included in the rc2: http://sourceforge.net/p/gnuplot/bugs/1476/ (at the moment I cannot find the related post in some other bug or on the mailing list concerning the lua terminal). There have also been other additions and fixes to the lua/tikz terminal after RC2. > Finally, how do I include Tex constructs in text labels > (which, I assume, is the whole point). The documentation > does not seem to be mention that at all. I tried the > same syntax as in the epslatex terminal, namely simply > including Tex code: > set label "Hello $\int e^{-x}$" at 0,0 > but this only led to one of those tex files that > don't compile. (Session 6) For me that file compiles, but gives the wrong results since you don't escape the backslash. The following works fine for me (current 5.0 branch) plot sin(x) set label "Hello $\\int e^{-x}$" at 0,0 set t tikz standalone set o 't7.tex' replot > plot sin(x) > set arrow from -5,-.4 to 2,.6 > set t tikz standalone > set o 't4.tex' > replot > .../rc52/staging/share/gnuplot/5.0/lua/gnuplot-tikz.lua:346: > attempt to concatenate local 'direction' (a nil value) stac > > BUT THEN: > > I wish to quit gnuplot using ^D, but it doesn't terminate, > instead it prints FOREVER (unstoppable, must close window): > > Missing Lua context! No script? That error with the arrows is fixed. However, the general problem remains, that gnuplot crashes when an error in the lua script appears. I have no idea how to fix this. I haven't worked much with the tikz terminal, but made some additions and fixes recently. The mention of 'misuse of the angle parameter' is about using the angle parameter as index for an own arrow style which isn't in the list of predefined ones. I do also have to find out some 'outstanding' features of the tikz terminal. As far as I know you can also define custom line styles, which now shouldn't be so outstanding, but before adding custom dash styles it was. Christoph |
|
From: Mojca M. <moj...@gm...> - 2014-11-08 08:04:14
|
On Sat, Nov 8, 2014 at 4:13 AM, Philipp K. Janert wrote:
>
> How much experience do people have with the Lua/Tikz
> terminal? I have been experimenting with it a bit,
> and I found some of the behavior bizarre (not to
> mention obscure).
This won't solve all of the problems, but you need to make sure that
you finish writing to a file before running TeX.
> Below is a log of various sessions. Three problems
> that I seem to have narrowed down: when I try to
> write successively to more than one file during one
> gnuplot session, the subsequent tex files do not
> compile. Tex stops at some point, waiting for input.
> (See session 2 below.)
Try compiling 't3.tex' again. I'm almost sure that it will work now.
Please check the contents of the file before compiling it. Either exit
gnuplot, change the terminal or run 'set o[utput]' before compiling
the tex file.
> When using arrows, gnuplot fails to create the proper
> lua script (which is bad), but when I then try to
> exit gnuplot, it gets completely wedged, continuously
> spewing messages about "Missing Lua context". One has
> to kill it from a separate shell. (Session 3)
>
> I can use arrows when I set the terminal option
> "gparrows". I tried this after seeing something
> about "misusing the angle value" in the doc. I am
> not sure, though, what the doc is really saying -
> what should I do if I want to use Lua/Tikz-arrows?
There must be some arrow-related bug somewhere. I suspect that the
number of people using both arrows and tikz could be small enough that
nobody noticed the problem so far.
> Finally, how do I include Tex constructs in text labels
Just like you would expect (except that you need to use proper quotes
or escapes, see below).
> (which, I assume, is the whole point). The documentation
> does not seem to be mention that at all. I tried the
> same syntax as in the epslatex terminal, namely simply
> including Tex code:
> set label "Hello $\int e^{-x}$" at 0,0
> but this only led to one of those tex files that
> don't compile. (Session 6)
Just because you didn't finish the file.
> At this point, I find it all rather obscure. I also
> wonder whether it is worthwhile trying to figure this
> out - what can this terminal do that none of the
> others can do? I searched the web a little and did
> not find much.
>
> Any experiences, insights, opinions?
>
> Best,
>
> Ph.
>
>
> SESSION TRANSCRIPTS FOLLOW
>
>
> SESSION 1
>
> plot sin(x)
> set t tikz standalone
> set o 't1.tex'
> replot
> set o
>
> shell> pdflatex t1.tex : OK
>
> ============================================================
> SESSION 2
>
> plot sin(x)
> set t tikz standalone
> set o 't2.tex'
> replot
> set o
> set o 't3.tex'
> replot
>
> shell> pdflatex t2.tex : OK
> shell> pdflatex t3.tex :
>
> Preview: Fontsize 10pt
> Preview: PDFoutput 1
>
> Overfull \hbox (10.65929pt too wide) in paragraph at lines 1083--1083
> [][]
> Preview: Tightpage 0 0 0 0
> [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}])
> *
You tried to compile unfinished file.
> ============================================================
> SESSION 3
>
> plot sin(x)
> set arrow from -5,-.4 to 2,.6
> set t tikz standalone
> set o 't4.tex'
> replot
> .../rc52/staging/share/gnuplot/5.0/lua/gnuplot-tikz.lua:346:
> attempt to concatenate local 'direction' (a nil value) stac
I get the same problem. This looks like a bug in gnuplot-tikz.lua.
> BUT THEN:
>
> I wish to quit gnuplot using ^D, but it doesn't terminate,
> instead it prints FOREVER (unstoppable, must close window):
Side effect of the lua script taking over everything and failing to do
the right thing.
> ============================================================
> SESSION 6
>
> plot sin(x)
> set label "Hello $\int e^{-x}$" at 0,0
You are making one mistake here. You should use either single quotes:
'Hello $\int e^{-x}$'
or you should escape the backslash.
Please check the output in the resulting tex file before you compile
to make sure that the label is correct.
> set t tikz standalone
> set o 't7.tex'
> replot
>
> shell> pdflatex t7.tex :
>
> Preview: Fontsize 10pt
> Preview: PDFoutput 1
>
> Overfull \hbox (10.65929pt too wide) in paragraph at lines 561--561
> [][]
> Preview: Tightpage 0 0 0 0
> [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}])
> *
I strongly suspect that you are experiencing the same problem as
elsewhere: you tried to compile unfinished file. The example works for
me (I tested with both gnuplot 4.6.6 as well as with 5.0.rc2).
Mojca
|