Package writer2latex.latex
Class LaTeXDocument
java.lang.Object
writer2latex.latex.LaTeXDocument
- All Implemented Interfaces:
OutputFile
Class representing a LaTeX document.
-
Constructor Summary
ConstructorsConstructorDescriptionLaTeXDocument(String sName, int nWrap, boolean bIsMaster) Constructs a new LaTeX Document. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether this document contains mathematical formulasReturns theLaTeXDocumentPortion, that contains the contents of the document.Returns theDocumentname with file extension.Get the MIME type of theOutputFile.getName()Returns theDocumentname with no file extension.booleanTest whether this document is part of the main document flow (master documents) or an auxiliary documentvoidsetEncoding(String sEncoding) Set the output encoding to use when writing the document.voidwrite(OutputStream os) Writes out theDocumentcontent to the specifiedOutputStream.
-
Constructor Details
-
LaTeXDocument
Constructs a new LaTeX Document.
This new document is empty. Document data must added to the preamble and the body using appropriate methods.
- Parameters:
sName- The name of theLaTeXDocument.nWrap- Lines should be wrapped after this positionbIsMaster- true if this is a master document
-
-
Method Details
-
getName
Returns the
Documentname with no file extension.- Returns:
- The
Documentname with no file extension.
-
getFileName
Returns the
Documentname with file extension.- Specified by:
getFileNamein interfaceOutputFile- Returns:
- The
Documentname with file extension.
-
getMIMEType
Description copied from interface:OutputFileGet the MIME type of theOutputFile.- Specified by:
getMIMETypein interfaceOutputFile- Returns:
- string representation of the MIME type
-
isMasterDocument
public boolean isMasterDocument()Description copied from interface:OutputFileTest whether this document is part of the main document flow (master documents) or an auxiliary document- Specified by:
isMasterDocumentin interfaceOutputFile- Returns:
- true if this document is a master document
-
containsMath
public boolean containsMath()Description copied from interface:OutputFileTest whether this document contains mathematical formulas- Specified by:
containsMathin interfaceOutputFile- Returns:
- true if the document contains formulas
-
write
Writes out the
Documentcontent to the specifiedOutputStream.This method may not be thread-safe. Implementations may or may not synchronize this method. User code (i.e. caller) must make sure that calls to this method are thread-safe.
- Specified by:
writein interfaceOutputFile- Parameters:
os-OutputStreamto write out theDocumentcontent.- Throws:
IOException- If any I/O error occurs.
-
setEncoding
Set the output encoding to use when writing the document.
-
getContents
Returns the
LaTeXDocumentPortion, that contains the contents of the document.- Returns:
- The content
LaTeXDocumentPortion.
-