Class NoteConverter
- java.lang.Object
-
- writer2latex.latex.ConverterHelper
-
- writer2latex.latex.NoteConverter
-
public class NoteConverter extends ConverterHelper
This class handles conversion of footnotes and endnotes, including references. It takes advantage of the packages
endnotes.styandperpage.styif allowed in the configuration.
-
-
Field Summary
-
Fields inherited from class writer2latex.latex.ConverterHelper
config, ofr, palette
-
-
Constructor Summary
Constructors Constructor Description NoteConverter(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEndnoteName(java.lang.String sName)Add an endnote name.voidaddFootnoteName(java.lang.String sName)Add a footnote name.voidappendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)Append declarations needed by theNoteConverterto the preamble.voidflushFootnotes(LaTeXDocumentPortion ldp, Context oc)Flush the queue of postponed footnotesvoidhandleEndnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process an endnote (text:endnote tag)voidhandleEndnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process an endnote reference (text:endnote-ref tag)voidhandleFootnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a footnote (text:footnote tag)voidhandleFootnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a footnote reference (text:footnote-ref tag)voidhandleNoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a note reference (text:note-ref tag, oasis)booleanhasPendingFootnotes(Context oc)Do we have any pending footnotes, that may be inserted in this context?voidinsertEndnotes(LaTeXDocumentPortion ldp)Insert the endnotes into the documents.
-
-
-
Constructor Detail
-
NoteConverter
public NoteConverter(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
-
-
Method Detail
-
appendDeclarations
public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Append declarations needed by the
NoteConverterto the preamble.- Overrides:
appendDeclarationsin classConverterHelper- Parameters:
pack- theLaTeXDocumentPortionto which declarations of packages should be added (\\usepackage).decl- theLaTeXDocumentPortionto which other declarations should be added.
-
handleFootnote
public void handleFootnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a footnote (text:footnote tag)
- Parameters:
node- The element containing the footnoteldp- theLaTeXDocumentPortionto which LaTeX code should be addedoc- the current context
-
hasPendingFootnotes
public boolean hasPendingFootnotes(Context oc)
Do we have any pending footnotes, that may be inserted in this context?- Parameters:
oc- the context to verify against- Returns:
- true if there are pending footnotes
-
flushFootnotes
public void flushFootnotes(LaTeXDocumentPortion ldp, Context oc)
Flush the queue of postponed footnotes
-
handleEndnote
public void handleEndnote(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process an endnote (text:endnote tag)
- Parameters:
node- The element containing the endnoteldp- theLaTeXDocumentPortionto which LaTeX code should be addedoc- the current context
-
insertEndnotes
public void insertEndnotes(LaTeXDocumentPortion ldp)
Insert the endnotes into the documents.
- Parameters:
ldp- theLaTeXDocumentPortionto which the endnotes should be added.
-
handleNoteRef
public void handleNoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a note reference (text:note-ref tag, oasis)
- Parameters:
node- The element containing the note referenceldp- theLaTeXDocumentPortionto which LaTeX code should be addedoc- the current context
-
handleFootnoteRef
public void handleFootnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process a footnote reference (text:footnote-ref tag)
- Parameters:
node- The element containing the footnote referenceldp- theLaTeXDocumentPortionto which LaTeX code should be addedoc- the current context
-
handleEndnoteRef
public void handleEndnoteRef(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)Process an endnote reference (text:endnote-ref tag)
- Parameters:
node- The element containing the endnote referenceldp- theLaTeXDocumentPortionto which LaTeX code should be addedoc- the current context
-
addFootnoteName
public void addFootnoteName(java.lang.String sName)
Add a footnote name. The method
handleFootnoteincludes a\labelonly if the footnote name is already known to theNoteConverter. Hence this method is invoked by the prepass for each footnote reference. The end result is, that only necessary labels will be included.- Parameters:
sName- the name (id) of the footnote
-
addEndnoteName
public void addEndnoteName(java.lang.String sName)
Add an endnote name. The method
handleEndnoteincludes a\labelonly if the endnote name is already known to theNoteConverter. Hence this method is invoked by the prepass for each endnote reference. The end result is, that only necessary labels will be included.- Parameters:
sName- the name (id) of the endnote
-
-