java.lang.Object
org.extex.interpreter.type.AbstractCode
All Implemented Interfaces:
java.io.Serializable, Code

This class provides an implementation for the primitive \cleaders.

The primitive \cleaders is a leaders construction which centers the material if it does not fit perfectly. The primitive takes as the first argument a box or rule. The second argument is a horizontal or vertical skip specification. The two arguments have to agree on the orientation; either both are horizontal or both are vertical.

The primitive behaves like a glue node with the given skip characteristics. This means it participates in the distribution of the space in the surrounding box. When the final dimensions of the leader element are determined then the empty space is filled with the given box or rule.

The simplest case is a rule which is adjusted to the actual size of the element. This means it either stretches horizontally or vertically according to its orientation.

If a box is given then the contents of the box is repeated within the free space until it is filled. If the space can not be filled exactly then the remaining space is distributed evenly at both ends. This means that the box material is replicated and centered within the given rectangle. As a consequence nothing will appear on the page if the available space is smaller than the natural width of the box.

Note that there are also the primitives \xleaders and \leaders which provide essentially the same functionality but adjust the material within the final space differently.

#### Syntax

The formal description of this primitive is the following:
→ \cleaders ⟨Box or Rule⟩ ⟨Skip⟩

⟨Box or Rule⟩
→ ⟨Box⟩
| ⟨Rule⟩

#### Examples

This example creates a horizontal rule which fills the space made up by the \hfill. The rule stretches horizontally and has its natural dimensions vertically.

This example demonstrates the same in vertical direction. Since only \vil is used it may not appear at all when the other elements in the surrounding box overrule it.

This example shows a box of the width 2em which has a centered period in it. The contents of the box is repeated until it fills the space available. If the final width is a multiple of 2em then then this space is filled up. If the available space leaves some freedom then this extra space is distributed equally on the left and right end.

Version:
$Revision:4431$
Author:
Gerd Neugebauer

Field Summary
protected static long serialVersionUID
The constant serialVersionUID contains the id for serialization.

Constructor Summary
Creates a new object.

Method Summary
protected  void addNode(Typesetter typesetter, OrientedNode node, FixedGlue skip)
Finally make an appropriate node and add it to the typesetter.

execute

Methods inherited from class org.extex.interpreter.type.AbstractCode
getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

### serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

Constant Field Values
Constructor Detail

Creates a new object.

Parameters:
token - the initial token for the primitive
Method Detail