![]() |
Organization of style files and packages | ![]() |
Each standard TeXmacs style file or package is based on a potentially finite number of subpackages. From an abstract point of view, this organization may be represented by a labeled tree. For instance, the tree which corresponds to the article style is represented below:
![]() |
Most of the style packages correspond to a d.t.d. (data type definition) which contains the “abstract interface” of the package, i.e. the exported tags. For instance, the package std-markup corresponds to the d.t.d. std-markup. Sometimes however, several style packages match the same d.t.d.. For instance, both header-article and header-book match the d.t.d. header, since they merely implement different ways to render the same tags.
When building your own style files or packages, you may use the use-package primitive in order to include other packages. For instance, the article style essentially consists of the line
<use-package|std|env|title-generic|header-article|section-article> |
More precisely, the use-package primitive sequentially includes the style packages corresponding to its arguments. The packages are searched in the directory of the current file and in $TEXMACS_STYLE_PATH, which by default contains all subdirectories of ~/.TeXmacs/styles, ~/.TeXmacs/packages, $TEXMACS_PATH/styles, $TEXMACS_PATH/packages and of the styles and packages directories of the installed plug-ins. Furthermore rendering information for the source code like style-with tags are discarded before evaluation of the files. Similarly, the use-module primitive may be used to load a Scheme module on which the package depends, as in <use-module|(database title-markup)>.
Remark 1. We strongly recommend the user to take a look at some of the standard style files and packages which can be found in
$TEXMACS_PATH/styles
$TEXMACS_PATH/packages
When loading using ?, these paths are in the standard load path. For instance, if you want to take a look at the std-markup package, then it suffices to type ?, followed by the file name
std-markup.ts
and ↩.
Remark 2. It is also possible to customize the presentation of the source code of the style files and packages themselves, by using other packages in addition to source or by using another major style file based on source. In that case, the extra markup provided by such packages may be used for presentation purposes of the source code, but it is not exported when using your package in another file.