ó
    ‰*£haf  ã                   ó  • S SK JrJrJr  S SKrS SKrS SKrS SKrS SKr\R                  R                  S:”  a  \r\rS SKJr  S SKJr  O\rS SKJr  \R*                  " \5      rS rS r Sr Sr  " S	 S
5      rS r " S S\5      rg)é    )Úprint_functionÚabsolute_importÚunicode_literalsNé   )ÚMappingProxyType)Úgetfullargspec)Ú
getargspecc                  ó$   • SSK Jn   [        U 5      $ )a   
Return a dictionary that contains the default collection of known LaTeX
escape sequences for unicode characters.

The keys of the dictionary are integers that correspond to unicode code
points (i.e., `ord(char)`).  The values are the corresponding LaTeX
replacement strings.

The returned dictionary may not be modified.  To alter the behavior of
:py:func:`unicode_to_latex()`, you should specify custom rules to a new
instance of :py:class:`UnicodeToLatexEncoder`.

.. versionadded:: 2.0

   This function was introduced in `pylatexenc 2.0`.
é   )Ú	uni2latex)Ú_uni2latexmapr   Ú_MappingProxyType)Ú
_uni2latexs    Úm/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pylatexenc/latexencode/_unicode_to_latex_encoder.pyÚget_builtin_uni2latex_dictr   6   s   € õ" 7Ü˜ZÓ(Ð(ó    r   c                   ó,   • \ rS rSrSr  SS jrS rSrg)ÚUnicodeToLatexConversionRuleél   aÊ  
Specify a rule how to convert unicode characters into LaTeX escapes.

.. py:attribute:: rule_type

   One of :py:data:`RULE_DICT`, :py:data:`RULE_REGEX`, or
   :py:data:`RULE_CALLABLE`.

.. py:attribute:: rule

   A specification of the rule itself.  The `rule` attribute is an object
   that depends on what `rule_type` is set to.  See below.

.. py:attribute:: replacement_latex_protection

   If non-`None`, then the setting here will override any
   `replacement_latex_protection` set on
   :py:class:`UnicodeToLatexConversionRule` objects.  By default the value
   is `None`, and you can set a replacement_latex_protection globally for
   all rules on the :py:class:`UnicodeToLatexEncoder` object.

   The use of this attribute is mainly in case you have a fancy rule in
   which you already guarantee that whatever you output is valid LaTeX even
   if concatenated with the remainder of the string; in this case you can
   set `replacement_latex_protection='none'` to avoid unnecessary or
   unwanted braces around the generated code.

   .. versionadded:: 2.10

      The `replacement_latex_protection` attribute was introduced in
      `pylatexenc 2.10`.


Constructor syntax::

    UnicodeToLatexConversionRule(RULE_XXX, <...>)
    UnicodeToLatexConversionRule(rule_type=RULE_XXX, rule=<...>)

    UnicodeToLatexConversionRule(..., replacement_latex_protection='none')

Note that you can get some built-in rules via the
:py:func:`get_builtin_conversion_rules()` function::

    conversion_rules = get_builtin_conversion_rules('defaults') # all defaults


