Introducing Vau

I’ve started a project/exercise here

Vau aims to factor the TeXmacs typesetter away from the UI. One possible use is just to have a small viewer which can produce, e.g. png images of pages, to be used for example as plugin in other softwares. The main goal is however to allow me to understand better the dependencies in the code and attempt to refactor them for better modularity. Also I imagine a browser app where the UI is written in Javascript (or Elm or whatever) which communicates with the editor on a separate thread.

In the project I also experiment in rewriting the glue code to Scheme via C++ templates and make it more modular.

This is an experiment and it is not yet working properly.

7 Likes

Now it can produce some output :slight_smile:

3 Likes

Can TeXmacs be used without a GUI? If so, this might make an interesting demonstration.

TeXmacs can already be used without GUI (--headless option) to be run from the command line. You can issue scheme commands to script it, so it is useful mainly to convert files. The goal of the project is more to create a viewer, or a library which incorporate the typesetter and some internals of the editor so that it can be driven by an external program, maybe written in another language.

2 Likes

But what about using TeXmacs with the typesetter but with no menus and dialogs?

I have the same plan for Mogan v1.1.3: Modularize the code and maintain the non-core part as built-in plugins.

Here is my first work on refactoring the code:

2 Likes

@pikachuhy had decoupled the typesetter about one year ago when he was trying to start a new Scheme language impl.

3 Likes

Yeah, I can definitely see that helpful for many applications :grin: I’ve always wanted to have some sort of Wiki-style notetaking with TeXmacs (like Zim, but with TeXmacs as an editor). If this works as intend will certainly help towards that :wink:

I’m making some progress. Right now Vau can produce PDF and PNG for pages or full documents and compile to Webassembly ok. I need to design an API which can be called from Javascript so that it could be embedded in a webpage and render TeXmacs files on the web. For the moment without any editing facility, this will be considered later.

My current experience with it is that indeed the core typesetter is quite independent from the UI and other parts so I see the opportunity to separate it and rebuild gradually layer over layer more complex functionality on top. Ideally I always wanted to have most of the UI code not implemented in C++ so that it is easier to modify and maintain. It could be done in Scheme and Javascript, for example.

My plans also include to experiment with organizing fonts differently. I want to get rid of all the old TeX fonts and only use modern fonts. My experience is that most of the slugghiness with zoom come from the font selection mechanism.

6 Likes

A screenshot:

4 Likes

Will this viewer allow users to change the paper type and margins so they can decide how long each line should be and whether page breaks occur?

Well, for the moment it does not much. It is more an exercise in development. Let’s see where it goes. Since it retypeset all the document, apriori one could change any parameter, but clearly if you change too much the document could not reflow nicely (e.g. large equations).

People wouldn’t expect a document viewer to be able to do this, so it would be a pleasant surprise and potentially great advertising for TeXmacs.