Package writer2latex.latex
Class LaTeXDocument
- java.lang.Object
-
- writer2latex.latex.LaTeXDocument
-
- All Implemented Interfaces:
OutputFile
public class LaTeXDocument extends java.lang.Object implements OutputFile
Class representing a LaTeX document.
-
-
Constructor Summary
Constructors Constructor Description LaTeXDocument(java.lang.String sName, int nWrap, boolean bIsMaster)
Constructs a new LaTeX Document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LaTeXDocumentPortion
getContents()
Returns theLaTeXDocumentPortion
, that contains the contents of the document.java.lang.String
getFileName()
Returns theDocument
name with file extension.java.lang.String
getMIMEType()
Get the MIME type of theOutputFile
.java.lang.String
getName()
Returns theDocument
name with no file extension.boolean
isMasterDocument()
Test whether this document is part of the main document flow (master documents) or an auxiliary documentvoid
setEncoding(java.lang.String sEncoding)
Set the output encoding to use when writing the document.void
write(java.io.OutputStream os)
Writes out theDocument
content to the specifiedOutputStream
.
-
-
-
Constructor Detail
-
LaTeXDocument
public LaTeXDocument(java.lang.String sName, int nWrap, boolean bIsMaster)
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 Detail
-
getName
public java.lang.String getName()
Returns the
Document
name with no file extension.- Returns:
- The
Document
name with no file extension.
-
getFileName
public java.lang.String getFileName()
Returns the
Document
name with file extension.- Specified by:
getFileName
in interfaceOutputFile
- Returns:
- The
Document
name with file extension.
-
getMIMEType
public java.lang.String getMIMEType()
Description copied from interface:OutputFile
Get the MIME type of theOutputFile
.- Specified by:
getMIMEType
in interfaceOutputFile
- Returns:
- string representation of the MIME type
-
isMasterDocument
public boolean isMasterDocument()
Description copied from interface:OutputFile
Test whether this document is part of the main document flow (master documents) or an auxiliary document- Specified by:
isMasterDocument
in interfaceOutputFile
- Returns:
- true if this document is a master document
-
write
public void write(java.io.OutputStream os) throws java.io.IOException
Writes out the
Document
content 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:
write
in interfaceOutputFile
- Parameters:
os
-OutputStream
to write out theDocument
content.- Throws:
java.io.IOException
- If any I/O error occurs.
-
setEncoding
public void setEncoding(java.lang.String sEncoding)
Set the output encoding to use when writing the document.
-
getContents
public LaTeXDocumentPortion getContents()
Returns the
LaTeXDocumentPortion
, that contains the contents of the document.- Returns:
- The content
LaTeXDocumentPortion
.
-
-