Package writer2latex.latex

# Class LaTeXDocument

java.lang.Object
writer2latex.latex.LaTeXDocument

All Implemented Interfaces:
  `OutputFile`

public class LaTeXDocument extends Object implements OutputFile

Class representing a LaTeX document.

## Constructor Summary

Constructors
Constructor
Description
`LaTeXDocument(String sName, int nWrap, boolean bIsMaster)`
Constructs a new LaTeX Document.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`containsMath()`
Test whether this document contains mathematical formulas
`LaTeXDocumentPortion`
`getContents()`
Returns the `LaTeXDocumentPortion`, that contains the contents of the document.
`String`
`getFileName()`
Returns the `Document` name with file extension.
`String`
`getMIMEType()`
Get the MIME type of the `OutputFile`.
`String`
`getName()`
Returns the `Document` name with no file extension.
`boolean`
`isMasterDocument()`
Test whether this document is part of the main document flow (master documents) or an auxiliary document
`void`
`setEncoding(String sEncoding)`
Set the output encoding to use when writing the document.
`void`
`write(OutputStream os)`
Writes out the `Document` content to the specified `OutputStream`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LaTeXDocument

public LaTeXDocument(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 the `LaTeXDocument`.
  `nWrap` - Lines should be wrapped after this position
  `bIsMaster` - true if this is a master document

## Method Details

### getName

public String getName()

Returns the `Document` name with no file extension.

Returns:
  The `Document` name with no file extension.

### getFileName

public String getFileName()

Returns the `Document` name with file extension.

Specified by:
  `getFileName` in interface `OutputFile`
Returns:
  The `Document` name with file extension.

### getMIMEType

public String getMIMEType()
Description copied from interface: `OutputFile`
Get the MIME type of the `OutputFile`.

Specified by:
  `getMIMEType` in interface `OutputFile`
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 interface `OutputFile`
Returns:
  true if this document is a master document

### containsMath

public boolean containsMath()
Description copied from interface: `OutputFile`
Test whether this document contains mathematical formulas

Specified by:
  `containsMath` in interface `OutputFile`
Returns:
  true if the document contains formulas

### write

public void write(OutputStream os) throws IOException

Writes out the `Document` content to the specified `OutputStream`.

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 interface `OutputFile`
Parameters:
  `os` - `OutputStream` to write out the `Document` content.
Throws:
  `IOException` - If any I/O error occurs.

### setEncoding

public void setEncoding(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`.