Local customization

Even though TeXmacs tries hard to render source code in a nice way following the global rendering options that you specified, the readability of the source code often needs to be further enhanced locally. In source mode, this can be done using the menus SourceActivation and SourcePresentation. Any local hints on how to render source code are automatically removed from the document when it is being used as a style file or package.

First of all, for certain pieces of content the user may prefer to see them in their “activated” form instead as dead source code. This may for instance be the case for embedded images, or for mathematical symbols, like in

<assign|R|<macro|R>>

Such an active presentation may also be preferred for certain more complex macros:

< assign | diag | < macro | var | dim | (

var1 0
0 vardim
) > >

A piece of code can be activated by selecting it and using SourceActivationActivate or M-+. Similarly, a piece of content may be deactivated using M-- (we used this in the second example above for the rendering of the arguments var and dim). Activation and deactivation either apply to the whole tree, or to the root only (e.g. SourceActivationActivate once).

Another way to customize the rendering is to override some of the global rendering options. This is mainly interesting for controlling more precisely which tags have to be stretched across several lines and which tags have to be represented in a compact fashion. For instance, the concat tag can be used in order to concatenate content, as well as for specifying a block of sequential statements, or a combination of both. For instance, in the piece of code

< assign | my-section | < macro | title |

<\concat|

<header-hook|title>

|

<toc-hook|title>

|

<my-section-title|title>

>

> >

we have stretched the concat tag along several lines using SourcePresentationStretched (notice that this implies the concat tag to appear explicitly, so as to avoid confusion with the document tag). Similarly, if a part of the concatenation were to be displayed as usual, then one may use SourcePresentationCompact:

< assign | my-section | < macro | title |

<\concat|

<header-hook|title>

|

<toc-hook|title>

|

<with|font-series|bold|Section:> title

>

> >

At present, we did not implement a way to mark arguments as inline or block, but we might do this later.

A final way to customize the rendering of source code is to apply an arbitrary macro using SourcePresentationApply macro or SourcePresentationApply macro once. This macro will be automatically removed when you use your document as a style file or package.

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