Writing your own plug-ins |
In order to write a plug-in myplugin, you should start by creating a directory
$TEXMACS_HOME_PATH/plugins/myplugin
where to put all your files (recall that $TEXMACS_HOME_PATH defaults to $HOME/.TeXmacs). In addition, you may create the following subdirectories (when needed):
As a general rule, files which are present in these subdirectories will be automatically recognized by TeXmacs at startup. For instance, if you provide a bin subdirectory, then
$TEXMACS_HOME_PATH/plugins/myplugin/bin
will be automatically added to the PATH environment variable at startup. Notice that the subdirectory structure of a plug-in is very similar to the subdirectory structure of $TEXMACS_PATH.
$TEXMACS_HOME_PATH/plugins/myplugin $TEXMACS_HOME_PATH/plugins/myplugin/styles $TEXMACS_HOME_PATH/plugins/myplugin/packages
and to put your style files and packages in the last two
directories. After restarting TeXmacs, your style files and packages
will automatically appear in the
For more complex plug-ins, such as plug-ins with additional
$TEXMACS_HOME_PATH/plugins/myplugin/progs/init-myplugin.scm
This configuration file should contain an instruction of the following form
(plugin-configure myplugin
configuration-options)
Here the configuration-options describe the principal actions which have to be undertaken at startup, including sanity checks for the plug-in. In the next sections, we will describe some simple examples of plug-ins and their configuration. Many other examples can be found in the directories
$TEXMACS_PATH/examples/plugins $TEXMACS_PATH/plugins
Some of these are described in more detail in the chapter about writing new interfaces.