Writing your first interface with TeXmacs

In order to write your first interface to TeXmacs, we recommend you to follow the following steps:

  1. Create a –texmacs option for your program which will be used for calling your program from inside TeXmacs.
  2. Modify your output routines in a such a way that the appropriate output is send to TeXmacs when your program is started with the –texmacs option.
  3. Create a mycas script in your path which executes your program with the –texmacs option.

After doing this, your program will be available under the name Mycas in TextSession. We will explain later how to make your system listed under its own name, how to customize it, and how to get the interface incorporated into the main TeXmacs distribution.

Usually, step 2 is the most complicated one and the time it will cost you depends on how your system was designed. If you designed clean output routines (including the routines for displaying error messages), then it usually suffices to modify these by mimicking the mycas example and reusing existing LaTeX output routines, which most systems provide.

At the moment, we only implemented LaTeX as a standard transmission format for mathematical formulas, because this is the format which is most widely used. In the future, we intend to implement more semantically secure formats, and we recommend you to keep in mind the possibility of sending your output in tree format.

Nevertheless, we enriched standard LaTeX with the \* and \bignone commands for multiplication and closing big operators. This allows us to distinguish between:

    a \* (b + c)

(or a multiplied by b + c) and:

    f(x + y)

(or f applied to x + y). Similarly, in:

    \sum_{i=1}^m a_i \bignone + \sum_{j=1}^n b_j \bignone

the \bignone command is used in order to specify the scopes of the \sum operators.

It turns out that the systematic use of the \* and \bignone commands, in combination with clean LaTeX output for the remaining constructs, makes it a priori possible to associate an appropriate meaning to your output. In particular, this usually makes it possible to write additional routines for copying and pasting formulae between different systems.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".