|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.interpreter.type.AbstractCode
org.extex.unit.tex.typesetter.leaders.Leaders
public class Leaders
This class provides an implementation for the primitive \leaders.
The Primitive \leaders
The primitive \leaders is a leaders construction which aligns the
material on an imaginary grid on the page. 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. The repeated boxes are aligned on an imaginary grid on the page which guarantees that the boxes fit together tightly. A box is only shown if it fits entirely into the space available. The leaders construction provides something like a window onto an infinite grid filled with the given boxes.
For a horizontal alignment nothing may appear unless the final width of the alignment is at least two times the width of the box to be inserted.
As a consequence of the alignment on the grid several invocations of \leaders with the same box will align those boxes. This can be used in a table of figures to align the dos connecting the title and the page number.
Note that there are also the primitives \cleaders and \xleaders which provide essentially the same functionality but adjust the material within the final space differently.
〈leaders〉
→ \leaders 〈Box or Rule〉 〈Skip〉
〈Box or Rule〉
→ 〈Box〉
| 〈Rule〉
\leaders\hrule\hfill
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.
\leaders\vrule\vfil
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.
\leaders\hbox to 2em{\hss .\hss}\hfill
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.
AlignedLeadersNode,
Serialized Form| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
Leaders(CodeToken token)
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. |
void |
execute(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
This method takes the first token and executes it. The result is placed on the stack. This operation might have side effects. To execute a token it might be necessary to consume further tokens. |
| 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 |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public Leaders(CodeToken token)
token - the initial token for the primitive| Method Detail |
|---|
public void execute(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException,
TypesetterException
execute in interface Codeexecute in class AbstractCodeprefix - the prefix controlling the executioncontext - the interpreter contextsource - the token sourcetypesetter - the typesetter
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetterCode.execute(
org.extex.interpreter.Flags, org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)
protected void addNode(Typesetter typesetter,
OrientedNode node,
FixedGlue skip)
throws TypesetterException
typesetter - the typesetternode - the nodeskip - the skip amount
TypesetterException - in case of an error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||