public class NoteConverter
extends java.lang.Object
This class handles conversion of footnotes and endnotes, including
references. It takes advantage of the packages endnotes.sty
and perpage.sty
if allowed in the configuration.
Constructor and Description |
---|
NoteConverter(OfficeReader ofr,
LaTeXConfig config,
ConverterPalette palette) |
Modifier and Type | Method and Description |
---|---|
void |
addEndnoteName(java.lang.String sName)
Add an endnote name.
|
void |
addFootnoteName(java.lang.String sName)
Add a footnote name.
|
void |
appendDeclarations(LaTeXDocumentPortion pack,
LaTeXDocumentPortion decl)
Append declarations needed by the
NoteConverter to
the preamble. |
void |
flushFootnotes(LaTeXDocumentPortion ldp,
Context oc)
Flush the queue of postponed footnotes
|
void |
handleEndnote(org.w3c.dom.Element node,
LaTeXDocumentPortion ldp,
Context oc)
Process an endnote (text:endnote tag)
|
void |
handleEndnoteRef(org.w3c.dom.Element node,
LaTeXDocumentPortion ldp,
Context oc)
Process an endnote reference (text:endnote-ref tag)
|
void |
handleFootnote(org.w3c.dom.Element node,
LaTeXDocumentPortion ldp,
Context oc)
Process a footnote (text:footnote tag)
|
void |
handleFootnoteRef(org.w3c.dom.Element node,
LaTeXDocumentPortion ldp,
Context oc)
Process a footnote reference (text:footnote-ref tag)
|
void |
handleNoteRef(org.w3c.dom.Element node,
LaTeXDocumentPortion ldp,
Context oc)
Process a note reference (text:note-ref tag, oasis)
|
boolean |
hasPendingFootnotes(Context oc)
Do we have any pending footnotes, that may be inserted in this context?
|
void |
insertEndnotes(LaTeXDocumentPortion ldp)
Insert the endnotes into the documents.
|
public NoteConverter(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Append declarations needed by the NoteConverter
to
the preamble.
pack
- the LaTeXDocumentPortion
to which
declarations of packages should be added (\\usepackage
).decl
- the LaTeXDocumentPortion
to which
other declarations should be added.public void handleFootnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
Process a footnote (text:footnote tag)
node
- The element containing the footnoteldp
- the LaTeXDocumentPortion
to which
LaTeX code should be addedoc
- the current contextpublic boolean hasPendingFootnotes(Context oc)
oc
- the context to verify againstpublic void flushFootnotes(LaTeXDocumentPortion ldp, Context oc)
public void handleEndnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
Process an endnote (text:endnote tag)
node
- The element containing the endnoteldp
- the LaTeXDocumentPortion
to which
LaTeX code should be addedoc
- the current contextpublic void insertEndnotes(LaTeXDocumentPortion ldp)
Insert the endnotes into the documents.
ldp
- the LaTeXDocumentPortion
to which
the endnotes should be added.public void handleNoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
Process a note reference (text:note-ref tag, oasis)
node
- The element containing the note referenceldp
- the LaTeXDocumentPortion
to which
LaTeX code should be addedoc
- the current contextpublic void handleFootnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
Process a footnote reference (text:footnote-ref tag)
node
- The element containing the footnote referenceldp
- the LaTeXDocumentPortion
to which
LaTeX code should be addedoc
- the current contextpublic void handleEndnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
Process an endnote reference (text:endnote-ref tag)
node
- The element containing the endnote referenceldp
- the LaTeXDocumentPortion
to which
LaTeX code should be addedoc
- the current contextpublic void addFootnoteName(java.lang.String sName)
Add a footnote name. The method handleFootnote
includes
a \label
only if the footnote name is already known to the
NoteConverter
. Hence this method is invoked by the prepass
for each footnote reference. The end result is, that only necessary
labels will be included.
sName
- the name (id) of the footnotepublic void addEndnoteName(java.lang.String sName)
Add an endnote name. The method handleEndnote
includes
a \label
only if the endnote name is already known to the
NoteConverter
. Hence this method is invoked by the prepass
for each endnote reference. The end result is, that only necessary
labels will be included.
sName
- the name (id) of the endnote