Rules types:

  - `RULE_DICT`: If `rule_type` is `RULE_DICT`, then `rule` should be a
    dictionary whose keys are integers representing unicode code points
    (e.g., `0x210F`), and whose values are corresponding replacement strings
    (e.g., ``r'\hbar'``).  See :py:func:`get_builtin_uni2latex_dict()` for
    an example.

  - `RULE_REGEX`: If `rule_type` is `RULE_REGEX`, then `rule` should be an
    iterable of tuple pairs `(compiled_regular_expression,
    replacement_string)` where `compiled_regular_expression` was obtained
    with `re.compile(...)` and `replacement_string` is anything that can be
    specified as the second (`repl`) argument of `re.sub(...)`.  This can be
    a replacement string that includes escapes (like ``\1, \2, \g<name>``)
    for captured sub-expressions or a callable that takes a match object as
    argument.

    .. note::

       The replacement string is parsed like the second argument to
       `re.sub()` and backslashes have a special meaning because they can
       refer to captured sub-expressions.  For a literal backslash, use two
       backslashes ``\\`` in raw strings, four backslashes in normal
       strings.

    Example::

      regex_conversion_rule = UnicodeToLatexConversionRule(
          rule_type=RULE_REGEX,
          rule=[
              # protect acronyms of capital letters with braces,
              # e.g.: ABC -> {ABC}
              (re.compile(r'[A-Z]{2,}'), r'{\1}'),
              # Additional rules, e.g., "..." -> "\ldots"
              (re.compile(r'...'), r'\\ldots'), # note double \\
          ]
      )

  - `RULE_CALLABLE`: If `rule_type` is `RULE_CALLABLE`, then `rule` should
    be a callable that accepts two arguments, the unicode string and the
    position in the string (an integer).  The callable will be called with
    the original unicode string as argument and the position of the
    character that needs to be encoded.  If this rule can encode the given
    character at the given position, it should return a tuple
    `(consumed_length, replacement_string)` where `consumed_length` is the
    number of characters in the unicode string that `replacement_string`
    represents.  If the character(s) at the given position can't be encoded
    by this rule, the callable should return `None` to indicate that further
    rules should be attempted.

    If the callable accepts an additional argument called `u2lobj`, then the
    :py:class:`UnicodeToLatexEncoder` instance is provided to that argument.

    For example, the following callable should achieve the same effect as
    the previous example with regexes::

      def convert_stuff(s, pos):
          m = re.match(r'[A-Z]{2,}', s, pos)
          if m is not None:
              return (m.end()-m.start(), '{'+m.group()+'}')
          if s.startswith('...', pos): # or  s[pos:pos+3] == '...'
              return (3, r'\ldots')
          return None


.. versionadded:: 2.0

   This class was introduced in `pylatexenc 2.0`.
Nc                 ó(   • Xl         X l        X0l        g ©N)Ú	rule_typeÚruleÚreplacement_latex_protection)Úselfr   r   r   s       r   Ú__init__Ú%UnicodeToLatexConversionRule.__init__à   s   € ð #ŒØŒ	Ø,HÕ)r   c                 óÆ   • SR                  U R                  R                  U R                  [	        U R
                  5      R                  [        U R                  5      5      $ )Nz>{}(rule_type={!r}, rule=<{}>, replacement_latex_protection={}))ÚformatÚ	__class__Ú__name__r   Útyper   Úreprr   )r   s    r   Ú__repr__Ú%UnicodeToLatexConversionRule.__repr__ç   sF   € ØO×VÑVØ�N‰N×#Ñ# T§^¡^´T¸$¿)¹)³_×5MÑ5MÜ�×2Ñ2Ó3ó
ð 	
r   )r   r   r   )NN)r!   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r$   Ú__static_attributes__© r   r   r   r   l   s   † ñrðf (,à.2ôIõ
r   r   c                 óº   • U S:X  a  [        [        [        5       S9/$ U S:X  a  SSKJn  [        [        UR
                  S9/$ [        SR                  U 5      5      e)aþ  
Return a built-in set of conversion rules specified by a given name
`builtin_name`.

There are two builtin conversion rules, with the following names:

  - `'defaults'`: the default conversion rules, a custom-curated list of
    unicode chars to LaTeX escapes.

  - `'unicode-xml'`: the conversion rules derived from the `unicode.xml` file
    maintained at https://www.w3.org/TR/xml-entity-names/#source by David
    Carlisle.

The return value is a list of :py:class:`UnicodeToLatexConversionRule`
objects that can be either directly specified to the `conversion_rules=`
argument of :py:class:`UnicodeToLatexEncoder`, or included in a larger list
that can be provided to that argument.

.. versionadded:: 2.0

   This function was introduced in `pylatexenc 2.0`.
Údefaults)r   r   zunicode-xmlr   )Ú_uni2latexmap_xmlzUnknown builtin rule set: {})r   Ú	RULE_DICTr   Ú r.   r   Ú
ValueErrorr   )Úbuiltin_namer.   s     r   Úget_builtin_conversion_rulesr3   ð   sk   € ð. �zÓ!Ü-¼	Ü3MÓ3OñQð Sð 	Sà�}Ó$Ý'Ü-¼	Ø3D×3NÑ3NñPð Rð 	Rä
Ð3×:Ñ:¸<ÓHÓ
IÐIr   c                   óž   ^ • \ rS rSrSrU 4S jrS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rSrU =r$ )ÚUnicodeToLatexEncoderi  uÇ  
Encode a string with unicode characters into a LaTeX snippet.

