§
    _÷#dµQ  ã                   óB  — d Z ddlmZmZmZmZmZmZmZ ddl	m
Z
 ddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZ ddlmZ ddl m!Z! dZ" G d„ de¦  «        Z# G d„ de¦  «        Z$ G d„ de¦  «        Z% G d„ de
j&        ¦  «        Z' G d„ de¦  «        Z( G d„ de
j&        ¦  «        Z) G d„ de¦  «        Z* G d„ de¦  «        Z+ G d„ de¦  «        Z, G d „ d!e¦  «        Z- G d"„ d#e¦  «        Z. G d$„ d%e¦  «        Z/d&ed'ee0ef         fd(„Z1d)S )*zTransforms for LaTeX builder.é    )ÚAnyÚDictÚListÚOptionalÚSetÚTupleÚcast)Únodes)ÚElementÚNode)ÚSubstitutions)Úaddnodes)ÚSphinx)Úcaptioned_literal_blockÚfootnotemarkÚfootnotetextÚmath_referenceÚthebibliography)ÚCitationDomain)ÚSphinxTransform)ÚSphinxPostTransform)ÚNodeMatcher)úmailto:zhttp:zhttps:zftp:c                   óB   — e Zd ZdZdZej        ej        fZde	ddfd„Z
dS )ÚFootnoteDocnameUpdaterz5Add docname to footnote and footnote_reference nodes.i¼  ÚkwargsÚreturnNc                 óz   — t          | j        Ž }| j                             |¦  «        D ]}| j        j        |d<   Œd S )NÚdocname)r   ÚTARGET_NODESÚdocumentÚfindallÚenvr   )Úselfr   ÚmatcherÚnodes       úB/usr/lib/python3/dist-packages/sphinx/builders/latex/transforms.pyÚapplyzFootnoteDocnameUpdater.apply   sH   € Ý˜tÔ0Ð1ˆØ”M×)Ò)¨'Ñ2Ô2ð 	/ð 	/ˆDØ"œhÔ.ˆD�‰OˆOð	/ð 	/ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Údefault_priorityr
   ÚfootnoteÚfootnote_referencer    r   r(   © r)   r'   r   r      sQ   € € € € € Ø?Ð?ØÐØ”N EÔ$<Ð=€Lð/˜cð / dð /ð /ð /ð /ð /ð /r)   r   c                   ó:   — e Zd ZdZej        dz   ZdZdeddfd„ZdS )ÚSubstitutionDefinitionsRemoverz7Remove ``substitution_definition`` nodes from doctrees.é   ©Úlatexr   r   Nc                 ó¢   — t          | j                             t          j        ¦  «        ¦  «        D ]}|j                             |¦  «         Œd S ©N)Úlistr!   r"   r
   Úsubstitution_definitionÚparentÚremove)r$   r   r&   s      r'   Úrunz"SubstitutionDefinitionsRemover.run'   sO   € Ý˜œ×.Ò.­uÔ/LÑMÔMÑNÔNð 	%ð 	%ˆDØŒK×Ò˜tÑ$Ô$Ð$Ð$ð	%ð 	%r)   )	r*   r+   r,   r-   r   r.   Úformatsr   r=   r1   r)   r'   r3   r3       sQ   € € € € € ØAÐAð %Ô5¸Ñ9ÐØ€Gð%˜Cð % Dð %ð %ð %ð %ð %ð %r)   r3   c                   ó†   — e Zd ZdZdZdZdZdeddfd„Zdd	„Z	d
e
defd„Zdededeej        ej        f         fd„Zdd„ZdS )ÚShowUrlsTransformz«Expand references to inline text or footnotes.

    For more information, see :confval:`latex_show_urls`.

    .. note:: This transform is used for integrated doctree
    é�  r5   Fr   r   Nc                 óÀ   — 	 | j         j        }|j        }d|_        |                      ¦   «          | j        r|                      ¦   «          ||_        d S # ||_        w xY w)NÚ	show_urls)r!   ÚsettingsÚ	id_prefixÚexpand_show_urlsÚexpandedÚrenumber_footnotes)r$   r   rD   rE   s       r'   r=   zShowUrlsTransform.run9   ss   € ð	+à œMÔ2ˆHØ Ô*ˆIØ!,ˆHÔà×!Ò!Ñ#Ô#Ð#ØŒ}ð *Ø×'Ò'Ñ)Ô)Ð)ð "+ˆHÔÐÐø ˆHÔÐ*Ð*Ð*Ð*s   ‚A	A Á	Ac                 óþ  — | j         j        }|du s|dk    rd S t          | j                             t
          j        ¦  «        ¦  «        D �]1}|                     dd¦  «        }|                     t          ¦  «        rþ|                     d¦  «        r
