mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Re: scripts-input works?


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Re: scripts-input works?
  • Date: Fri, 7 Aug 2009 18:46:56 +0200

Hi Michael,

Yes, little is needed in order to use other plug-ins for scripting.
However, since the command-line interface is no longer available
in that case, it seems quite mandatory to me that menus for basic use
of the system are added in that case. Look at what has been done for Maxima.
Of course, this should be further completed ;^)

Best wishes, Joris


On Thu, Aug 06, 2009 at 02:18:55PM +0200, Michael Lachmann wrote:
> 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
> >



Archive powered by MHonArc 2.6.19.

Top of page