|
Scheme serialization |
|
Users may write their own extensions to TeXmacs in the Scheme
extension language. In that context, TeXmacs trees are usually
represented by Scheme expressions. The Scheme syntax was designed to be predictable, easy to
hand-edit, and expose the complete internal structure of the document.
For instance, the formula (?) is represented by
(with "mode" "math" (concat "x+y+" (frac "1" "2") "+" (sqrt "y+z")))
|
The Scheme representation may also be useful in
order to represent complex macros with a lot of programmic content.
Finally, Scheme is the safest format when
incorporating TeXmacs snippets into emails. Indeed, both the standard
TeXmacs format and the XML serialization may be quite sensitive to
white-space.
In order to save or load a document in Scheme
format, you may use File→Export→Scheme resp. File→Import→Scheme.
Files saved in Scheme format can easily be
processed by external Scheme programs, in the
same way as files saved in XML format can easily be processed by tools
for processing XML, like XSLT.
In order to copy a document fragment to an email in Scheme
format, you may use Edit→Copy
to→Scheme. Similarly,
you may paste external Scheme fragments into
TeXmacs using Edit→Paste
from→Scheme. The Scheme format may also used interactively inside Scheme sessions or interactive commands. For instance,
typing M-x followed by the interactive command
inserts the fraction
at the current cursor position.
© 2004 Joris van der Hoeven
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".