|dd …         }| 
                    ¦   «         |k    rÇ|j                             |¦  «        }|                      |¦  «        }|dk    r]|                      ||¦  «        \  }}|j                             |dz   |¦  «         |j                             |d	z   |¦  «         d
| _        Œüt          j        d|z  ¦  «        }|j                             |dz   |¦  «         �Œ3d S )NFÚnoÚrefuriÚ r   é   r/   r4   é   Tz (%s))ÚconfigÚlatex_show_urlsr9   r!   r"   r
   Ú	referenceÚgetÚ
startswithÚURI_SCHEMESÚastextr;   ÚindexÚget_docname_for_nodeÚcreate_footnoteÚinsertrG   ÚText)	r$   rC   r&   ÚurirV   r   ÚfnÚfnrefÚtextnodes	            r'   rF   z"ShowUrlsTransform.expand_show_urlsG   sv  € Ø”KÔ/ˆ	Ø˜ÐÐ ¨dÒ!2Ð!2ØˆFå˜œ×.Ò.­u¬Ñ?Ô?Ñ@Ô@ð 	@ñ 	@ˆDØ—(’(˜8 RÑ(Ô(ˆCØ�~Š~�kÑ*Ô*ð @Ø—>’> )Ñ,Ô,ð "Ø˜a˜b˜bœ'�CØ—;’;‘=”= CÒ'Ð'Ø œK×-Ò-¨dÑ3Ô3�EØ"×7Ò7¸Ñ=Ô=�GØ  JÒ.Ð.Ø$(×$8Ò$8¸¸gÑ$FÔ$F™	˜˜EØœ×*Ò*¨5°1©9°bÑ9Ô9Ð9Øœ×*Ò*¨5°1©9°eÑ<Ô<Ð<à(,˜œ˜å#(¤:¨g¸©mÑ#<Ô#<˜Øœ×*Ò*¨5°1©9°hÑ?Ô?Ð?ùð!	@ð 	@r)   r&   c                 óJ  — |rgt          |t          j        ¦  «        r"| j                             |d         ¦  «        pdS t          |t
          j        ¦  «        r|d         S |j        }|°g	 |d         }n# t          $ r t          d¦  «        d ‚w xY wt          d|›d�¦  «        ‚)NÚsourcerL   r   zFailed to get a docname!z#Failed to get a docname for source ú!)
Ú
isinstancer
   r!   r#   Úpath2docr   Ústart_of_filer;   Ú	TypeErrorÚ