The following general attributes can be specified as keyword arguments to
the constructor.  Note: These attributes must be specified to the
constructor and may NOT be subsequently modified.  This is because in the
constructor we pre-compile some rules and flags to optimize calls to
:py:meth:`unicode_to_text()`.

.. py:attribute:: non_ascii_only

   Whether we should convert only non-ascii characters into LaTeX sequences,
   or also all known ascii characters with special LaTeX meaning such as
   '\\\\', '$', '&', etc.

   If `non_ascii_only` is set to `True` (the default is `False`), then
   conversion rules are not applied at positions in the string where an
   ASCII character is encountered.

.. py:attribute:: conversion_rules

   The conversion rules, specified as a list of
   :py:class:`UnicodeToLatexConversionRule` objects.  For each position in
   the string, the rules will be applied in the given sequence until a
   replacement string is found.

   Instead of a :py:class:`UnicodeToLatexConversionRule` object you may also
   specify a string specifying a built-in rule (e.g., 'defaults'), which
   will be expanded to the corresponding rules according to
   :py:func:`get_builtin_conversion_rules()`.

   If you specify your own list of rules using this argument, you will
   probably want to include presumably at the end of your list the element
   'defaults' to include all built-in default conversion rules.  To override
   built-in rules, simply add your custom rules earlier in the list.
   Example::

     conversion_rules = [
         # our custom rules
         UnicodeToLatexConversionRule(RULE_REGEX, [
             # double \\ needed, see UnicodeToLatexConversionRule
             ( re.compile(r'...'), r'\\ldots' ),
             ( re.compile(r'Ã®'), r'\\^i' ),
         ]),
         # plus all the default rules
         'defaults'
     ]
     u = UnicodeToLatexEncoder(conversion_rules=conversion_rules)

