GNU TeXmacsUser manualReferenceAboutEnglishยทDeutsch
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 corresponds 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 (the style files define a few such units, like tab, hpar or gpag):

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

em

The width of the “M” character in the current font.

fnbot, fntop

The bottom and top \(y\)-coordinates of the current font.

Stretchable font-dependent length units
fn

This is a stretchable variant of 1fs. The default length of 1fn is 1fs. When stretched, 1fn may be reduced to 0.5fs and extended to 1.5fs.

fns

This length defaults to zero, but it may be stretched up till 1fn.

bls

The “base line skip” is the sum of 1fn 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, but in TeXmacs and LaTeX a slightly larger space is used so as to allow for subscripts and superscripts and avoid a too densely looking text.

spc

The (stretchable) width of space character in the current font.

xspc

The additional (stretchable) width of a space character after a period.

Box lengths

Box length units can only be used within some special markup elements, such as move, shift, resize, clipped and image. The principal body of this content (e.g. the content being “moved” in the case of move) is typeset as a box. The following lengths units then correspond to the size and the extents of the box.

w

The width of the box.

h

The height of the box.

l

The logical left \(x\)-coordinate of the box.

r

The logical right \(x\)-coordinate of the box.

b

The logical bottom \(y\)-coordinate of the box.

t

The logical top \(y\)-coordinate of the box.

For instance, the code

<move|Hello there||<plus|-0.5b|-0.5t>>

can be used to center Hello there at the base-line.

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.

paw

The width of the main text in a page (without taking into account the number of columns and paragraph indentations).

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.

guipx

A pixel of the user interface, which takes into account the scaling of high resolution screens.

gw, gh, gu

The width and height of the current graphics and the length of its unit vector (see the gr-frame environment variable).

lcorner, bcorner, rcorner, tcorner

The sizes of the left, bottom, right and top corners of the current ornament.

Durations

For animations, durations are specified using the same mechanism as lengths, with the time units ms or msec (milliseconds), s or sec (seconds), min (minutes) and hr (hours).

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|1em|1pt>|1em|1.5em> evaluates to a length which is 1em by default, at least 1em-1pt and at most 1.5em.

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