de.dante.extex.typesetter.type.noad.util
Class MathContext

java.lang.Object
  extended byde.dante.extex.typesetter.type.noad.util.MathContext

public class MathContext
extends java.lang.Object

This class provides a container for the information on the current mathematical appearance.

Version:
$Revision: 1.14 $
Author:
Gerd Neugebauer

Constructor Summary
MathContext(StyleNoad style, TypesetterOptions context)
          Creates a new object.
 
Method Summary
 Dimen convert(Mudimen mudimen)
          Convert a mudimen into a dimen.
 Glue convert(Muskip muglue)
          Convert a muglue into a glue.
 TypesetterOptions getOptions()
          Getter for the options.
 StyleNoad getStyle()
          Getter for style.
 FixedDimen mathParameter(MathFontParameter p)
          Extract a font dimen from an appropriate font.
 FixedDimen mathParameter(MathFontParameter p, StyleNoad actualStyle)
          Retrieve a font parameter from either a symbol font or an extension font.
 void setStyle(StyleNoad style)
          Setter for style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathContext

public MathContext(StyleNoad style,
                   TypesetterOptions context)
Creates a new object.

Parameters:
style - the new style
context - the typesetter context
Method Detail

mathParameter

public FixedDimen mathParameter(MathFontParameter p)
                         throws TypesetterException
Extract a font dimen from an appropriate font.

Parameters:
p - the parameter to extract
Returns:
the value of the font dimen
Throws:
TypesetterException - in case of an error. The exception will have a cause exception in it containing a HelpingException
See Also:
"TTP [708]"

mathParameter

public FixedDimen mathParameter(MathFontParameter p,
                                StyleNoad actualStyle)
                         throws TypesetterException
Retrieve a font parameter from either a symbol font or an extension font. If the parameter does not exist then an error is raised.

Parameters:
p - the parameter to extract
actualStyle - the actual style to be used instead of the current style
Returns:
the value of the font dimen
Throws:
TypesetterException - in case of an error. The exception will have a cause exception in it containing a HelpingException

convert

public Dimen convert(Mudimen mudimen)
              throws TypesetterException
Convert a mudimen into a dimen.

From The TeXbook:

There are 18 mu to an em, where the em is taken from family 2 (the math symbols family). In other words, \textfont 2 defines the em value for mu in display and text styles; \scriptfont 2 defines the em for script size material; and \scriptscriptfont 2 defines it for scriptscript size.

Parameters:
mudimen - the math dimen to convert
Returns:
a new instance of a Dimen corresponding to the parameter
Throws:
TypesetterException - in case of an error
See Also:
"TTP [717]"

convert

public Glue convert(Muskip muglue)
             throws TypesetterException
Convert a muglue into a glue. From The TeXbook:

There are 18 mu to an em, where the em is taken from family~2 (the math symbols family). In other words, ^|\textfont|~|2| defines the em value for |mu| in display and text styles; ^|\scriptfont|~|2| defines the em for script size material; and ^|\scriptscriptfont|~|2| defines it for scriptscript size.

Parameters:
muglue - the math glue to convert
Returns:
a new instance of a glue corresponding to the parameter
Throws:
TypesetterException - in case of an error
See Also:
"TTP [716]"

getOptions

public TypesetterOptions getOptions()
Getter for the options.

Returns:
the options

getStyle

public StyleNoad getStyle()
Getter for style.

Returns:
the style.

setStyle

public void setStyle(StyleNoad style)
Setter for style.

Parameters:
style - the style to set.