.. py:attribute:: replacement_latex_protection

   How to "protect" LaTeX replacement text that looks like it could be
   interpreted differently if concatenated to arbitrary strings before and
   after.

   Currently in the default scheme only one situation is recognized: if the
   replacement string ends with a latex macro invocation with a non-symbol
   macro name, e.g. ``\textemdash`` or ``\^\i``.  Indeed, if we naively
   replace these texts in an arbitrary string (like ``maÃ®tre``), we might
   get an invalid macro invocation (like ``ma\^\itre`` which causes un known
   macro name ``\itre``).

   Possible protection schemes are:

     - 'braces' (the default):  Any suspicious replacement text (that
       might look fragile) is placed in curly braces ``{...}``.

     - 'braces-all':  All replacement latex escapes are surrounded in
       protective curly braces ``{...}``, regardless of whether or not they
       might be deemed "fragile" or "unsafe".

     - 'braces-almost-all':  Almost all replacement latex escapes are
       surrounded in protective curly braces ``{...}``.  This option
       emulates closely the behavior of `brackets=True` of the function
       `utf8tolatex()` in `pylatexenc 1.x`, though I'm not sure it is really
       useful.  [Specifically, all those replacement strings that start with
       a backslash are surrounded by curly braces].

     - 'braces-after-macro':  In the situation where the replacement latex
       code ends with a string-named macro, then a pair of empty braces is
       added at the end of the replacement text to protect the macro.

     - 'none': No protection is applied, even in "unsafe" cases.  This is
       not recommended, as this will likely result in invalid LaTeX
       code. (Note this is the string 'none', not Python's built-in `None`.)

     - any callable object: The callable should take a single argument, the
       replacement latex string associated with a piece of the input (maybe
       a special character) that has been encoded; it should return the
       actual string to append to the output string.

     .. versionadded:: 2.10 

        You can specify a callable object to `replacement_latex_protection`
        since `pylatexenc 2.10`.

.. py:attribute:: unknown_char_policy

   What to do when a non-ascii character is encountered without any known
   substitution macro.  The attribute `unknown_char_policy` can be set to one of:

     - 'keep': keep the character as is;

     - 'replace': replace the character by a boldface question mark;

     - 'ignore': ignore the character from the input entirely and don't
       output anything for it;

     - 'fail': raise a `ValueError` exception;

     - 'unihex': output the unicode hexadecimal code (U+XXXX) of the
       character in typewriter font;

     - a Python callable --- will be called with argument the character that
       could not be encoded.  (If the callable accepts a second argument
       called 'u2lobj', then the `UnicodeToLatexEncoder` instance is
       provided to that argument.)  The return value of the callable is used
       as LaTeX replacement code.

.. py:attribute:: unknown_char_warning

   In addition to the `unknown_char_policy`, this attribute indicates
   whether or not (`True` or `False`) one should generate a warning when a
   nonascii character without any known latex representation is
   encountered. (Default: True)

.. py:attribute:: latex_string_class

   The return type of :py:meth:`unicode_to_latex()`.  Normally this is a
   simple unicode string (`str` on `Python 3` or `unicode` on `Python 2`).

   But you can specify your custom string type via the `latex_string_class`
   argument.  The `latex_string_class` will be invoked with no arguments to
   construct an empty object (so `latex_string_class` can be either an
   object that can be constructed with no arguments or it can be a function
   with no arguments that return a fresh object instance).  The object must
   support the operation "+=", i.e., you should overload the ``__iadd__()``
   method.

   For instance, you can record the chunks that would have been appended
   into a single string as follows::

       class LatexChunkList:
           def __init__(self):
               self.chunks = []

           def __iadd__(self, s):
               self.chunks.append(s)
               return self

       u = UnicodeToLatexEncoder(latex_string_class=LatexChunkList,
                                 replacement_latex_protection='none')
       result = u.unicode_to_latex("Ã© â†’ Î±")
       # result.chunks == [ r"\'e", ' ', r'\textrightarrow', ' ',
       #                    r'\ensuremath{\alpha}' ]

.. warning::
  
   None of the above attributes should be modified after constructing the
   object.  The values specified to the class constructor are final and
   cannot be changed.  [Indeed, the class constructor "compiles" these
   attribute values into a data structure that makes
   :py:meth:`unicode_to_text()` slightly more efficient.]

.. versionadded:: 2.0

   This class was introduced in `pylatexenc 2.0`.
c                 ó|  >• UR                  SS5      U l        UR                  SS/5      U l        UR                  SS5      U l        UR                  SS5      U l        UR                  S	S
5      U l        UR                  S[        5      U l        U(       a3  [        R                  SSR                  UR                  5       5      5        [        [        U ]:  " S0 UD6  [        R                   R#                  S U R                   5       5      n/ U l        U GHi  nUR&                  [(        :X  aG  U R$                  R+                  [,        R.                  " U R0                  UR2                  U5      5        M_  UR&                  [4        :X  aG  U R$                  R+                  [,        R.                  " U R6                  UR2                  U5      5        Mº  UR&                  [8        :X  az  UR2                  nS[;        U5      S   ;   a  [,        R.                  " UR2                  U S9nU R$                  R+                  [,        R.                  " U R<                  XC5      5        GMH  [?        SRA                  UR&                  5      5      e   [C        U R                  [D        5      (       a!  U RG                  SU R                  SS9U l$        O“[K        U R                  5      (       aU  U R                  nS[;        U5      S   ;   a%  [,        R.                  " U R                  U S9U l$        O6U R                  U l$        O$[?        SRA                  U R                  5      5      eU R
                  (       d  S U l&        U R                  (       a  U RN                  U l(        OS U l(        U RS                  U R                  5      U l*        g )NÚnon_ascii_onlyFÚconversion_rulesr-   r   ÚbracesÚunknown_char_policyÚkeepÚunknown_char_warningTÚlatex_string_classz&Ignoring unknown keyword arguments: %sÚ,c              3   óh   #   • U  H(  n[        U[        5      (       a  [        U5      OU/v •  M*     g 7fr   )Ú
isinstanceÚ
basestringr3   )Ú.0Úrs     r   Ú	<genexpr>Ú1UnicodeToLatexEncoder.__init__.<locals>.<genexpr>Ê  s2   é € ð B
â*�ô 1;¸1¼j×0IÑ0IÔ)¨!Ô,ÐQRÈuÔTÚ*ùs   ‚02Úu2lobjr   )rF   zInvalid rule type: {}Údo_unknown_char©Úwhatz.Invalid argument for unknown_char_policy: {!r}c                 ó   • g r   r+   )Úchs    r   Ú<lambda>Ú0UnicodeToLatexEncoder.__init__.<locals>.<lambda>ü  s   € °Dr   c                 ó   • g)NFr+   )ÚsÚps     r   rL   rM     s   € °%r   r+   )+Úpopr7   r8   r   r:   r<   Úunicoder=   ÚloggerÚwarningÚjoinÚkeysÚsuperr5   r   Ú	itertoolsÚchainÚfrom_iterableÚ_compiled_rulesr   r/   ÚappendÚ	functoolsÚpartialÚ_apply_rule_dictr   Ú
RULE_REGEXÚ_apply_rule_regexÚRULE_CALLABLEr   Ú_apply_rule_callableÚ	TypeErrorr   r@   rA   Ú_get_method_fnÚ_do_unknown_charÚcallableÚ_do_warn_unknown_charÚ_check_do_skip_asciiÚ_maybe_skip_asciiÚ_get_replacement_latex_fnÚ_apply_protection)r   ÚkwargsÚexpanded_conversion_rulesr   ÚthecallableÚfnr    s         €r   r   ÚUnicodeToLatexEncoder.__init__¼  sú  ø€ Ø$Ÿj™jÐ)9¸5ÓAˆÔØ &§
¡
Ð+=À
¸|Ó LˆÔØ,2¯J©JÐ7UÐW_Ó,`ˆÔ)Ø#)§:¡:Ð.CÀVÓ#LˆÔ Ø$*§J¡JÐ/EÀtÓ$LˆÔ!Ø"(§*¡*Ð-AÄ7Ó"KˆÔæÜ�N‰NÐCÀSÇXÁXÈfÏkÉkËmÓE\Ô]äÔ# TÒ3Ñ=°fÒ=ô %.§O¡O×$AÑ$Añ B
à×*Ò*óB
ó %
Ð!ð  "ˆÔÜ-ˆDØ�~‰~¤Ó*Ø×$Ñ$×+Ñ+Ü×%Ò% d×&;Ñ&;¸T¿Y¹YÈÓMöð —‘¤:Ó-Ø×$Ñ$×+Ñ+Ü×%Ò% d×&<Ñ&<¸d¿i¹iÈÓNöð —‘¤=Ó0Ø"Ÿi™i�Øœ~¨kÓ:¸1Ñ=Ó=Ü"+×"3Ò"3°D·I±IÀdÑ"K�KØ×$Ñ$×+Ñ+Ü×%Ò% d×&?Ñ&?ÀÓS÷ô  Ð 7× >Ñ >¸t¿~¹~Ó NÓOÐOñ# .ô( �d×.Ñ.´
×;Ñ;Ø$(×$7Ñ$7Ø!Ø×(Ñ(Ø*ð %8ð %ˆDÕ!ô
 �d×.Ñ.×/Ñ/Ø×)Ñ)ˆBØœ>¨"Ó-¨aÑ0Ó0Ü(1×(9Ò(9¸$×:RÑ:RÐ[_Ñ(`�Õ%à(,×(@Ñ(@�Õ%äÐLß#™V D×$<Ñ$<Ó=ó?ð ?ð ×(×(Ù)8ˆDÔ&ð ××Ø%)×%>Ñ%>ˆDÕ"á%7ˆDÔ"ð "&×!?Ñ!?Ø×-Ñ-ó"
ˆÕr   c                 ó¢   • SU-   S-   UR                  SS5      -   n[        X5      (       d  [        SR                  X25      5      e[	        X5      $ )NÚ_Ú-zInvalid {}: {})ÚreplaceÚhasattrr1   r   Úgetattr)r   ÚbaseÚnamerI   Úselfmethnames        r   re   Ú$UnicodeToLatexEncoder._get_method_fn	  sM   € Ø˜T‘z CÑ'¨$¯,©,°s¸CÓ*@Ñ@ˆÜ�t×*Ñ*ÜÐ-×4Ñ4°TÓ@ÓAÐAÜ�tÓ*Ð*r   c                 óH   • [        U5      (       a  U$ U R                  SUSS9$ )NÚapply_protectionr   rH   )rg   re   )r   r   s     r   rk   Ú/UnicodeToLatexEncoder._get_replacement_latex_fn  s5   € ÜÐ0×1Ñ1Ø/Ð/Ø×"Ñ"ØØ(Ø/ð #ð 
ð 	
r   c                 óÔ  • [        U5      n[        R                  " SU5      n " S S5      nU" 5       nU R                  5       Ul        SUl        UR
                  [        U5      :  aõ  U R                  X5      (       a  M1  U R                   H  nU" X5      (       d  M    O¢   XR
                     n[        U5      nUS:¼  a  US::  d  US;   a+  U=R                  U-  sl        U=R
                  S-  sl        OJU R                  U5        U=R                  U R                  U5      -  sl        U=R
                  S-  sl        UR
                  [        U5      :  a  Mõ  UR                  $ )	zˆ
Convert unicode characters in the string `s` into latex escape sequences,
according to the rules and options given to the constructor.
ÚNFCc                   ó   • \ rS rSrSrg)Ú3UnicodeToLatexEncoder.unicode_to_latex.<locals>._NSi!  r+   N)r!   r&   r'   r(   r*   r+   r   r   Ú_NSr‚   !  s   † ’4r   rƒ   r   é    é   z
	r   )rR   ÚunicodedataÚ	normalizer=   ÚlatexÚposÚlenrj   r[   Úordrh   rf   )r   rO   rƒ   rP   ÚcompiledrulerK   Úos          r   Úunicode_to_latexÚ&UnicodeToLatexEncoder.unicode_to_latex  s  € ô �A‹JˆÜ×!Ò! %¨Ó+ˆç‰Ù‹EˆØ×)Ñ)Ó+ˆŒØˆŒà�e‰e”c˜!“f‹nà×%Ñ% a×+Ñ+Ùà $× 4Ô 4�Ù ×%Ó%Ùñ !5ð —u‘u‘X�Ü˜“G�Ø˜“G  S£¨b°H«nØ—G’G˜r‘M•GØ—E’E˜Q‘J–Eà×.Ñ.¨rÔ2Ø—G’G˜t×4Ñ4°RÓ8Ñ8•GØ—E’E˜Q‘J•Eð) �e‰e”c˜!“f�nð, �w‰wˆr   c                 ó¨   • [        XR                     5      S:  a7  U=R                  XR                     -  sl        U=R                  S-  sl        gg)Nr…   r   TF)r‹   r‰   rˆ   )r   rO   rP   s      r   ri   Ú*UnicodeToLatexEncoder._check_do_skip_ascii?  s;   € Üˆq—‘‰x‹=˜3Óà�GŠG�qŸ™‘xÑ�GØ�EŠE�Q‰J�EØØr   c                 ój   • [        X4R                     5      nXQ;   a  U R                  XAU   SU5        gg )Nr   T)r‹   r‰   Ú_apply_replacement)r   Úruledictr   rO   rP   r�   s         r   r_   Ú&UnicodeToLatexEncoder._apply_rule_dictH  s2   € Ü�—%‘%‘‹MˆØ‹=Ø×#Ñ# A°¡{°A°tÔ<ØØr   c                 ó  • U H�  u  pVUR                  X4R                  5      nUc  M%  [        U5      (       a	  U" U5      nOUR                  U5      nU R	                  XHUR                  5       UR                  5       -
  U5          g   g ©NT)Úmatchr‰   rg   Úexpandr“   ÚendÚstart)	r   Úruleregexesr   rO   rP   ÚregexÚreplÚmÚreplstrs	            r   ra   Ú'UnicodeToLatexEncoder._apply_rule_regexN  so   € Û&‰KˆEØ—‘˜AŸu™uÓ%ˆAØ‹}Ü˜D—>‘>Ù" 1›g‘GàŸh™h t›n�GØ×'Ñ'¨°A·E±E³G¸a¿g¹g»iÑ4GÈÔNÙñ 'ð r   c                 ó\   • U" X4R                   5      nUc  g Uu  pgU R                  XGXb5        gr—   )r‰   r“   )r   Úrulecallabler   rO   rP   ÚresÚconsumedrž   s           r   rc   Ú*UnicodeToLatexEncoder._apply_rule_callableY  s3   € Ù˜1Ÿe™eÓ$ˆØ‰;ØØÑˆØ×Ñ ¨Ô8Ør   c                 óÐ   • U R                   nUR                  b  U R                  UR                  5      nU" U5      nU=R                  U-  sl        U=R                  U-  sl        g r   )rl   r   rk   rˆ   r‰   )r   rP   rž   ÚnumcharsÚruleobjÚ
