Proposal: Pandoc support

What

  • Implement a TeXmacs-> Pandoc exporter in TeXmacs (i.e. saves documents in Pandoc format).
  • Implement a Pandoc extension to support the TeXmacs document format

Why

Pandoc (https://pandoc.org) allows to convert documents from/to various formats (see their page for the complete list). Supporting Pandoc would allow TeXmacs documents to be translated in formats which currently we do not support directly (like MS Word, ePub, etc…)

How

Pandoc achieves the conversion by using an intermediate language to describe the document. Supporting a new document format should be possible by writing a converter from TeXmacs to the Pandoc format and back.

  • Within TeXmacs coverters are usually implemented in Scheme. A programmer can give a look at the HTML converter in $TEXMACS_PATH/progs/convert/html and use it as an help to write an exporter for TeXmacs towards the Pandoc format.

  • One can extend pandoc to write (and optionally read) TeXmacs documents. I think the writer is easier than a reader.

Useful reference: see here the discussion in the Pandoc issue tracker for the Typst reader: https://github.com/jgm/pandoc/issues/8740

1 Like

I’d like to make this proposal as a project in OSPP 2024. It is not hard and it will help us convert TeXmacs doc to various different format like doc/rst/markdown.

3 Likes

@darcy @mgubi I think it’s an excellent proposal and indeed a huge feature for Texmacs and the growing of its community. :+1:
texmacs must be able to communicate with the maximum format if it wants to attract new users. It’s reassuring, powerful and so much more comfortable for teamwork with heterogeneous habits and tools. A great great feature for sure !

2 Likes

Here is the WIP project for this proposal: WIP Project: Conversion from TeXmacs format to HTML and docx

Pandoc support could be completed as a binary plugin in Mogan: https://mogan.app/guide/plugin_binary.html

It is not hard for an OSPP student to complete. I’d like to make the pandoc support as the criteria to accept the application from OSPP students.