writer2latex.latex
Class NoteConverter

java.lang.Object
  extended by writer2latex.latex.ConverterHelper
      extended by 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.sty and perpage.sty if allowed in the configuration.


Field Summary
private  boolean bContainsEndnotes
           
private  boolean bContainsFootnotes
           
private  ExportNameCollection endnotenames
           
private  ExportNameCollection footnotenames
           
private  java.util.LinkedList postponedFootnotes
           
 
Fields inherited from class writer2latex.latex.ConverterHelper
config, ofr, palette
 
Constructor Summary
NoteConverter(OfficeReader ofr, Config config, ConverterPalette palette)
           
 
Method Summary
 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.
private  void convertEndnotesConfiguration(LaTeXDocumentPortion ldp)
           
private  void convertFootEndnotesConfiguration(PropertySet notes, java.lang.String sType, LaTeXDocumentPortion ldp)
           
private  void convertFootnotesConfiguration(LaTeXDocumentPortion ldp)
           
 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)
 void insertEndnotes(LaTeXDocumentPortion ldp)
          Insert the endnotes into the documents.
private  void traverseNoteBody(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

footnotenames

private ExportNameCollection footnotenames

endnotenames

private ExportNameCollection endnotenames

bContainsEndnotes

private boolean bContainsEndnotes

bContainsFootnotes

private boolean bContainsFootnotes

postponedFootnotes

private java.util.LinkedList postponedFootnotes
Constructor Detail

NoteConverter

public NoteConverter(OfficeReader ofr,
                     Config config,
                     ConverterPalette palette)
Method Detail

appendDeclarations

public void appendDeclarations(LaTeXDocumentPortion pack,
                               LaTeXDocumentPortion decl)

Append declarations needed by the NoteConverter to the preamble.

Overrides:
appendDeclarations in class ConverterHelper
Parameters:
pack - the LaTeXDocumentPortion to which declarations of packages should be added (\\usepackage).
decl - the LaTeXDocumentPortion to 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 footnote
ldp - the LaTeXDocumentPortion to which LaTeX code should be added
oc - the current context

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 endnote
ldp - the LaTeXDocumentPortion to which LaTeX code should be added
oc - the current context

insertEndnotes

public void insertEndnotes(LaTeXDocumentPortion ldp)

Insert the endnotes into the documents.

Parameters:
ldp - the LaTeXDocumentPortion to 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 reference
ldp - the LaTeXDocumentPortion to which LaTeX code should be added
oc - 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 reference
ldp - the LaTeXDocumentPortion to which LaTeX code should be added
oc - 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 reference
ldp - the LaTeXDocumentPortion to which LaTeX code should be added
oc - the current context

addFootnoteName

public 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.

Parameters:
sName - the name (id) of the footnote

addEndnoteName

public 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.

Parameters:
sName - the name (id) of the endnote

traverseNoteBody

private void traverseNoteBody(org.w3c.dom.Element node,
                              LaTeXDocumentPortion ldp,
                              Context oc)

convertFootnotesConfiguration

private void convertFootnotesConfiguration(LaTeXDocumentPortion ldp)

convertEndnotesConfiguration

private void convertEndnotesConfiguration(LaTeXDocumentPortion ldp)

convertFootEndnotesConfiguration

private void convertFootEndnotesConfiguration(PropertySet notes,
                                              java.lang.String sType,
                                              LaTeXDocumentPortion ldp)