protect_fns         r   r“   Ú(UnicodeToLatexEncoder._apply_replacementa  s]   € ð ×+Ñ+ˆ
ð ×/Ñ/Ñ;Ø×7Ñ7Ø×4Ñ4óˆJñ ˜$ÓˆØ	�Š�4‰�Ø	�Š�ÑŽr   c                 ó   • U$ r   r+   ©r   rž   s     r   Ú_apply_protection_noneÚ,UnicodeToLatexEncoder._apply_protection_nonep  s   € àˆr   c                 óx   • UR                  S5      nUS:¼  a"  XS-   S  R                  5       (       a  SU-   S-   $ U$ )NÚ\r   r   Ú{Ú}©ÚrfindÚisalpha©r   rž   Úks      r   Ú_apply_protection_bracesÚ.UnicodeToLatexEncoder._apply_protection_bracess  sA   € Ø�J‰J�tÓˆØ�‹6�d˜Q™3˜4�j×(Ñ(×*Ñ*à˜‘: Ñ#Ð#Øˆr   c                 ó(   • USS S:X  a  SU-   S-   $ U$ )Nr   r   r±   r²   r³   r+   r­   s     r   Ú#_apply_protection_braces_almost_allÚ9UnicodeToLatexEncoder._apply_protection_braces_almost_ally  s$   € Ø��!ˆ9˜ÓØ˜‘: Ñ#Ð#Øˆr   c                 ó   • SU-   S-   $ )Nr²   r³   r+   r­   s     r   Ú_apply_protection_braces_allÚ2UnicodeToLatexEncoder._apply_protection_braces_all}  s   € Ø�T‰z˜CÑÐr   c                 ór   • UR                  S5      nUS:¼  a  XS-   S  R                  5       (       a  US-   $ U$ )Nr±   r   r   z{}r´   r·   s      r   Ú$_apply_protection_braces_after_macroÚ:UnicodeToLatexEncoder._apply_protection_braces_after_macro  s<   € Ø�J‰J�tÓˆØ�‹6�d˜Q™3˜4�j×(Ñ(×*Ñ*à˜$‘;ÐØˆr   c                 ó   • U$ r   r+   ©r   rK   s     r   Ú_do_unknown_char_keepÚ+UnicodeToLatexEncoder._do_unknown_char_keep‡  s   € Øˆ	r   c                 ó   • g)Nz{\bfseries ?}r+   rÅ   s     r   Ú_do_unknown_char_replaceÚ.UnicodeToLatexEncoder._do_unknown_char_replaceŠ  s   € Ør   c                 ó   • g)Nr0   r+   rÅ   s     r   Ú_do_unknown_char_ignoreÚ-UnicodeToLatexEncoder._do_unknown_char_ignore�  s   € Ør   c                 ó4   • [        S[        U5      U4-  5      e©Nu>   No known latex representation for character: U+%04X - â€˜%sâ€™)r1   r‹   rÅ   s     r   Ú_do_unknown_char_failÚ+UnicodeToLatexEncoder._do_unknown_char_fail�  s"   € ÜÐYÜ˜r›7 B˜-ñ(ó )ð 	)r   c                 ó   • S[        U5      -  $ )Nz7\ensuremath{\langle}\texttt{U+%04X}\ensuremath{\rangle})r‹   rÅ   s     r   Ú_do_unknown_char_unihexÚ-UnicodeToLatexEncoder._do_unknown_char_unihex”  s   € ØIÌ3ÈrË7ÑSÐSr   c                 óD   • [         R                  S[        U5      U5        g rÏ   )rS   rT   r‹   rÅ   s     r   rh   Ú+UnicodeToLatexEncoder._do_warn_unknown_char—  s   € Ü�‰ÐWÜ˜2“w õ	$r   )rl   r[   rf   rh   rj   r8   r=   r7   r   r:   r<   )r!   r&   r'   r(   r)   r   re   rk   rŽ   ri   r_   ra   rc   r“   r®   r¹   r¼   r¿   rÂ   rÆ   rÉ   rÌ   rÐ   rÓ   rh   r*   Ú__classcell__)r    s   @r   r5   r5     sw   ø† ñgõPK
òZ+ò
ò$òNòò
òòòòòò òòò òò)òT÷$ð $r   r5   ) Ú
__future__r   r   r   r†   ÚloggingÚsysr]   rX   Úversion_infoÚmajorÚstrrR   rA   Útypesr   r   Úinspectr   Údictr	   Ú	getLoggerr!   rS   r   r/   r`   rb   r   r3   Úobjectr5   r+   r   r   Ú<module>rã      s¥   ð÷4 IÑ Hã Û Û 
Û Û à×Ñ×Ñ˜AÓØ€GØ€Jå;æ&àÐå4à	×	Ò	˜8Ó	$€ò)ð, €	ðð €
ðð €ð÷
ñ 
òHJôFF$˜Fõ F$r   