[main]Notes on TeXmacs

Development resources and ideas

This page contains idea and resources pertaining to the development of TeXmacs.

[Last update 22.3.2021]

1.Random and unsorted resources

2.Syntax highlighting

We need syntax highlighting computations when rendering verbatim code snippets and also when exporting to HTML, for example. Currently there is some parsing library written in C++ inside TeXmacs (see the src/System/Language directory), but this does not cover HTML output and it is quite rudimentary. In this blog for example we achieve syntax-highlighting for HTML via an external JavaScript library. It would be useful just to output the appropriate elaborated text (together with a plain-text version for copy/paste). In general it could be maybe interesting to evaluate the use of external libraries for syntax analysis of programming languages.

3.Parsing Markdown and other languages

It could be useful for us to be able to parse the Markdown format. There are various available parsers which could be integrated as plugins in the codebase, for example PEG-markdown, sundown, libsoldout, md4c and also some native scheme implementations like lowdown for Chicken Scheme. Currently in TeXmacs we do not have a generic way to parse external languages: for example internally the parsing of HTML or TeX is done via C++ code without any common parsing substrate (as far as I can see). There is some support for packrat parsing but it is used only in the semantic checking of math formulas and it seems that the packrat parser is not capable of semantic actions, i.e. can only report if a string (or tree?) belongs to some language or not. Tree-sitter could also be an option as generic parsing mechanism. It could be useful to think how to factor and restructure the parsing mechanisms in TeXmacs to avoid duplicating code/efforts/know-how.

4.Spellchecking and grammar-checking

This could be an area where we can improve substantially over LaTeX-based workflows, probably. We need to check what is done in other text-processing software. Some interesting resources

5.General plugin mechanisms

A strategical goal would be to improve support for general mechanisms to talk to external programs:

6.General attachments to documents and to PDF files

PDF gives the possibility to embed arbitrary content within the document as “Embedded file” streams. This possibility is exploited by the LaTeX package attachfile which allows to associate to typesetted parts of the document arbitrary attachments with the possibility to recover it. We could introduce a similar feature in TeXmacs documents, i.e. include external content in the document. Another possibility is to include a TeXmacs document within a generated PDF file in such a way that it is possible to open the PDF from TeXmacs and edit its source. Another use could be to include TeXmacs snippets in copied PDF files so that they could be reopened in TeXmacs and modified.

7.Zotero integration

Zotero is a widely used open source bibliographic management tool. It would be interesting to have a good way to import bibliography items from it. There are already various attemps to this:

We maybe want to develop a more organic solution. Interesting links:

8.Incremental computing

Modifications to the documents are incremental, so one would like to take this into account when recomputing both the typesetting and the rendering onscreen. This problem is also relevant when syncronizing live-editing document across a network connection. Some infrastructure is already present in TeXmacs (details?). Here are gathered some approaches to incremental computations in a general context.