Should TeXmacs packages be fundamentally different from LaTeX packages?

In particular, should they be more like interactive apps?

For example, a TeXmacs “puzzles” package should allow you not only to write up various puzzles (e.g., Sudoku) but also to allow people to solve such puzzles manually from within TeXmacs (e.g., much like with a Sudoku game app).

So in this sense, this would go beyond what LaTeX packages do.

See the previous post.

Yes, Tetris is a nice example of a TeXmacs game app. However, what about extending it to also help with writing papers about Tetris?

There is nothing which prevents people to write interactive packages. A TeXmacs macro can run Scheme code via the \extern tag and the code can do arbitrary computations and interact with the user by modifying the UI or via dialog widgets, or by modifying the content of the document. Maybe such kind of functionalities are better packages via plugins, but if you want you can write a sudoku solver right now. The Tetris example just shows how to do it. For example if you be useful to have extensive support for managing chess notation, including transcripts of games or to connect to game servers to play chess in TeXmacs. At some point however it just become easier to write some javascript in a Browser page. One has to be reasonable on the scope of TeXmacs. It is not universally better of any kind of use. It has been finely tuned to write documents, not apps.

It just seems that TeXmacs can have genuinely useful interactive packages that LaTeX can’t match. And this might convince many people to switch.

I don’t think playing games inside TeXmacs will convince anyone. There are far better standalone chess programs, for example, that we will never be able to beat. We could provide something unique in terms of document editing, as @mgubi says.

Something that wouldn’t seem to hard to implement would be to make a chessboard-like table that once you enter it, the different chess pieces appear on the toolbar, so that you can graphically insert and edit the board. Fortunately all chess pieces are part of Unicode and are implemented in many fonts:

What about interactive chess puzzles that know their solutions (so no chess engine needed)?

More generally, what about interactive tests?

It will depend a lot on the use case and the implementation. I would start with first things first, displaying and editing boards.

The unicode approach may not be the way to go. Fonts are not filled in, so you can’t display a white piece on a black field

SVGs would be the next option, but it seems they all get a white background (top in image below), ruling it out as an alternative. PNGs with a transparent background may be an option (bottom in image).

Screenshot%20from%202021-07-06%2016-01-59

1 Like

My impression is that anything which do not involve “intensive” editing of the document, is not something TeXmacs can excel on. Any interactive game is more easily and better coded in HTML/CSS/Javascript, without the need of a separate application. What would be the advantage to play games in TeXmacs wrt. to do it in a browser? I do not see any. TeXmacs is a document editor, not a content delivery platform. This means that it could be used to write books on chess very effectively, but not to play chess. However there could be some interesting space to explore when it comes to interface a document on chess with a software which analyses moves, or when it comes to write a book on programming with pieces of code which can be run directly in TeXmacs and whose output can be collected,… I see some interesting space here where document writing is mixed with some form of “literate programming”.

Exporting to HTML could be made to handle interactive TeXmacs apps.