|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.markup.latex.LaBaseTag
cox.jmatt.java.MathTools.markup.latex.LaDocument
public class LaDocument
This class represents the entire LaTeX document. It provides equipment to handle the preamble, the title and any other document-wide configuration that
might be needed. When either toString()
method is called the result is a complete LaTeX document, ready for rendering.
There are three basic types of methods here: document structure methods, editing methods and convenience methods. The structuring methods affect the preamble
and the overall document. The editing methods add content to the document itself. The convenience methods present shortcuts to such things as changing font
size or adding MathGenLatex.LaSymbol
s to the document body.
The document class is set by the setType()
method, see it for the types available. This can be set any time before toString()
as can any of the other structure methods. The editing (and convenience) methods all append to the end of the current content so order is important there. Since
this class represents the final form of a LaTeX document there are no end-tag-suppressed options. Both copyOfSET()
and toStringSET()
return non-SET values.
Field Summary |
---|
Fields inherited from class cox.jmatt.java.MathTools.markup.latex.LaBaseTag |
---|
BS, DBS, DBSN, myAuthor, myDate, myEndTag, myEnvironment, myEnvParams, myOptions, myPicHasOrigin, myPicX, myPicXOrigin, myPicY, myPicYOrigin, mySectionLabel, myTagName, myTitle |
Constructor Summary | |
---|---|
LaDocument()
Standard constructor. |
Method Summary | |
---|---|
LaDocument |
add(LaBaseTag pTag)
Add a LaBaseTag to the current content. |
LaDocument |
addChapter(java.lang.String pData)
Add a '/chapter{}' tag. |
LaDocument |
addComment(java.lang.String pComment)
Add a single-line comment to the document text. |
LaDocument |
addFS(java.lang.String pFontSize,
java.lang.String pText)
Convenience method to alter the font size of the text. |
LaDocument |
addLine(int pHeight)
Add a blank line to the document. |
LaDocument |
addLine(java.lang.String pLine)
Add a line of text to the content. |
LaDocument |
addParagraph(java.lang.String pData)
Add a '/paragraph{}' tag. |
LaDocument |
addPParagraph(java.lang.String pData)
Add a '/subparagraph{}' tag. |
LaDocument |
addRaw(java.lang.String pText)
Add raw text to the current content. |
LaDocument |
addSection(java.lang.String pData)
Add a '/section{}' tag. |
LaDocument |
addSSection(java.lang.String pData)
Add a '/subsection{}' tag. |
LaDocument |
addSSSection(java.lang.String pData)
Add a '/subsubsection{}' tag. |
LaDocument |
addSymbol(int pNumDS,
java.lang.String pBefore,
java.lang.String pAfter,
java.lang.String pSymbol,
java.lang.String... pParams)
Add a MathGenLatex.LaSymbol to the current content. |
LaDocument |
addSymbol(java.lang.String pSymbol,
java.lang.String... pParams)
This is the quick version of addSymbol() . |
LaDocument |
copyOf()
Create and return a copy of this document. |
LaDocument |
copyOfSET()
No document is ever without its end tag. |
LaDocument |
include(java.lang.String pFile,
boolean pInclude)
Include the contents of an external file in the document. |
LaDocument |
newline()
Add a '/newline' to the document. |
LaDocument |
newPage()
Add a '/newpage' directive to the document. |
void |
reset()
Overridden to clear document-specific information: title, author, date, packages etc. |
LaDocument |
setDocOptions(java.lang.String pOptions)
This method sets any options that appear with the '/documentclass[]...' tag. |
LaDocument |
setTitle(java.lang.String pTitle,
java.lang.String pAuthor,
java.lang.String pDate)
Set all title information. |
LaDocument |
setType(char pType)
Set the '/documentclass' of this document. |
java.lang.String |
toString()
Overridden to include the preamble before the 'begin...' tag. |
java.lang.String |
toStringSET()
This class always has its end tag. |
LaDocument |
usePackage(java.lang.String pPackage,
java.lang.String pOpts)
This method provides the '/usepackage...' commands. |
Methods inherited from class cox.jmatt.java.MathTools.markup.latex.LaBaseTag |
---|
_addContent, _addRawContent, _getContent, _setEndTagEnabled, _setETEn, getEndTag, hasEndTag, isEndTagEnabled, setLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LaDocument()
Method Detail |
---|
public LaDocument setTitle(java.lang.String pTitle, java.lang.String pAuthor, java.lang.String pDate)
pTitle
- The document title.pAuthor
- The document author.pDate
- The date for the document.public LaDocument setType(char pType)
Set the '/documentclass' of this document. Six options are available and each is represented by a single character:
public LaDocument setDocOptions(java.lang.String pOptions)
pOptions
- The options String to set on the 'documentclass' tag.public void reset()
reset
in class LaBaseTag
public LaDocument usePackage(java.lang.String pPackage, java.lang.String pOpts)
pPackage
- The package to use.pOpts
- The package options to include, or null for none.public LaDocument add(LaBaseTag pTag)
LaBaseTag
to the current content. Any tag except LaDocument
or a subclass of it can be added. The tag is added as-is via its
toString()
method so changing it after adding it has no effect on this content. A single newline is added at the end.
pTag
- The tag to be added.public LaDocument addLine(java.lang.String pLine)
LaBaseTag.DBSN
is added for a blank line.
public LaDocument addLine(int pHeight)
pHeight
- The height of the blank line in points (pt.). An extra newline is added for a blank line in the generated document.public LaDocument newline()
public LaDocument newPage()
public LaDocument addComment(java.lang.String pComment)
pComment
- A String comment to add. It must contain NO newline characters.public LaDocument include(java.lang.String pFile, boolean pInclude)
Include the contents of an external file in the document. Ignored if 'pFile' is null or blank. A newline is appended at the end.
The 'pInclude' parameter determines which LaTeX directive is issued: '/include' (true) or '/input' (false). In the former case LaTeX places a page break before the included material. In the latter case it does not. IMPORTANT NOTE: This method does not itself copy the file contents, it merely issues the appropriate LaTeX directive.
pFile
- The filename containing the markup to be included.pInclude
- true to 'include,' false to 'input.'public LaDocument addRaw(java.lang.String pText)
public LaDocument addSymbol(int pNumDS, java.lang.String pBefore, java.lang.String pAfter, java.lang.String pSymbol, java.lang.String... pParams)
MathGenLatex.LaSymbol
to the current content. A newline is included afterward automatically. If the symbol requested is null or blank
nothing happens.
pNumDS
- The number of dollar signs to wrap around the result.pSymbol
- The symbol to add.pParams
- Any parameters required by the symbol.pBefore
- The prefix String; after the initial dollar sign(s) and before the symbol starts.pAfter
- The suffix String, after the Symbol and before the ending dollar signs and newline.public LaDocument addSymbol(java.lang.String pSymbol, java.lang.String... pParams)
addSymbol()
. It takes ONLY the symbol name and parameters. NO dollar signs, prefix or suffix.
public LaDocument addChapter(java.lang.String pData)
public LaDocument addSection(java.lang.String pData)
public LaDocument addSSection(java.lang.String pData)
public LaDocument addSSSection(java.lang.String pData)
public LaDocument addParagraph(java.lang.String pData)
public LaDocument addPParagraph(java.lang.String pData)
public LaDocument addFS(java.lang.String pFontSize, java.lang.String pText)
Convenience method to alter the font size of the text. This method uses the MathGenLatex.LaSymbol
'FS...' constants internally. It supplies
the 'FS' so only the font style desired is needed. DO NOT include the 'FS' otherwise it will be repeated! A single newline is appended.
If either argument is null or blank nothing happens.
pFontSize
- The ('FS'-less) name of the font effect.pText
- The text to be modified.public java.lang.String toString()
toString
in class LaBaseTag
public java.lang.String toStringSET()
toString()
.
toStringSET
in class LaBaseTag
public LaDocument copyOf()
copyOf
in class LaBaseTag
public LaDocument copyOfSET()
copyOf()
.
copyOfSET
in class LaBaseTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |