mailing-list for TeXmacs Users

Text archives Help


Re: Literate programming in TeXmacs and other wishes


Chronological Thread 
  • From: "Juan Pablo Romero" <address@hidden>
  • To: address@hidden
  • Subject: Re: Literate programming in TeXmacs and other wishes
  • Date: Sun, 15 Dec 2002 20:18:47 +0000





4. Because we are now not only using interactive sessions, but also
writing a more long code, we would "execute" some parts of the document.
May be selecting them and then choosing and "execute marked parts"
option or something like that. Every marked part is passed to the
respective language "engine" and results of execution are shown. Because
of the estructured nature of TeXmacs may be it can be done generating
temporaly files of each Code Section and send them to the specified
language "engine".


This seems like the Mathematica front-end, isn't it?
There, every document is composed of "cells". Each cell contains code (which can be executed) or formatted text (with fonts, etc).

I suppose it shouldn't be too dificult to adapt the current code to behave something like this:

* You start an interactive session and texmacs inserts a box, but this box allows multiline code fragmens. Texmacs assigns some id to the session.

* You submit the box's contents to the engine for execution (say, with <Shift+Enter>), and texmacs displays the result.

* You move out of the box, and continue editing your document.

* Later, you insert another code box, but use the id of the session you are interested in. So, texmacs doesn't start another session but submits the code to the previously started.

* There are commands for manipulating a session, like killing it, restarting it, etc.

* You can start engines in another machines, not only the local one.

* The result of the execution of a box can be something different than plain text. An image, for example.


I'm particularly interested in this feature, because some time ago I wrote a program (called "superficie") that is something like a 3d surface viewer. It reads a file containing 3d data for surfaces, points and lines and display these objects in a window using opengl. It's like a light version of geomview.

Anyway, the point is, I also wrote routines in several languages (mathematica, yacas, scheme) that mimics some Mathematica graphic funtions (ParametricPlot3D, Plot3D).

This program can also generate pixmaps or postscript. So, the output image could be saved in some temp file and automatically displayed by texmacs.

This is actual code:

------------------
(define f '(* x y))
(sup-plot-3d f (x -1 1) (y -1 1))
------------------

at this point, the program shows a window with the graph of 'f'. But it would be very nice if texmacs would display the image within the document.




Regards.


Juan Pablo


_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: http://messenger.microsoft.com/es




Archive powered by MHonArc 2.6.19.

Top of page