The primitive TeXmacs constructs

This page is far from up to date. Also, we need one file for each category and one page for each primitive, with an example.

1. Main formatting constructs

(document p1 ... pn)


The general form of the edit tree, which is a document consisting of the paragraphs p1, ..., pn . Can also be used in subtrees to create a multiparagraph block in contexts which would be otherwise restricted line content; for example multiparagraph table cells use nested document nodes.
(concat t1 ... tn)


Horizontal concatenation of the trees t1, ..., tn . Often, but not always, the paragraphs of the main edit tree are concatenations.
(surround left right body)


Surround multiparagraph text body by left and right .
(hspace spc) or (hspace spc min max)


Horizontal space of length spc . The optional min and max parameters indicate that the space may be shrinked or extended to these values. We notice that certain units of length, like fn , automatically provide shrinking and extension information.
(vspace* spc) or (vspace* spc min max)


Insert vertical space of length spc before this paragraph.
(vspace spc) or (vspace spc min max)


Insert vertical space of length spc after this paragraph.
(space spc bot top)


Insert horizontal space of length spc , with bottom and top lines at heights bot resp. top .
(htab spc)


Tabbing space of minimal length spc .
(split pos1 ... posn)


Split the current paragraph as a table of n columns, which are alligned following pos1, ..., posn .
(move t x y)


Move the tree n horzontally by length x and vertically by length y .
(resize t "normal" x1 y1 x2 y2)


New logical bounding box of t has (x1,y1) as its lower left corner and (x2,y2) as its upper right corner.
(resize t "extend" x1 y1 x2 y2)


As above, but the new bounding box is forced to include the old one.
(format "line break")


Forces a line break.
(format "new line")


Forces a new line.
(format "line separator")


Like the TeX & command.
(format "next line")


Like the TeX \\ command.
(format "no line break")


Prevents a line break.
(format "no first indentation")


Prevent left indentation for this paragraph.
(format "no last indentation")


Prevent right indentation for this paragraph.
(format "enable first indentation")


Force left indentation for this paragraph.
(format "enable last indentation")


Force right indentation for this paragraph.
(format "page break")


Forces a page break.
(format "new page")


Forces a new page.
(format "no page break before")


Prevents a page break before this line.
(format "no page break after")


Prevents a page break after this line.
(format "with limits")


Notify that the preceding text has limits. This results subscripts and superscripts to be placed under and over the preceding text.

2. Mathematical constructs

(group t)


Consider t as an entity (a bit like enclosing t within accolades in TeX).
(left s)


A large left delimiter s .
(middle s)


A large separator s .
(right s)


A large right delimiter s .
(big s)


A big operator s .
(lprime s)


A left prime s .
(rprime s)


A right prime s .
(below t sub)


Subscript sub below t .
(above t sup)


Superscript sup above t .
(lsub script)


Left subscript script for text which follows.
(lsup script)


Left superscript script for text which follows.
(rsub script)


Right subscript script for preceding text.
(rsup script)


Right superscript script for preceding text.
(frac num den)


Fraction with numerator num and denominator den .
(sqrt t) or (sqrt t n)


Square root of t or n -th root of t .
(wide t accent)


Wide accent above t .
(neg t)


Wipe out t with a negation slash.
(tree root t1 ... tn)


Tree with root root and children t1, ..., tn .
(matrix t11 ... t1m ...... tn1 ... tnm n m)


n by m matrix with entries tij .
(table t11 ... t1m ...... tn1 ... tnm n m)


n by m table with entries tij .
(mosaic t11 ... t1m ...... tn1 ... tnm n m)


n by m table whose entries tij can be aligned and merged.
(mosaic item t pos x y bg)


This field in a mosaic contains t , is positioned at pos , spans over x columns and y rows, and has background bg .

3. Environment variables, macros, functions, etc.

(assign var t)


Assign the environment variable var with t .
(with var1 val1 ... varn valn body)


Locally assign the environment variables var1, ..., varn with val1, ..., valn inside body .
(expand f t1 ... tn)


Expand the macro f with arguments t1, ..., tn .
(apply f t1 ... tn)


Apply the function f to t1, ..., tn .
(func arg1 ... argn body)


Function with arguments arg1, ..., argn and body body .
(argument var)


Macro argument var .
(value var)


Value of var .
(symbol s)


For entering a universal symbol.
(latex cmd)


For entering a LaTeX command.
(hybrid cmd)


For entering a TeXmacs function call, a LaTeX command, or a universal symbol.
(quote t)


Evaluates to t .
(eval t)


Evaluate t .
(delay (cmd t1 ... tn))


Evaluates arguments t1, ..., tn to u1, ..., un and returns (cmd u1 ... un) .

4. Functional operators

(plus t u)


Add the numbers or lengths t and u .
(minus t u)


Subtract the numbers or lengths t and u .
(times t u)


Multiply the numbers t and u .
(merge t u)


Concatenate the strings t and u .
(number t what)


The number t in what (roman, alpha, etc.).
(translate t from into)


Translate t from from into into .

5. Other dynamic content

(inactive t)


Deactivate an environmental or invisible operator for editing.
(label name)


Label with name name .
(reference name)


Reference to label with name name .
(write t aux)


Write t to auxiliairy data buffer aux . This construct is used for creating tables of contents, bibliographies, glossaries, etc.
(specific what t)


Specifies that t should only appear when the document is converted to what . If what is "TeXmacs" , then t only appears in TeXmacs itself.
(postscript file width height x1 y1 x2 y2)


Postscript (or other kind of) figure in file , of width width , length length , lower left clipping corner (x1,y1) and upper right clipping corner (x2,y2) . The parameters width, height, x1, y1, x2, y2 may be empty strings, in which case the default settings of the image are used. The width and the height may also be of the form *mag or /schrink , in which case the default lengths are magnified resp. shrinked by a factor mag resp. schrink .

6. For private use

(tuple t1 ... tn)


The tuple (t1, ..., tn) .
(collection t1 ... tn)


The set {t1, ..., tn} .
(associate t u)


The association t -> u .
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".