Integration of Org-Babel into TeXmacs

Many of you might be familiar with Emacs’s Org-Mode enabling really amazingly quick and powerful workflows with plain-text files.
One remarkable feature of Org-Mode ist Babel, which implements the evaluation of code snippets in a large variety of programming languages.
In particular, Babel enables in-line code evaluation, i.e. direct evaluation of a code snippet within a sentence of normal text.
This is really helpful for assembling reports (texts) when analyzing data.

Since Org-Mode as an Emacs extension is written in Scheme like TeXmacs extensions, I wanted to suggest integrating functionality comparable to Babel in TeXmacs.
I hope to be able to do so one day by myself with more knowledge of TeXmacs code and Scheme, but all I can unfortunately do for now is to suggest this as a potentially highly useful feature for TeXmacs.

1 Like

Maybe this is a bit different from what you have in mind, but please take a look at “Plug-ins as scripting languages” of the TeXmacs manual, section 10.4.

The paragraph starting with “Some plug-ins such as Maxima can even be selected as a scripting language” and the following ones might in part correspond to what you describe.

2 Likes

As @pireddag, TeXmacs already allows evaluation of external code via plugins (including the embedded Scheme interpreter) and it has also a spreadsheet functionality which can link the result of various cells. For this last feature see “Towards a Scientific office suite” (https://www.texmacs.org/joris/icms14/icms14-abs.html). For the first, I attach some example screenshots showing the plugins at work (from TeXmacs’ twitter account):

A TiKz output: https://x.com/gnu_texmacs/status/1605166899469643776/video/1

3 Likes

This thread too might be interesting, although it’s not about code execution: Reproducible Research "Plugin"

1 Like

Thanks a lot for your replies. I was lacking the term “reproducible research”, which is exactly what I was looking for.

Having delved deeper into TeXmacs and “The Jolly Writer” guide, I realized that “executable switches” might actually be what I was looking for. This is what @pireddag what referring to and he mentioned the right place in the documentation.
Executable switches even make inline references to computed values possible.

Just a question, for me python’s plots are not inside Texmacs but rather a seperate window pop up. Is it possible to include the python plots in the document?
(For now I save it and link it seperately)

The Python plugin has an help (see Help->Plugins->Python) where you find useful informations. Have you tried the example there:


Does it work for you?