Subject: mailing-list for TeXmacs Users
List archive
From : Michael Lachmann <address@hidden>- To: address@hidden
- Subject: [TeXmacs] Re: scripts-input works?
- Date: Thu, 6 Aug 2009 14:18:55 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=tZ3mzAGDi3vTsfsiVz+0+ku2gegUYGPvkNNqF1h7Ext2wXkVJuAhRh3K07bZCcGcLi kUMqqUjpUewcZZkP/WqYF3nEg2gAeJjtj9T0G0sIzDU7REiuObXQCXKUGZqukeC+qeNu oc60ScGcxczV2+SFAIBiEHsfVdCk+yHQUdPxA=
Answering my own question. I managed to get scripts to work both with
R and with XYPic. Very little hacking is needed, though I'm probably
breaking lots of stuff.
I edited the files
/usr/share/TeXmacs/plugins/xypic/progs/init-xypic.scm
and
/usr/share/TeXmacs/plugins/xypic/progs/init-r.scm
To both I added a line to plugin-configure:
(plugin-configure xypic
(:require (url-exists-in-path? "latex"))
(:launch "tm_xypic --texmacs")
(:session "XYpic")
(:scripts "XYpic"))
and
(plugin-configure r
(:require (url-exists-in-path? "R"))
(:initialize (r-initialize))
(:serializer ,r-serialize)
(:launch "exec tm_r")
;; (:tab-completion #t)
(:session "R")
(:scripts "R")
)
(The added line is the last - (:scripts "name"))
Once that is done, in a document, you just select
Document->scripts->XYPic (or R), and then hit M-*!
Then you enter an expression, and when you want to evaluate it hit C-*
To unevaluate it, i.e. see the original expression, hit C-* again.
Thus, for R you can enter the expression
plot(1:10,10:1);abline(0,1,col=2);v()
and then you get a nice graph in the document....
If you want both R and XYPic in the same session, it seems you have to
select Document->scripts->XYPic before you enter the expression with
M-*!, you can not just edit the grey field that says R or XYPic.
It is a bit hard to differentiate parts of the text that are output of
scripts from parts that are just text (I guess that is the point...).
Is there something like varsession for scripts?
Michael
2009/8/6 Michael Lachmann <address@hidden>:
> Hi!
>
> I'm trying to insert XYPic generated graphs into a document, while
> having the code for the graph hidden.
> Looking through the web, I discovered the "hidden" keystroke M-*! and C-*
> These are very cool features!!
>
> But I can not get them to work. Every time I hit C-* I get "XXXX is
> not a scripting language",
> and it doesn't matter if I leave the original script-input as it was
> to begin with, i.e. "scheme", or if I change "scheme" to "python",
> "xypic", or "R".
> The mailing list seems to indicate that this worked once for python
> and gnuplot, and maybe xypic.
> Am I doing it wrong? Is this feature currently off? Is there another
> way to achieve what I want - i.e. put a nice graph into my document
> without the ugly code?
>
> Thanks!
> Michael
>
- [TeXmacs] scripts-input works?, Michael Lachmann, 08/06/2009
- [TeXmacs] Re: scripts-input works?, Michael Lachmann, 08/06/2009
- Re: [TeXmacs] Re: scripts-input works?, Joris van der Hoeven, 08/07/2009
- Re: [TeXmacs] Re: scripts-input works?, Michael Lachmann, 08/08/2009
- Re: [TeXmacs] Re: scripts-input works?, Joris van der Hoeven, 08/07/2009
- [TeXmacs] Re: scripts-input works?, Michael Lachmann, 08/06/2009
Archive powered by MHonArc 2.6.19.