public class LatexStream
extends java.io.PrintStream
startEquation(byte)
, with an
argument determining which type of LaTeX equation should be started.
Aletrnatives are IN_TEXT
, resulting in the equation being enclosed
in dollar signs, EQNARRAY
starts an eqnarray environment,
EQUATION
and equation environment and EQUATION_STAR
an
equation* environment. An equation should be closed by a call to
endEquation()
, though closing or finalising the stream closes an
open equation environment automatically. printVectorsAsRows()
or
printVectorsAsColumns()
, all vectors ar printed as rows or as
columns, respectively.Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
endEquation
strings for ending an equation
|
static byte |
EQNARRAY
the equation will be enclosed by eqnarray
|
static byte |
EQUATION
the equation will be enclosed by equation
|
static byte |
EQUATION_STAR
the equation will be enclosed by equation*
|
private byte |
equationSet
status to keep the equation
|
static byte |
IN_TEXT
the equation is enclosed by '$'-signs
|
private static byte |
NONE
No equation is open
|
private static java.lang.String |
rowSeparator
the separator used for separating rows in vectors and matrices.
|
static java.lang.String |
SEPARATOR_COMMA
a comma followed by a space.
|
static java.lang.String |
SEPARATOR_SPACE
a string constant representing a unbreakable space in latex.
|
private java.lang.String[] |
startEquation
strings for starting an equation
|
protected boolean |
vectorsAsRows
flag indication whether vectors should be printed as columns or rows.
|
Constructor and Description |
---|
LatexStream(java.io.File file) |
LatexStream(java.io.File file,
java.lang.String csn) |
LatexStream(java.io.OutputStream out) |
LatexStream(java.io.OutputStream out,
boolean autoFlush) |
LatexStream(java.io.OutputStream out,
boolean autoFlush,
java.lang.String encoding) |
LatexStream(java.lang.String fileName) |
LatexStream(java.lang.String fileName,
java.lang.String csn) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
endEquation()
end an equation
|
protected void |
finalize() |
static java.lang.String |
getRowSeparator() |
boolean |
isEqStarted()
allow to check whether an equation is started.
|
void |
print(IRingElement<?> f)
Print
Rational s |
void |
print(java.lang.Iterable<?> set)
print sets of things (i.e. orbits)
|
void |
print(Matrix<? extends IRingElement<?>> m)
print a matrix in a latex array.
|
void |
print(java.lang.Object obj)
print arbitrary objects (including JLinAlg objects)
|
void |
print(Vector<? extends IRingElement<?>> v)
Print a JLinAlg Vector in a row or an latex array (see
vectorsAsRows ). |
void |
printVectorsAsColumns()
After calling this method, vectors are printed as columns
|
void |
printVectorsAsRows()
After calling this method, vectors are printed as rows
|
static void |
setRowSeparator(java.lang.String rowSeparator) |
void |
startEquation(byte type)
start an equation
|
append, append, append, checkError, clearError, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
private byte equationSet
protected boolean vectorsAsRows
private static final byte NONE
public static final byte EQUATION_STAR
public static final byte EQUATION
public static final byte EQNARRAY
public static final byte IN_TEXT
public static final java.lang.String SEPARATOR_SPACE
public static final java.lang.String SEPARATOR_COMMA
private static java.lang.String rowSeparator
SEPARATOR_SPACE
SEPARATOR_COMMA
(default)private java.lang.String[] startEquation
private java.lang.String[] endEquation
public LatexStream(java.io.File file, java.lang.String csn) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
file
- csn
- java.io.FileNotFoundException
java.io.UnsupportedEncodingException
public LatexStream(java.io.File file) throws java.io.FileNotFoundException
file
- java.io.FileNotFoundException
public LatexStream(java.io.OutputStream out, boolean autoFlush, java.lang.String encoding) throws java.io.UnsupportedEncodingException
out
- autoFlush
- encoding
- java.io.UnsupportedEncodingException
public LatexStream(java.io.OutputStream out, boolean autoFlush)
out
- autoFlush
- public LatexStream(java.io.OutputStream out)
out
- public LatexStream(java.lang.String fileName, java.lang.String csn) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
fileName
- csn
- java.io.FileNotFoundException
java.io.UnsupportedEncodingException
public LatexStream(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- java.io.FileNotFoundException
public static java.lang.String getRowSeparator()
public static void setRowSeparator(java.lang.String rowSeparator)
rowSeparator
- the rowSeparator to setpublic void startEquation(byte type)
type
- the type of the equation environment to be usepublic boolean isEqStarted()
public void endEquation()
public void printVectorsAsRows()
public void printVectorsAsColumns()
public void print(Vector<? extends IRingElement<?>> v)
vectorsAsRows
).v
- a vectorpublic void print(IRingElement<?> f)
Rational
sf
- a RationalLatexStreamError
- is f is not a Rational
public void print(Matrix<? extends IRingElement<?>> m)
m
- the matrix to be printedpublic void print(java.lang.Iterable<?> set)
set
- a set of objects to be printedpublic void print(java.lang.Object obj)
print
in class java.io.PrintStream
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.PrintStream
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable