27 March 2026

Interactive books with TeXmacs via Docker

I like TeXmacs. There are several difficulties when I use it, but still, I like the concept: To have one big system that ensures high-quality typesetting and external sessions.

Now, I started writing the books I mentioned in the previous blog entry. For the theological work I already created a GitHub repo which also contains a Dockerfile and a script runme.sh (currently only for Debian/Ubuntu systems) if someone wants to read the book interactively. This means that all examples can be tried and eventually modified if the reader decides to play with them.

I faced a couple of technical difficulties. First, I learned that the Python module I developed for bibref requires an official repository. I chose PyPI (Python Package Index) to publish the package bibref-python officially. Now, the package can be installed via pip install bibref-python, but I learned that it is much better to run such package installation steps in a virtual environment. (For Python experts, this is should be quite evident, but for me, it was not.)

Second, it turned out that communication between TeXmacs and my session plugin works differently in some cases if I run them via Docker. I am still unsure what exactly the difference was, but finally I rewrote the communication protocol to send everything in one chunk, instead of slice the output in multiple packets. For some strange reason, sometimes only the first few packets arrived and the rest disappeared.

Third, I had to create the locale definitions manually in Docker to ensure that TeXmacs finds the required localizations (in my case, for the book, I currently need only Hungarian localization). Otherwise TeXmacs crashed without using any fallback setting.

Fourth, I learned that TeXmacs can show Hebrew fonts, so, after I added bidirectional text handling in the TeXmacs export part in bibref, I added some code to include the Aleppo Codex via the Dockerfile.

Fifth, I realized that TeXmacs will start with a welcome message, unless it has already been started. Since I did not want that, I start TeXmacs for the first time with an automated exit (texmacs -q), and then, for the second run, I load the interactive book.

Sixth, I improved some parts of the Dockerfile by muting some warning messages by enabling non-interactive run of apt-get, and copied some frequently changing files (including the book itself) from the local folder by using the COPY command in Docker.

Below are some screenshots about the on-going work. By having the success of setting up a full-featured interactive book with the possibility of running arbitrary bibref code anytime, also with the option to run Python code with imported bibref commands, I am managing to produce quite a high number of pages surprisingly quickly. It is not really about the number of pages but the content, of course, but anyway: it is a great joy for me to see my plans developing so nicely and in a good shape already.












Continue reading…

See also a filtered list of the entries on topics GeoGebra, technical developments or internal references in the Bible.


Zoltán Kovács
Linz School of Education
Johannes Kepler University
Altenberger Strasse 69
A-4040 Linz