class documentation

class LaTeXFootnoteTransform(SphinxPostTransform):

View In Hierarchy

Convert footnote definitions and references to appropriate form to LaTeX.

  • Replace footnotes on restricted zone (e.g. headings) by footnotemark node. In addition, append a footnotetext node after the zone.

    Before:

    <section>
        <title>
            headings having footnotes
            <footnote_reference>
                1
        <footnote ids="id1">
            <label>
                1
            <paragraph>
                footnote body
    

    After:

    <section>
        <title>
            headings having footnotes
            <footnotemark refid="id1">
                1
        <footnotetext ids="id1">
            <label>
                1
            <paragraph>
                footnote body
    
  • Integrate footnote definitions and footnote references to single footnote node

    Before:

    blah blah blah
    <footnote_reference refid="id1">
        1
    blah blah blah ...
    
    <footnote ids="id1">
        <label>
            1
        <paragraph>
            footnote body
    

    After:

    blah blah blah
    <footnote ids="id1">
        <label>
            1
        <paragraph>
            footnote body
    blah blah blah ...
    
  • Replace second and subsequent footnote references which refers same footnote definition by footnotemark node.

    Before:

    blah blah blah
    <footnote_reference refid="id1">
        1
    blah blah blah
    <footnote_reference refid="id1">
        1
    blah blah blah ...
    
    <footnote ids="id1">
        <label>
            1
        <paragraph>
            footnote body
    

    After:

    blah blah blah
    <footnote ids="id1">
        <label>
            1
        <paragraph>
            footnote body
    blah blah blah
    <footnotemark refid="id1">
        1
    blah blah blah ...
    
  • Remove unreferenced footnotes

    Before:

    <footnote ids="id1">
        <label>
            1
        <paragraph>
            Unreferenced footnote!
    

    After:

    <!-- nothing! -->
    
  • Move footnotes in a title of table or thead to head of tbody

    Before:

    <table>
        <title>
            title having footnote_reference
            <footnote_reference refid="id1">
                1
        <tgroup>
            <thead>
                <row>
                    <entry>
                        header having footnote_reference
                        <footnote_reference refid="id2">
                            2
            <tbody>
                <row>
                ...
    
    <footnote ids="id1">
        <label>
            1
        <paragraph>
            footnote body
    
    <footnote ids="id2">
        <label>
            2
        <paragraph>
            footnote body
    

    After:

    <table>
        <title>
            title having footnote_reference
            <footnotemark refid="id1">
                1
        <tgroup>
            <thead>
                <row>
                    <entry>
                        header having footnote_reference
                        <footnotemark refid="id2">
                            2
            <tbody>
                <footnotetext ids="id1">
                    <label>
                        1
                    <paragraph>
                        footnote body
    
                <footnotetext ids="id2">
                    <label>
                        2
                    <paragraph>
                        footnote body
                <row>
                ...
    
Method run Main method of post transforms.
Class Variable default​_priority Undocumented
Class Variable formats Undocumented

Inherited from SphinxPostTransform:

Method apply Undocumented
Method is​_supported Check this transform working for current builder.
Class Variable builders Undocumented

Inherited from SphinxTransform (via SphinxPostTransform):

Property app Reference to the .Sphinx object.
Property config Reference to the .Config object.
Property env Reference to the .BuildEnvironment object.
def run(self, **kwargs):

Main method of post transforms.

Subclasses should override this method instead of apply().

Parameters
**kwargs:AnyUndocumented
default_priority: int =

Undocumented

formats: tuple[str, ...] =