TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

LaTeX lengths
TUG logo

Main page

Search CTAN:


Google c.t.t.

Google d.c.t.t.



Introduction |  Stripping Unit with Glue  | 

A length register is in TeX defined by
There are 256 possible registers \dimen0 ... \dimen255. For more information have a look at the TeXBook or http://www.tug.org/utilities/plain/cseq.html#dimen-rp. It is possible to define symbolic names for length registers:
In the first case \myLength is a synonym for dimen2. In the second case we do not know which register TeX chooses, it takes the fisrt free one.

In LaTeX we call dimension registers still a length and define it by
It is possible to compare two lengthts with the TeX command \ifdim. In the following example file the length \lThree depends to two other lenghts.

The \ifdim has the usual structure

\ifdim ... \else ... \fi
where the \else part is optional. \the shows the value of a length.

It is also possible to define a macro which returns the greatest width of two lengths:

 This shows you can use \greaterof anywhere you can use a length

Stripping the Unit and Glue

If you need only the number of a length without its unit then you can use one of the LaTeX macros. But none of these can handle lengthes with glue:


local time: Mon May 27 06:13:45 CEST 2024 ; file is: 1796.56002314815 days old
contact webmaster _at_ TeXnik.de