cox.jmatt.java.MathTools.markup.latex
Class MathGenLatex

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.latex.MathGenLatex

public class MathGenLatex
extends java.lang.Object

This class exists to generate the various tag classes in the MathTools latex.* package. It serves the same purpose as MathDrawSVG and MathGenHTML. In addition to factory methods for the other markup.latex.* classes it contains the LaSymbol enum. The constants in this enum all define a format(String...) method. In some cases it is empty but in others it is used to provide properly-formatted markup without worrying about slapping Strings together manually.


Nested Class Summary
static class MathGenLatex.LaSymbol
          This enum holds some of the (millions of) LaTeX symbols and commands used with mathematics.
 
Constructor Summary
MathGenLatex()
          Constructor for script exposure.
 
Method Summary
 java.lang.String ddWrap(java.lang.String pData)
          Wrap a String in double dollar signs.
 java.lang.String dWrap(java.lang.String pData)
          Wrap a String in single dollar signs.
 java.lang.String fill_Symbol(java.lang.String pSymbol, java.lang.String... pParams)
          Instance shadow.
static java.lang.String fillSymbol(java.lang.String pSymbol, java.lang.String... pParams)
          Fetch and format a LaSymbol.
 MathGenLatex.LaSymbol get_Symbol(java.lang.String pSymbol)
          Instance shadow of getSymbol().
static MathGenLatex.LaSymbol getSymbol(java.lang.String pSymbol)
          Fetch a LaSymbol by name.
 LaDocument newAMSDoc()
          Create a new LaDocument with the amsmath package pre-installed.
 LaDocument newDocument()
          Create and return a new LaDocument.
 LEquation newEquation()
          Create and return a new equation block tag.
 LaTag newLaTag(java.lang.String pName)
          Create and return a new LaTag with the name supplied.
 LaListTag newList()
          Create and return a new list tag.
 LaPicture newPicture(int pX, int pY)
          Create a LaPicture with only the width and height specified.
 LaPicture newPicture(int pX, int pY, int pX0, int pY0)
          Create and return a LaPicture with size and origin specified.
 LaTable newTable()
          Create an empty table.
 LaTable newTable(java.lang.String pColAlign)
          Create an empty table with the given column alignment specifier.
static java.lang.String wrapDS(java.lang.String pData, int pNum)
          Wrap a non-null, non-blank String in dollar signs ('$').
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathGenLatex

public MathGenLatex()
Constructor for script exposure.

Method Detail

getSymbol

public static MathGenLatex.LaSymbol getSymbol(java.lang.String pSymbol)
Fetch a LaSymbol by name. The 'pSymbol' parameter is converted to uppercase so lowercase letters can be used. If the symbol cannot be found LaSymbol.NOTEXIST is returned and a Debug-level message is logged.

Parameters:
pSymbol - The LaSymbol to fetch.

get_Symbol

public MathGenLatex.LaSymbol get_Symbol(java.lang.String pSymbol)
Instance shadow of getSymbol().


fillSymbol

public static java.lang.String fillSymbol(java.lang.String pSymbol,
                                          java.lang.String... pParams)
Fetch and format a LaSymbol.

Parameters:
pSymbol - The desired symbol.
pParams - The parameters required for the symbol.

fill_Symbol

public java.lang.String fill_Symbol(java.lang.String pSymbol,
                                    java.lang.String... pParams)
Instance shadow.


wrapDS

public static java.lang.String wrapDS(java.lang.String pData,
                                      int pNum)
Wrap a non-null, non-blank String in dollar signs ('$'). If the data String is null or blank an empty String is returned.

Parameters:
pData - String to wrap.
pNum - Number of dollar signs to put on each side.

dWrap

public java.lang.String dWrap(java.lang.String pData)
Wrap a String in single dollar signs.


ddWrap

public java.lang.String ddWrap(java.lang.String pData)
Wrap a String in double dollar signs. Notice the double 'd' as opposed to one.


newLaTag

public LaTag newLaTag(java.lang.String pName)
Create and return a new LaTag with the name supplied.


newList

public LaListTag newList()
Create and return a new list tag.


newEquation

public LEquation newEquation()
Create and return a new equation block tag.


newDocument

public LaDocument newDocument()
Create and return a new LaDocument.


newAMSDoc

public LaDocument newAMSDoc()
Create a new LaDocument with the amsmath package pre-installed.


newTable

public LaTable newTable()
Create an empty table.


newTable

public LaTable newTable(java.lang.String pColAlign)
Create an empty table with the given column alignment specifier.


newPicture

public LaPicture newPicture(int pX,
                            int pY)
Create a LaPicture with only the width and height specified.


newPicture

public LaPicture newPicture(int pX,
                            int pY,
                            int pX0,
                            int pY0)
Create and return a LaPicture with size and origin specified.