public class LatexTableWriter extends DocumentedStreamStarTableWriter
standalone
attribute,
the output may either be a complete LaTeX document or just a
tabular
environment suitable for inserting into an existing
document.Constructor and Description |
---|
LatexTableWriter()
Constructs a new writer with default characteristics.
|
LatexTableWriter(boolean standalone)
Constructs a new writer indicating whether it will produce complete
or partial LaTeX documents.
|
Modifier and Type | Method and Description |
---|---|
boolean |
docIncludesExample()
Indicates whether the serialization of some (short) example table
should be added to the user documentation for this handler.
|
String |
getFormatName()
Returns the string "LaTeX-document" or "LaTeX";
|
String |
getMimeType()
Returns a string suitable for use as the value of a MIME
Content-Type header.
|
String |
getXmlDescription()
Returns user-directed documentation in XML format.
|
boolean |
isStandalone()
Indicates whether output tables will be complete LaTeX documents.
|
protected void |
printFooter(OutputStream ostrm,
StarTable startab)
For standalone output, this method is invoked to output any text
following the
tabular environment. |
protected void |
printHeader(OutputStream ostrm,
StarTable startab)
For standalone output, this method is invoked to output any text
preceding the
tabular environment. |
void |
setStandalone(boolean standalone)
Sets whether output tables should be complete LaTeX documents.
|
void |
writeStarTable(StarTable startab,
OutputStream ostrm)
Writes a
StarTable object to a given output stream. |
getExtensions, looksLikeFile, writeStarTable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
matchesExtension, readText, toLink
public LatexTableWriter()
public LatexTableWriter(boolean standalone)
@ConfigMethod(property="standalone", doc="<p>If true, the output is a freestanding LaTeX document consisting of a <code>tabular</code> environment within a <code>table</code> within a <code>document</code>. If false, the output is just a <code>tabular</code> environment.</p>") public void setStandalone(boolean standalone)
standalone
- true if the output document should be a
complete LaTeX documentpublic boolean isStandalone()
public String getFormatName()
public String getMimeType()
StarTableWriter
application/octet-stream
"
(for binary formats) or "text/plain
" for ASCII ones)
is recommended.public boolean docIncludesExample()
DocumentedIOHandler
Documented.getXmlDescription()
method already includes some example output, should return false.public String getXmlDescription()
Documented
The output should be a sequence of one or more <P> elements, using XHTML-like XML. Since rendering may be done in a number of contexts however, use of the full range of XHTML elements is discouraged. Where possible, the content should stick to simple markup such as the elements P, A, UL, OL, LI, DL, DT, DD EM, STRONG, I, B, CODE, TT, PRE.
public void writeStarTable(StarTable startab, OutputStream ostrm) throws IOException
StarTableWriter
StarTable
object to a given output stream.
The implementation can assume that out
is suitable for
direct writing (for instance it should not normally wrap it in a
BufferedOutputStream
), and should not close it
at the end of the call.
Not all table writers are capable of writing to a stream;
an implementation may throw a TableFormatException
to
indicate that it cannot do so.
startab
- the table to writeostrm
- the output stream to which startab
should be
writtenTableFormatException
- if this table cannot be written to a
streamIOException
- if there is some I/O errorprotected void printHeader(OutputStream ostrm, StarTable startab) throws IOException
tabular
environment. May be overridden to
modify the form of output documents.ostrm
- output streamstartab
- table for which header is requiredIOException
protected void printFooter(OutputStream ostrm, StarTable startab) throws IOException
tabular
environment. May be overridden to
modify the form of output documents.ostrm
- the stream to write tostartab
- the StarTable which the tabular will containIOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.