org.extex.unit.tex.typesetter.box
Class Vbox

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.tex.typesetter.box.AbstractBoxPrimitive
          extended by org.extex.unit.tex.typesetter.box.Vbox
All Implemented Interfaces:
java.io.Serializable, Boxable, BoxOrRule, Code
Direct Known Subclasses:
Vtop

public class Vbox
extends AbstractBoxPrimitive

This class provides an implementation for the primitive \vbox.

The Primitive \vbox

The primitive \vbox constructs a box of vertical material. Any boxes added to the vertical box are put below the boxes already contained. The reference point of the last box contained is used for the whole vertical box. The height may be adjusted if requested.

The contents of the toks register \everyvbox is inserted at the beginning of the vertical material of the box.

Syntax

The formal description of this primitive is the following:
    ⟨vbox⟩
      → \vbox ⟨box specification⟩ { ⟨vertical material⟩ }

    ⟨box specification⟩
      →
         | to ⟨rule dimension⟩
         | spread ⟨rule dimension⟩  

Examples

    \vbox{abc}  
    \vbox to 120pt{abc}  
    \vbox spread 12pt{abc}  

The Tokens Parameter \everyvbox

The tokens parameter is used in \vbox. The tokens contained are inserted at the beginning of the vertical material of the vbox.

Syntax

The formal description of this primitive is the following:
    ⟨everyvbox⟩
      → \everyvbox ⟨equals⟩ ⟨tokens⟩  

Examples

    \everyvbox{\message{Hi there}}  

Version:
$Revision:4431 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Vbox(CodeToken token)
          Creates a new object.
 
Method Summary
protected  Box acquireBox(Context context, TokenSource source, Typesetter typesetter, GroupType groupType, Token startToken, Token ins)
          Acquire a complete Box taking into account the tokens in \afterassignment and \everyvbox.
protected  Box constructBox(Context context, TokenSource source, Typesetter typesetter, Token startToken, Token insert)
          Acquire a Box and adjust its height and depth according to the rules required.
 Box getBox(Context context, TokenSource source, Typesetter typesetter, Token insert)
          Getter for the content as Box.
 
Methods inherited from class org.extex.unit.tex.typesetter.box.AbstractBoxPrimitive
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.

See Also:
Constant Field Values
Constructor Detail

Vbox

public Vbox(CodeToken token)
Creates a new object.

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

getBox

public Box getBox(Context context,
                  TokenSource source,
                  Typesetter typesetter,
                  Token insert)
           throws HelpingException,
                  TypesetterException
Getter for the content as Box.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter to use
insert - the token to insert either at the beginning of the box or after the box has been gathered. If it is null then nothing is inserted
Returns:
an appropriate Box
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
See Also:
BoxPrimitive.getBox( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter, org.extex.scanner.type.token.Token)

constructBox

protected Box constructBox(Context context,
                           TokenSource source,
                           Typesetter typesetter,
                           Token startToken,
                           Token insert)
                    throws HelpingException,
                           TypesetterException
Acquire a Box and adjust its height and depth according to the rules required.

For a \vbox the alignment takes the last box contained and uses its reference point. The depth is preserved and the height is adjusted if required.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
startToken - the token which started the group
insert - the token to insert at the beginning or null
Returns:
the complete Box
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter

acquireBox

protected Box acquireBox(Context context,
                         TokenSource source,
                         Typesetter typesetter,
                         GroupType groupType,
                         Token startToken,
                         Token ins)
                  throws HelpingException,
                         TypesetterException
Acquire a complete Box taking into account the tokens in \afterassignment and \everyvbox.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
groupType - the group type
startToken - the token which started the group
ins - the token to insert at te beginning
Returns:
the complete Box
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter