Package writer2latex.latex

# Class LaTeXDocumentPortion

java.lang.Object
writer2latex.latex.LaTeXDocumentPortion

public class LaTeXDocumentPortion extends Object
This class represents a portion of a LaTeX document. A portion is any number of lines, and may include subportions.

## Constructor Summary

Constructors
Constructor
Description
`LaTeXDocumentPortion(boolean bWrap)`
Construct a new empty `LaTeXDocumentPortion`

## Method Summary

Modifier and Type
Method
Description
`LaTeXDocumentPortion`
`append(int n)`
Add an integer to the end of this portion
`LaTeXDocumentPortion`
`append(String s)`
Add a string to the end of this portion
`LaTeXDocumentPortion`
`append(LaTeXDocumentPortion ldp)`
Add another portion to the end of this portion
`LaTeXDocumentPortion`
`nl()`
Add a newline to the end of this portion
`String`
`toString()`
Return the content of this LaTeXDocumentPortion as a string
`void`
`write(OutputStreamWriter osw, int nLineLen, String sNewline)`
Write this portion to the output

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

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

## Constructor Details

### LaTeXDocumentPortion

public LaTeXDocumentPortion(boolean bWrap)
Construct a new empty `LaTeXDocumentPortion`

Parameters:
  `bWrap` - set to true if lines may be wrapped on writing

## Method Details

### append

public LaTeXDocumentPortion append(LaTeXDocumentPortion ldp)
Add another portion to the end of this portion

Parameters:
  `ldp` - The `LaTeXDocuemtPortion` to add
Returns:
  a reference to this `LaTeXDocumentPortion` (not the appended one)

### append

public LaTeXDocumentPortion append(String s)
Add a string to the end of this portion

Parameters:
  `s` - the string to add
Returns:
  a reference to this `LaTeXDocumentPortion`

### append

public LaTeXDocumentPortion append(int n)
Add an integer to the end of this portion

Parameters:
  `n` - the integer to add
Returns:
  a reference to this `LaTeXDocumentPortion`

### nl

public LaTeXDocumentPortion nl()
Add a newline to the end of this portion

Returns:
  a reference to this `LaTeXDocumentPortion`

### write

public void write(OutputStreamWriter osw, int nLineLen, String sNewline) throws IOException
Write this portion to the output

Parameters:
  `osw` - an `OutputStreamWriter` to write to
  `nLineLen` - the line length after which automatic line breaks should occur if allowed (nLineLen=0 means no wrap)
  `sNewline` - the newline character(s) to use
Throws:
  `IOException` - if an exception occurs writing to to osw

### toString

public String toString()
Return the content of this LaTeXDocumentPortion as a string

Overrides:
  `toString` in class `Object`
Returns:
  a string representation of the `LaTeXDocumentPortion`