Supporting your system inside TeXmacs

Assume that you have successfully written a first interface with TeXmacs as explained in the previous section. Then it is time now to include support for your system in the standard TeXmacs distribution, after which further improvements can be made.

From version 1.0.1.5 on, it has become quite easy to adapt your interface in such a way that it can be directly integrated into TeXmacs. The idea is to create a directory:

    $TEXMACS_HOME_PATH/plugins/myplugin

where myplugin is the name of your plugin. Here we recall that $TEXMACS_HOME_PATH is bound to ~/.TeXmacs, by default. In the directory $TEXMACS_PATH/plugins you can find all standard plugins, which are shipped with your TeXmacs distribution. These provide good examples which you may imitate.

The above myplugin directory should contain a similar subdirectory structure as $TEXMACS_PATH itself, but you may omit directories which you do not actually use. In any case, you need to provide a file progs/init-myplugin.scm which describes how to initialize your plugin. Usually, this file contains just one Scheme instruction of the following form:

    (plugin-configure myplugin

(:require (file-in-path "myplugin"))

(:launch "shell-cmd")

(:format "input-format" "output-format")

(:session "Myplugin"))

The first instruction is a predicate which checks whether your plugin can be used on a particular system. Usually, it tests whether a certain program is available in the path. The remainder of the instructions is only executed if the requirement is fulfilled. The :launch instruction specifies that your plugin should be launched using shell-cmd. The command shell-cmd is usually of the form myplugin –texmacs. The :format instruction specifies which formats are used for the input and output. Usually, the input-format is verbatim and the output-format is generic. Other available formats are scheme, latex, html and ps. The :session instruction makes shell sessions available for your plugin from the menu TextSessionMyplugin.

If everything works well, and you wish to make it possible for others to use your system inside the official TeXmacs distribution, then contact me at vdhoeven@texmacs.org.

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".