TeXmacs lengths

A simple TeXmacs length is a number followed by a length unit, like 1cm or 1.5mm. TeXmacs supports three main types of units:

Absolute units
The length of an absolute unit like cm or pt on print is fixed.
Context dependent units
Context-dependent length units depend on the current font or other environment variables. For instance, 1ex corresponds to the height of the “x” character in the current font and 1par correspond to the current paragraph width.
User defined units

Any nullary macro, whose name contains only lower case roman letters followed by -length, and which returns a length, can be used as a unit itself. For instance, the following macro defines the dm length:

<assign|dm-length|<macro|10cm>>

Furthermore, length units can be stretchable. A stretchable length is represented by a triple of rigid lengths: a minimal length, a default length and a maximal length. When justifying lines or pages, stretchable lengths are automatically sized so as to produce nicely looking layout.

In the case of page breaking, the page-flexibility environment provides additional control over the stretchability of white space. When setting the page-flexibility to 1, stretchable spaces behave as usual. When setting the page-flexibility to 0, stretchable spaces become rigid. For other values, the behaviour is linear.

Absolute length units

cm
One centimeter.
mm
One millimeter.
in
One inch.
pt
The standard typographic point corresponds to 1/72.27 of an inch.
bp
A big point corresponds to 1/72 of an inch.
dd
The Didôt point equals 1/72 of a French inch, i.e. 0.376mm.
pc
One “pica” equals 12 points.
cc
One “cicero” equals 12 Didôt points.

Rigid font-dependent length units

fs

The font size. When using a 12pt font, 1fs corresponds to 12pt .

fbs

The base font size. Typically, when selecting 10 as the font size for your document and when typing large text, the base font size is 10pt and the font size 12pt .

ln
The width of a nicely looking fraction bar for the current font.
sep
A typical separation between text and graphics for the current font, so as to keep the text readable. For instance, the numerator in a fraction is shifted up by 1sep.
yfrac
The height of the fraction bar for the current font (approximately 0.5ex).
ex
The height of the “x” character in the current font.
emunit
The width of the “M” character in the current font.

Stretchable font-dependent length units

fn
This is a stretchable variant of 1quad. The default length of 1fn is 1quad. When stretched, 1fn may be reduced to 0.5fn and extended to 1.5fn.
fns
This length defaults to zero, but it may be stretched up till 1fn.
bls

The “base line skip” is the sum of 1quad and par-sep. It corresponds to the distance between successive lines of normal text.

Typically, the baselines of successive lines are separated by a distance of 1fn (in TeXmacs and LaTeX a slightly larger space is used though so as to allow for subscripts and superscripts and avoid a too densely looking text. When stretched, 1fn may be reduced to 0.5fn and extended to 1.5fn.

spc
The (stretchable) width of space character in the current font.
xspc
The additional (stretchable) width of a space character after a period.

Other length units

par
The width of the paragraph. That is the length the text can span. It is affected by paper size, margins, number of columns, column separation, cell width (if in a table), etc.
pag
The height of the main text in a page. In a similar way as par, this length unit is affected by page size, margins, etc.
px
One screen pixel, the meaning of this unit is affected by the shrinking factor.
tmpt
The smallest length unit for internal length calculations by TeXmacs. 1px divided by the shrinking factor corresponds to 256tmpt.

Different ways to specify lengths

There are three types of lengths in TeXmacs:

Simple lengths
A string consisting of a number followed by a length unit.
Abstract lengths
An abstract length is a macro which evaluates to a length. Such lengths have the advantage that they may depend on the context.
Normalized lengths
All lengths are ultimately converted into a normalized length, which is a tag of the form <tmlen|l> (for rigid lengths) or <tmlen|min|def|max> (for stretchable lengths). The user may also use this tag in order to specify stretchable lengths. For instance, <tmlen|<minus|1quad|1pt>|1quad|1.5quad> evaluates to a length which is 1quad by default, at least 1quad-1pt and at most 1.5quad.
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".