Hello, since Aditya was asking yesterday: I finally patched the gnuplot module to work with mkiv. There are still some parts for which I'm almost sure that they don't work (I didn't test, but at least an average gnuplot run should not need those features): 1.) colored labels ... Because withcolor doesn't work; but now that I intercept textext, maybe I can do some dirty tricks there. 2.) drawing points with TeX \setupGNUPLOTterminal[context][points=tex] \defineconversion[gnuplot:pointset][x,+,$\circ$] ... Because I first need to rewrite some code that used some dirty tricks with \startTeXtexts. 3.) changing font with gnuplot commands set title "Nice Title" font "iwona,20" ... Because Aditya wrote a patch that enables two arguments in \sometxt and that patch doesn't work in mkiv any more. Mojca PS: despite switching to mkiv, "reports still don't get written by themselves" :) :) :)
Mojca Miklavec wrote:
Hello,
since Aditya was asking yesterday: I finally patched the gnuplot module to work with mkiv.
There are still some parts for which I'm almost sure that they don't work (I didn't test, but at least an average gnuplot run should not need those features):
1.) colored labels
.... Because withcolor doesn't work; but now that I intercept textext, maybe I can do some dirty tricks there.
why dirty ... i made you: textext("\\colored[r=.5,g=.3]{your text}"
2.) drawing points with TeX \setupGNUPLOTterminal[context][points=tex] \defineconversion[gnuplot:pointset][x,+,$\circ$]
.... Because I first need to rewrite some code that used some dirty tricks with \startTeXtexts.
3.) changing font with gnuplot commands set title "Nice Title" font "iwona,20"
textext("\\definedfont[iwona at 20pt]{your text}")
PS: despite switching to mkiv, "reports still don't get written by themselves" :) :) :)
will happen in mkmm (mark mojca miklavec, to be written in 2048) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
Mojca Miklavec wrote:
Hello,
since Aditya was asking yesterday: I finally patched the gnuplot module to work with mkiv.
There are still some parts for which I'm almost sure that they don't work (I didn't test, but at least an average gnuplot run should not need those features):
1.) colored labels
.... Because withcolor doesn't work; but now that I intercept textext, maybe I can do some dirty tricks there.
why dirty ... i made you:
textext("\\colored[r=.5,g=.3]{your text}"
The main problem was that one had to intercept the string (the terminal gives the same output for all "marks"). The hint that you gave me an hour ago lead me to the following solution that seems to work OK: vardef textext@#(expr txt) = let,=@; save r, g, b; r = redpart gp_color_current; g = greenpart gp_color_current; b = bluepart gp_color_current; rawtextext("\colored[r=" & decimal(r) & ",g=" & decimal(g) & ",b=" & decimal(b) & "]{" & txt & "}") enddef ; Writing the string \colored[...] directly would need heavy modifications in the terminal. Now this hack works really nice.
3.) changing font with gnuplot commands set title "Nice Title" font "iwona,20"
textext("\\definedfont[iwona at 20pt]{your text}")
But that requires modifications to terminal again & incompatibility with output between engines. I'll try to figure out how to do something similar as above. I would like to write this as \sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the meaning of \sometxt somehow.
PS: despite switching to mkiv, "reports still don't get written by themselves" :) :) :)
will happen in mkmm (mark mojca miklavec, to be written in 2048)
I thought that was planned for 2068? (At least that was what Ton said, or rather sang.) Mojca
Mojca Miklavec wrote:
On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
Mojca Miklavec wrote:
Hello,
since Aditya was asking yesterday: I finally patched the gnuplot module to work with mkiv.
There are still some parts for which I'm almost sure that they don't work (I didn't test, but at least an average gnuplot run should not need those features):
1.) colored labels
.... Because withcolor doesn't work; but now that I intercept textext, maybe I can do some dirty tricks there. why dirty ... i made you:
textext("\\colored[r=.5,g=.3]{your text}"
The main problem was that one had to intercept the string (the terminal gives the same output for all "marks"). The hint that you gave me an hour ago lead me to the following solution that seems to work OK:
vardef textext@#(expr txt) = let,=@;
save r, g, b; r = redpart gp_color_current; g = greenpart gp_color_current; b = bluepart gp_color_current;
rawtextext("\colored[r=" & decimal(r) & ",g=" & decimal(g) & ",b=" & decimal(b) & "]{" & txt & "}") enddef ;
Writing the string \colored[...] directly would need heavy modifications in the terminal. Now this hack works really nice.
3.) changing font with gnuplot commands set title "Nice Title" font "iwona,20" textext("\\definedfont[iwona at 20pt]{your text}")
But that requires modifications to terminal again & incompatibility with output between engines. I'll try to figure out how to do something similar as above. I would like to write this as \sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the meaning of \sometxt somehow.
in any case ... you need to save and restore the meaning of textext because we have one session of mp; begingroup ; save textext ; vardef ... ; plotting like a gnu ... ; endgroup ; alternatively we can use a dedicated mp instance; since you only use textext that would be just the plain format plus mp-gnup.mp or something like that; next time we meet we should sit down and do that
I thought that was planned for 2068? (At least that was what Ton said, or rather sang.)
Well I met this woman, she was hard as nails ... (Last Will and Testament, J.J. Cale/E. Clapton) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Dec 3, 2008 at 7:58 PM, Hans Hagen wrote:
Mojca Miklavec wrote:
On Wed, Dec 3, 2008 at 7:00 PM, Hans Hagen wrote:
3.) changing font with gnuplot commands set title "Nice Title" font "iwona,20" textext("\\definedfont[iwona at 20pt]{your text}")
But that requires modifications to terminal again & incompatibility with output between engines. I'll try to figure out how to do something similar as above. I would like to write this as \sometxt[gp][iwona,20pt]{The Title}. I "just" need to redefine the meaning of \sometxt somehow.
in any case ... you need to save and restore the meaning of textext because we have one session of mp;
begingroup ; save textext ;
Thanks. That's a good point. I'll add it.
vardef ... ; plotting like a gnu ... ; endgroup ;
alternatively we can use a dedicated mp instance; since you only use textext that would be just the plain format plus mp-gnup.mp or something like that; next time we meet we should sit down and do that
Thanks :) (But be careful with promisses ... The Czech Republic is [almost] our neighbour.) ---- One more question ... When checking for luatex inside metapost (to be able to branch code depending on engine) - what's the best thing to ask for? a) if known context_mlib: ... b) \startLUATEX\startMPextensions mark := 4; \stopMPextensions\stopLUATEX if mark = 4: ... c) something else Thanks, Mojca
Am 2008-12-03 um 19:27 schrieb Mojca Miklavec:
PS: despite switching to mkiv, "reports still don't get written by themselves" :) :) :)
will happen in mkmm (mark mojca miklavec, to be written in 2048)
I thought that was planned for 2068? (At least that was what Ton said, or rather sang.)
Hm, with MkII and MkIV numbered roman, MkMM would mean "Mark 2000" - and since it needed some years to get from Mark 2 to Mark 4, it could last even longer than 2068, don't you think? ;-) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
2008/12/5 Arthur Reutenauer
will happen in mkmm (mark mojca miklavec, to be written in 2048)
You can write a rant generator in Lua, and fill the report with that.
Please start with http://www.pangloss.com/seidel/shake_rule.html :-) Best Martin
participants (5)
-
Arthur Reutenauer
-
Hans Hagen
-
Henning Hraban Ramm
-
Martin Schröder
-
Mojca Miklavec