ValueError)r$   r&   r`   s      r'   rW   z&ShowUrlsTransform.get_docname_for_node^   sÈ   € Øð 	#Ý˜$¥¤Ñ/Ô/ð #Ø”x×(Ò(¨¨h¬Ñ8Ô8Ð>¸BÐ>Ý˜D¥(Ô"8Ñ9Ô9ð #Ø˜I”Ð&à”{�ð ð 	#ð	CØ˜(”^ˆFˆFøÝð 	Cð 	Cð 	CÝÐ7Ñ8Ô8¸dÐBð	CøøøåÐJ¸vÐJÐJÐJÑKÔKÐKs   Á+A4 Á4Br[   r   c                 óD  — t          j        dt          j        |¦  «        |d¬¦  «        }t          j        |d|¬¦  «        }|d                              d¦  «         |t          j        dd¦  «        z  }|t          j        dd|¦  «        z  }| j                             |¦  «         t          j	        dd|d	         d
         |¬¦  «        }|t          j        d¦  «        z  }| j         
                    |¦  «         |                     |d	         d
         ¦  «         ||fS )NrL   T)rK   Ú	nolinkurlr4   )Úautor   Únamesú#z[#]_Úidsr   )ri   Úrefidr   )r
   rQ   rZ   r/   ÚappendÚlabelÚ	paragraphr!   Únote_autofootnoter0   Únote_autofootnote_refÚadd_backref)r$   r[   r   rQ   r/   Úfootnote_refs         r'   rX   z!ShowUrlsTransform.create_footnotem   s  € Ý”O B­¬
°3©¬ÀÈtÐTÑTÔTˆ	Ý”> #¨A°wÐ?Ñ?Ô?ˆØ�Ô× Ò  Ñ%Ô%Ð%Ø•E”K  CÑ(Ô(Ñ(ˆØ•E”O B¨¨IÑ6Ô6Ñ6ˆØŒ×'Ò'¨Ñ1Ô1Ð1åÔ/°¸QØ6>¸u´oÀaÔ6HÐRYð[ñ [ô [ˆà�œ
 3™œÑ'ˆØŒ×+Ò+¨LÑ9Ô9Ð9Ø×Ò˜\¨%Ô0°Ô3Ñ4Ô4Ð4à˜Ð%Ð%r)   c           	      ó  — t          | j        ¦  «        }| j                             |¦  «         d}|j        D �]J}	 |dz  }t	          |¦  «        |j        vrnŒt          t          j        |d         ¦  «        }| 	                    t          j        dt	          |¦  «        ¦  «        ¦  «         ||d         v r-|d          
                    |                     ¦   «         ¦  «         |d                              t	          |¦  «        ¦  «         |d         }|j        D ]e}||d         k    rW|d         d         |d         k    r?| 
                    |d         ¦  «         |t          j        t	          |¦  «        ¦  «        z  }Œf�ŒLd S )	Nr   Tr4   rL   rj   r   rl   rm   )ÚFootnoteCollectorr!   Ú	walkaboutÚauto_footnotesÚstrÚused_footnote_numbersr	   r
   ro   Úreplace_selfr<   rU   rn   Úfootnote_refsrZ   )r$   Ú	collectorÚnumr/   Ú	old_labelr   Úrefs          r'   rH   z$ShowUrlsTransform.renumber_footnotes}   s}  € Ý% d¤mÑ4Ô4ˆ	ØŒ×Ò 	Ñ*Ô*Ð*àˆØ!Ô0ð 	0ñ 	0ˆHðØ�q‘�Ý�s‘8”8 9Ô#BÐBÐBØðõ �Uœ[¨(°1¬+Ñ6Ô6ˆIØ×"Ò"¥5¤;¨rµ3°s±8´8Ñ#<Ô#<Ñ=Ô=Ð=Ø˜H WÔ-Ð-Ð-Ø˜Ô!×(Ò(¨×)9Ò)9Ñ);Ô);Ñ<Ô<Ð<Ø�WÔ×$Ò$¥S¨¡X¤XÑ.Ô.Ð.ð ˜yÔ)ˆGØ Ô.ð 0ð 0�Ø˜c )œnÒ,Ð,°¸%´ÀÔ1CÀsÈ7Ä|Ò1SÐ1SØ—J’J˜s 1œvÑ&Ô&Ð&Ø�5œ:¥c¨#¡h¤hÑ/Ô/Ñ/�Cøñ0ð!	0ð 	0r)   )r   N)r*   r+   r,   r-   r.   r>   rG   r   r=   rF   r   ry   rW   r   r
   r/   r0   rX   rH   r1   r)   r'   r@   r@   ,   sà   € € € € € ðð ð ÐØ€Gð €Hð+˜Cð + Dð +ð +ð +ð +ð@ð @ð @ð @ð.L¨ð L°#ð Lð Lð Lð Lð& 3ð &°ð &¸¸u¼~ÈuÔOgÐ?gÔ9hð &ð &ð &ð &ð 0ð 0ð 0ð 0ð 0ð 0r)   r@   c                   óŠ   ‡ — e Zd ZdZdej        ddfˆ fd„Zdeddfd„Zdeddfd„Z	dej
        ddfd	„Zdej        ddfd
„Zˆ xZS )rv   z9Collect footnotes and footnote references on the documentr!   r   Nc                 óŒ   •— g | _         t          ¦   «         | _        g | _        t	          ¦   «                              |¦  «         d S r8   )rx   Úsetrz   r|   ÚsuperÚ__init__)r$   r!   Ú	__class__s     €r'   r…   zFootnoteCollector.__init__›   s=   ø€ Ø46ˆÔÝ/2©u¬uˆÔ"Ø=?ˆÔÝ‰Œ×Ò˜Ñ"Ô"Ð"Ð"Ð"r)   r&   c                 ó   — d S r8   r1   ©r$   r&   s     r'   Úunknown_visitzFootnoteCollector.unknown_visit¡   ó   € Øˆr)   c                 ó   — d S r8   r1   rˆ   s     r'   Úunknown_departurez#FootnoteCollector.unknown_departure¤   rŠ   r)   c                 ó²   — |                      d¦  «        r| j                             |¦  «         d S |d         D ]}| j                             |¦  «         Œd S )Nri   rj   )rR   rx   rn   rz   Úadd)r$   r&   Únames      r'   Úvisit_footnotez FootnoteCollector.visit_footnote§   sj   € Ø�8Š8�FÑÔð 	5ØÔ×&Ò& tÑ,Ô,Ð,Ð,Ð,à˜Wœð 5ð 5�ØÔ*×.Ò.¨tÑ4Ô4Ð4Ð4ð5ð 5r)   c                 ó:   — | j                              |¦  «         d S r8   )r|   rn   rˆ   s     r'   Úvisit_footnote_referencez*FootnoteCollector.visit_footnote_reference®   s   € ØÔ×!Ò! $Ñ'Ô'Ð'Ð'Ð'r)   )r*   r+   r,   r-   r
   r!   r…   r   r‰   rŒ   r/   r�   r0   r’   Ú__classcell__©r†   s   @r'   rv   rv   ˜   sà   ø€ € € € € ØCÐCð# ¤ð #°Dð #ð #ð #ð #ð #ð #ð $ð ¨4ð ð ð ð ð dð ¨tð ð ð ð ð5 5¤>ð 5°dð 5ð 5ð 5ð 5ð(¨UÔ-Eð (È$ð (ð (ð (ð (ð (ð (ð (ð (r)   rv   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚLaTeXFootnoteTransforma­  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.  Additionally, the footnote definition node is marked as
      "referred".

      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" referred=True>
              <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>
                      ...
    iX  r5   r   r   Nc                 ó  — t          | j                             t          j        ¦  «        ¦  «        }|D ]}|j                             |¦  «         Œt          | j        |¦  «        }| j                             |¦  «         d S r8   )	r9   r!   r"   r
   r/   r;   r<   ÚLaTeXFootnoteVisitorrw   )r$   r   Ú	footnotesr&   Úvisitors        r'   r=   zLaTeXFootnoteTransform.run[  sv   € Ý˜œ×.Ò.­u¬~Ñ>Ô>Ñ?Ô?ˆ	Øð 	%ð 	%ˆDØŒK×Ò˜tÑ$Ô$Ð$Ð$å& t¤}°iÑ@Ô@ˆØŒ×Ò Ñ(Ô(Ð(Ð(Ð(r)   ©r*   r+   r,   r-   r.   r>   r   r=   r1   r)   r'   r–   r–   ²   sP   € € € € € ðcð cðJ ÐØ€Gð)˜Cð ) Dð )ð )ð )ð )ð )ð )r)   r–   c                   ó  ‡ — e Zd Zdej        deej                 ddfˆ fd„Zdeddfd„Z	deddfd„Z
deddfd	„Zdeddfd
„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Zdej        ddfd„Z dej!        ddfd„Z"dej!        dej        fd„Z#ˆ xZ$S )r˜   r!   r™   r   Nc                 ó�   •— i | _         || _        g | _        g | _        d | _        t          ¦   «                              |¦  «         d S r8   )Úappearedr™   ÚpendingsÚtable_footnotesÚ
restrictedr„   r…   )r$   r!   r™   r†   s      €r'   r…   zLaTeXFootnoteVisitor.__init__e  sE   ø€ Ø?AˆŒØ/8ˆŒØ.0ˆŒØ57ˆÔØ-1ˆŒÝ‰Œ×Ò˜Ñ"Ô"Ð"Ð"Ð"r)   r&   c                 ó   — d S r8   r1   rˆ   s     r'   r‰   z"LaTeXFootnoteVisitor.unknown_visitm  rŠ   r)   c                 ó   — d S r8   r1   rˆ   s     r'   rŒ   z&LaTeXFootnoteVisitor.unknown_departurep  rŠ   r)   c                 ó&   — | j         €	|| _         d S d S r8   )r¡   rˆ   s     r'   ÚrestrictzLaTeXFootnoteVisitor.restricts  s   € ØŒ?Ð"Ø"ˆDŒOˆOˆOð #Ð"r)   c                 ó  — | j         |k    r€d | _         |j                             |¦  «        }t          | j        ¦  «        D ]A\  }}t          dg|j        ¢R d|d         iŽ}|j                             ||z   dz   |¦  «         ŒBg | _        d S d S )NrL   rl   r4   )r¡   r;   rV   Ú	enumeraterŸ   r   ÚchildrenrY   )r$   r&   ÚposÚir/   Úfntexts         r'   Ú
unrestrictzLaTeXFootnoteVisitor.unrestrictw  s¢   € ØŒ?˜dÒ"Ð"Ø"ˆDŒOØ”+×#Ò# DÑ)Ô)ˆCÝ )¨$¬-Ñ 8Ô 8ð 8ð 8‘��8Ý% bÐR¨8Ô+<ÐRÐRÐRÀ(È5Ä/ÐRÐR�Ø”×"Ò" 3¨¡7¨Q¡;°Ñ7Ô7Ð7Ð7ØˆDŒMˆMˆMð #Ð"r)   c                 ó0   — |                       |¦  «         d S r8   ©r¥   rˆ   s     r'   Úvisit_figurez!LaTeXFootnoteVisitor.visit_figure€  ó   € Ø�Š�dÑÔÐÐÐr)   c                 ó0   — |                       |¦  «         d S r8   ©r¬   rˆ   s     r'   Údepart_figurez"LaTeXFootnoteVisitor.depart_figureƒ  ó   € Ø�Š˜ÑÔÐÐÐr)   c                 ó0   — |                       |¦  «         d S r8   r®   rˆ   s     r'   Ú
visit_termzLaTeXFootnoteVisitor.visit_term†  r°   r)   c                 ó0   — |                       |¦  «         d S r8   r²   rˆ   s     r'   Údepart_termz LaTeXFootnoteVisitor.depart_term‰  r´   r)   c                 ó0   — |                       |¦  «         d S r8   r®   rˆ   s     r'   Úvisit_captionz"LaTeXFootnoteVisitor.visit_captionŒ  r°   r)   c                 ó0   — |                       |¦  «         d S r8   r²   rˆ   s     r'   Údepart_captionz#LaTeXFootnoteVisitor.depart_caption�  r´   r)   c                 óŠ   — t          |j        t          j        t          j        f¦  «        r|                      |¦  «         d S d S r8   )rb   r;   r
   ÚsectionÚtabler¥   rˆ   s     r'   Úvisit_titlez LaTeXFootnoteVisitor.visit_title’  sA   € Ý�d”k¥E¤Mµ5´;Ð#?Ñ@Ô@ð 	 Ø�MŠM˜$ÑÔÐÐÐð	 ð 	 r)   c                 ó  — t          |j        t          j        ¦  «        r|                      |¦  «         d S t          |j        t          j        ¦  «        r3| xj        | j        z  c_        g | _        |                      |¦  «         d S d S r8   )rb   r;   r
   r¾   r¬   r¿   r    rŸ   rˆ   s     r'   Údepart_titlez!LaTeXFootnoteVisitor.depart_title–  s…   € Ý�d”k¥5¤=Ñ1Ô1ð 	"Ø�OŠO˜DÑ!Ô!Ð!Ð!Ð!Ý˜œ¥U¤[Ñ1Ô1ð 	"ØÐ Ô  D¤MÑ1Ð Ô ØˆDŒMØ�OŠO˜DÑ!Ô!Ð!Ð!Ð!ð	"ð 	"r)   c                 ó0   — |                       |¦  «         d S r8   r®   rˆ   s     r'   Úvisit_theadz LaTeXFootnoteVisitor.visit_theadž  r°   r)   c                 óh   — | xj         | j        z  c_         g | _        |                      |¦  «         d S r8   )r    rŸ   r¬   rˆ   s     r'   Údepart_theadz!LaTeXFootnoteVisitor.depart_thead¡  s7   € ØÐÔ ¤Ñ-ÐÔØˆŒØ�Š˜ÑÔÐÐÐr)   c                 óü   — t          |                     t          j        ¦  «        ¦  «        }t	          | j        ¦  «        D ]3}t          dg|j        ¢R d|d         iŽ}|                     d|¦  «         Œ4g | _        d S )NrL   rl   r   )	Únextr"   r
   ÚtbodyÚreversedr    r   r¨   rY   )r$   r&   rÉ   r/   r«   s        r'   Údepart_tablez!LaTeXFootnoteVisitor.depart_table¦  s€   € Ý�T—\’\¥%¤+Ñ.Ô.Ñ/Ô/ˆÝ  Ô!5Ñ6Ô6ð 	$ð 	$ˆHÝ! "ÐN xÔ'8ÐNÐNÐN¸hÀu¼oÐNÐNˆFØ�LŠL˜˜FÑ#Ô#Ð#Ð#à!ˆÔÐÐr)   c                 ó0   — |                       |¦  «         d S r8   r®   rˆ   s     r'   r�   z#LaTeXFootnoteVisitor.visit_footnote®  r°   r)   c                 ó0   — |                       |¦  «         d S r8   r²   rˆ   s     r'   Údepart_footnotez$LaTeXFootnoteVisitor.depart_footnote±  r´   r)   c                 óx  — |                      ¦   «                              ¦   «         }|d         }||f| j        v rB| j        ||f         }d|d<   t          d||d         ¬¦  «        }|                     |¦  «         n´|                      |¦  «        }| j        rHt          d||d         ¬¦  «        }|                     |¦  «         | j                             |¦  «         nD| j	         
                    |¦  «         |                     |¦  «         |                     | ¦  «         || j        ||f<   t          j        ‚)Nr   TÚreferredrL   rm   )rm   )rU   Ústriprž   r   r{   Úget_footnote_by_referencer¡   rŸ   rn   r™   r<   rw   r
   ÚSkipNode)r$   r&   Únumberr   r/   Úmarks         r'   r’   z-LaTeXFootnoteVisitor.visit_footnote_reference´  s9  € Ø—’‘”×$Ò$Ñ&Ô&ˆØ�y”/ˆØ�VÐ ¤Ð-Ð-Ø”} g¨vÐ%6Ô7ˆHØ#'ˆH�ZÑ å  F°$°w´-Ð@Ñ@Ô@ˆDØ×Ò˜dÑ#Ô#Ð#Ð#à×5Ò5°dÑ;Ô;ˆHØŒð )Ý# B¨°d¸7´mÐDÑDÔD�Ø×!Ò! $Ñ'Ô'Ð'Ø”×$Ò$ XÑ.Ô.Ð.Ð.à”×%Ò% hÑ/Ô/Ð/Ø×!Ò! (Ñ+Ô+Ð+Ø×"Ò" 4Ñ(Ô(Ð(à/7ˆDŒM˜7 FÐ+Ñ,ÝŒnÐr)   c                 óš   — |d         }| j         D ]*}||d         k    r|d         d         |d         k    r|c S Œ+t          d|z  ¦  «        ‚)Nr   rl   r   rm   z1No footnote not found for given reference node %r)r™   rf   )r$   r&   r   r/   s       r'   rÒ   z.LaTeXFootnoteVisitor.get_footnote_by_referenceË  sa   € Ø�y”/ˆØœð 	 ð 	 ˆHØ˜( 9Ô-Ò-Ð-°(¸5´/À!Ô2DÈÈWÌÒ2UÐ2UØ���øåÐLÈtÑSÑTÔTÐTr)   )%r*   r+   r,   r
   r!   r   r/   r…   r   r‰   rŒ   r   r¥   r¬   Úfigurer¯   r³   Útermr¶   r¸   Úcaptionrº   r¼   ÚtitlerÀ   rÂ   ÚtheadrÄ   rÆ   r¿   rË   r�   rÎ   r0   r’   rÒ   r“   r”   s   @r'   r˜   r˜   d  s  ø€ € € € € ð# ¤ð #¸DÀÄÔ<Pð #ÐUYð #ð #ð #ð #ð #ð #ð $ð ¨4ð ð ð ð ð dð ¨tð ð ð ð ð#˜Wð #¨ð #ð #ð #ð #ð˜wð ¨4ð ð ð ð ð ¤ð °$ð ð ð ð ð %¤,ð °4ð ð ð ð ð˜uœzð ¨dð ð ð ð ð ¤
ð ¨tð ð ð ð ð %¤-ð °Dð ð ð ð ð 5¤=ð °Tð ð ð ð ð  ¤ð  °ð  ð  ð  ð  ð" ¤ð "°ð "ð "ð "ð "ð ¤ð °ð ð ð ð ð ¤ð °ð ð ð ð ð
" ¤ð "°ð "ð "ð "ð "ð 5¤>ð °dð ð ð ð ð E¤Nð °tð ð ð ð ð¨UÔ-Eð È$ð ð ð ð ð.U¨eÔ.Fð UÈ5Ì>ð Uð Uð Uð Uð Uð Uð Uð Ur)   r˜   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚBibliographyTransformaN  Gather bibliography entries to tail of document.

    Before::

        <document>
            <paragraph>
                blah blah blah
            <citation>
                ...
            <paragraph>
                blah blah blah
            <citation>
                ...
            ...

    After::

        <document>
            <paragraph>
                blah blah blah
            <paragraph>
                blah blah blah
            ...
            <thebibliography>
                <citation>
                    ...
                <citation>
                    ...
    iî  r5   r   r   Nc                 ó  — t          ¦   «         }t          | j                             t          j        ¦  «        ¦  «        D ]!}|j                             |¦  «         ||z  }Œ"t          |¦  «        dk    r| xj        |z  c_        d S d S )Nr   )	r   r9   r!   r"   r
   Úcitationr;   r<   Úlen)r$   r   Ú	citationsr&   s       r'   r=   zBibliographyTransform.runõ  s…   € Ý#Ñ%Ô%ˆ	Ý˜œ×.Ò.­u¬~Ñ>Ô>Ñ?Ô?ð 	ð 	ˆDØŒK×Ò˜tÑ$Ô$Ð$Ø˜ÑˆIˆIåˆy‰>Œ>˜AÒÐØˆMŒM˜YÑ&ˆMŒMˆMˆMð Ðr)   r›   r1   r)   r'   rÝ   rÝ   Ô  sM   € € € € € ðð ð: ÐØ€Gð'˜Cð ' Dð 'ð 'ð 'ð 'ð 'ð 'r)   rÝ   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚCitationReferenceTransformz¹Replace pending_xref nodes for citation by citation_reference.

    To handle citation reference easily on LaTeX writer, this converts
    pending_xref nodes to citation_reference.
    é   r5   r   r   Nc                 ó‚  — t          t          | j                             d¦  «        ¦  «        }t	          t
          j        dd¬¦  «        }| j                             |¦  «        D ]Z}|j	         
                    |d         d¦  «        \  }}}|r1t          j        ddg|j        ¢R ||dœŽ}|                     |¦  «         Œ[d S )Nrß   r€   )Ú	refdomainÚreftypeÚ	reftarget)rL   rL   r   rL   )r   Úrefname)r	   r   r#   Ú
get_domainr   r   Úpending_xrefr!   r"   rá   rR   r
   Úcitation_referencer¨   r{   )	r$   r   Údomainr%   r&   r   ÚlabelidÚ_Úcitation_refs	            r'   r=   zCitationReferenceTransform.run  sÝ   € Ý•n d¤h×&9Ò&9¸*Ñ&EÔ&EÑFÔFˆÝ�hÔ3¸zÐSXÐYÑYÔYˆØ”M×)Ò)¨'Ñ2Ô2ð 	0ð 	0ˆDØ"(Ô"2×"6Ò"6°t¸KÔ7HÈ+Ñ"VÔ"VÑˆG�W˜aØð 0Ý$Ô7¸¸Bð  ZÀÄð  Zð  ZØ@GÐQXð Zð  Zð  Z�à×!Ò! ,Ñ/Ô/Ð/øð	0ð 	0r)   r›   r1   r)   r'   rã   rã   ÿ  sM   € € € € € ðð ð
 ÐØ€Gð0˜Cð 0 Dð 0ð 0ð 0ð 0ð 0ð 0r)   rã   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚMathReferenceTransformz©Replace pending_xref nodes for math by math_reference.

    To handle math reference easily on LaTeX writer, this converts pending_xref
    nodes to math_reference.
    rä   r5   r   r   Nc                 óf  — | j                              d¦  «        j        d         }| j                             t
          j        ¦  «        D ]f}|d         dk    rX|d         dv rN|                     |d         d¦  «        \  }}|r-t          d||d         ¬	¦  «        }| 	                    |¦  «         Œgd S )
NÚmathÚobjectsræ   rç   )ÚeqÚnumrefrè   )NNrL   )r   Útarget)
r#   rê   Údatar!   r"   r   rë   rR   r   r{   )r$   r   Ú	equationsr&   r   rï   Úrefnodes          r'   r=   zMathReferenceTransform.run  s¼   € Ø”H×'Ò'¨Ñ/Ô/Ô4°YÔ?ˆ	Ø”M×)Ò)­(Ô*?Ñ@Ô@ð 	/ð 	/ˆDØ�KÔ  FÒ*Ð*¨t°I¬ÐBRÐ/RÐ/RØ&Ÿ]š]¨4°Ô+<¸lÑKÔK‘
�˜Øð /Ý,¨R¸ÈÈkÔIZÐ[Ñ[Ô[�GØ×%Ò% gÑ.Ô.Ð.øð	/ð 	/r)   r›   r1   r)   r'   rò   rò     sM   € € € € € ðð ð
 ÐØ€Gð/˜Cð / Dð /ð /ð /ð /ð /ð /r)   rò   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚLiteralBlockTransformzEReplace container nodes for literal_block by captioned_literal_block.rA   r5   r   r   Nc                 óÔ   — t          t          j        d¬¦  «        }| j                             |¦  «        D ]1}t          dg|j        ¢R i |j        ¤Ž}|                     |¦  «         Œ2d S )NT)Úliteral_blockrL   )	r   r
   Ú	containerr!   r"   r   r¨   Ú
attributesr{   )r$   r   r%   r&   Únewnodes        r'   r=   zLiteralBlockTransform.run+  sw   € Ý�eœo¸TÐBÑBÔBˆØ”M×)Ò)¨'Ñ2Ô2ð 	'ð 	'ˆDÝ-¨bÐT°4´=ÐTÐTÐTÀDÄOÐTÐTˆGØ×Ò˜gÑ&Ô&Ð&Ð&ð	'ð 	'r)   r›   r1   r)   r'   rý   rý   &  sG   € € € € € ØOÐOØÐØ€Gð'˜Cð ' Dð 'ð 'ð 'ð 'ð 'ð 'r)   rý   c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚDocumentTargetTransformz5Add :doc label to the first section of each document.rA   r5   r   r   Nc                 óÌ   — | j                              t          j        ¦  «        D ]>}|                     t
          j        ¦  «        }|r|d                              d¦  «         Œ?d S )Nrl   z:doc)r!   r"   r   rd   Ú	next_noder
   r¾   rn   )r$   r   r&   r¾   s       r'   r=   zDocumentTargetTransform.run7  sb   € Ø”M×)Ò)­(Ô*@ÑAÔAð 	.ð 	.ˆDØ—n’n¥U¤]Ñ3Ô3ˆGØð .Ø˜”×%Ò% fÑ-Ô-Ð-øð	.ð 	.r)   r›   r1   r)   r'   r  r  2  sG   € € € € € Ø?Ð?ØÐØ€Gð.˜Cð . Dð .ð .ð .ð .ð .ð .r)   r  c                   ó*   — e Zd ZdZdZdZdeddfd„ZdS )ÚIndexInSectionTitleTransforma�  Move index nodes in section title to outside of the title.

    LaTeX index macro is not compatible with some handling of section titles
    such as uppercasing done on LaTeX side (cf. fncychap handling of ``\chapter``).
    Moving the index node to after the title node fixes that.

    Before::

        <section>
            <title>
                blah blah <index entries=[...]/>blah
            <paragraph>
                blah blah blah
            ...

    After::

        <section>
            <title>
                blah blah blah
            <index entries=[...]/>
            <paragraph>
                blah blah blah
            ...
    rA   r5   r   r   Nc                 óv  — t          | j                             t          j        ¦  «        ¦  «        D ]†}t          |j        t          j        ¦  «        ret          |                     t          j
        ¦  «        ¦  «        D ]8\  }}|                     |¦  «         |j                             |dz   |¦  «         Œ9Œ‡d S )Nr4   )r9   r!   r"   r
   rÚ   rb   r;   r¾   r§   r   rV   r<   rY   )r$   r   r&   rª   rV   s        r'   r=   z IndexInSectionTitleTransform.run[  s¦   € Ý˜œ×.Ò.­u¬{Ñ;Ô;Ñ<Ô<ð 	5ð 	5ˆDÝ˜$œ+¥u¤}Ñ5Ô5ð 5Ý )¨$¯,ª,µx´~Ñ*FÔ*FÑ GÔ Gð 5ð 5‘H�A�uà—K’K Ñ&Ô&Ð&Ø”K×&Ò& q¨1¡u¨eÑ4Ô4Ð4Ð4øð	5ð 	5r)   r›   r1   r)   r'   r  r  >  sM   € € € € € ðð ð2 ÐØ€Gð5˜Cð 5 Dð 5ð 5ð 5ð 5ð 5ð 5r)   r  Úappr   c                 ó  — |                       t          ¦  «         |                      t          ¦  «         |                      t          ¦  «         |                      t
          ¦  «         |                      t          ¦  «         |                      t          ¦  «         |                      t          ¦  «         |                      t          ¦  «         |                      t          ¦  «         |                      t          ¦  «         ddddœS )NÚbuiltinT)ÚversionÚparallel_read_safeÚparallel_write_safe)Úadd_transformr   Úadd_post_transformr3   rÝ   rã   r  r  r–   rý   rò   r@   )r
  s    r'   Úsetupr  d  sî   € Ø×ÒÕ,Ñ-Ô-Ð-Ø×ÒÕ9Ñ:Ô:Ð:Ø×ÒÕ0Ñ1Ô1Ð1Ø×ÒÕ5Ñ6Ô6Ð6Ø×ÒÕ2Ñ3Ô3Ð3Ø×ÒÕ7Ñ8Ô8Ð8Ø×ÒÕ1Ñ2Ô2Ð2Ø×ÒÕ0Ñ1Ô1Ð1Ø×ÒÕ1Ñ2Ô2Ð2Ø×ÒÕ,Ñ-Ô-Ð-ð Ø"Ø#ðð ð r)   N)2r-   Útypingr   r   r   r   r   r   r	   Údocutilsr
   Údocutils.nodesr   r   Údocutils.transforms.referencesr   Úsphinxr   Úsphinx.applicationr   Úsphinx.builders.latex.nodesr   r   r   r   r   Úsphinx.domains.citationr   Úsphinx.transformsr   Ú!sphinx.transforms.post_transformsr   Úsphinx.util.nodesr   rT   r   r3   r@   ÚNodeVisitorrv   r–   r˜   rÝ   rã   rò   rý   r  r  ry   r  r1   r)   r'   ú<module>r     s¢  ðØ #Ð #à >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >à Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8à Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %ðJð Jð Jð Jð Jð Jð Jð Jð Jð Jð Jð Jð Jð Jà 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø -Ð -Ð -Ð -Ð -Ð -Ø AÐ AÐ AÐ AÐ AÐ AØ )Ð )Ð )Ð )Ð )Ð )à4€ð/ð /ð /ð /ð /˜_ñ /ô /ð /ð	%ð 	%ð 	%ð 	%ð 	%Ð%8ñ 	%ô 	%ð 	%ði0ð i0ð i0ð i0ð i0Ð+ñ i0ô i0ð i0ðX(ð (ð (ð (ð (˜Ô)ñ (ô (ð (ð4o)ð o)ð o)ð o)ð o)Ð0ñ o)ô o)ð o)ðdmUð mUð mUð mUð mU˜5Ô,ñ mUô mUð mUð`('ð ('ð ('ð ('ð ('Ð/ñ ('ô ('ð ('ðV0ð 0ð 0ð 0ð 0Ð!4ñ 0ô 0ð 0ð(/ð /ð /ð /ð /Ð0ñ /ô /ð /ð&	'ð 	'ð 	'ð 	'ð 	'Ð/ñ 	'ô 	'ð 	'ð	.ð 	.ð 	.ð 	.ð 	.Ð1ñ 	.ô 	.ð 	.ð#5ð #5ð #5ð #5ð #5Ð#6ñ #5ô #5ð #5ðLˆvð ˜$˜s C˜xœ.ð ð ð ð ð ð r)   