
    5h:K                         S r SSKJr  SSKJr  SSKJrJr  SSKJ	r	J
r
  SSKJrJr  S/rS rS	rS
rS r " S S\5      r " S S\5      rg)z
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~

Formatter for LaTeX fancyvrb output.

:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
    )StringIO)	Formatter)Lexerdo_insertions)TokenSTANDARD_TYPES)get_bool_optget_int_optLatexFormatterc                    U R                  SS5      R                  SS5      R                  SS5      R                  SSU S35      R                  SSU S35      R                  SSU S	35      R                  S
SU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  SSU S35      R                  S SU S!35      $ )"N\ {}zZbs{}zZob{}zZcb{}^zZca{}_zZus{}&zZam{}<zZlt{}>zZgt{}#zZsh{}%zZpc{}$zZdl{}-zZhy{}'zZsq{}"zZdq{}~zZti{})replace)textcommandprefixs     d/var/www/html/cementerio_25MayoBackend/env/lib/python3.13/site-packages/pygments/formatters/latex.py
escape_texr#      sh   <<f%V$V$1]O7 ;<1]O7 ;<1]O7 ;<-89-89-89-89-89-89-89-89-89-89-89-89#:    z
\documentclass{%(docclass)s}
\usepackage{fancyvrb}
\usepackage{color}
\usepackage[%(encoding)s]{inputenc}
%(preamble)s

%(styledefs)s

\begin{document}

\section*{%(title)s}

%(code)s
\end{document}
a  
\makeatletter
\def\%(cp)s@reset{\let\%(cp)s@it=\relax \let\%(cp)s@bf=\relax%%
    \let\%(cp)s@ul=\relax \let\%(cp)s@tc=\relax%%
    \let\%(cp)s@bc=\relax \let\%(cp)s@ff=\relax}
\def\%(cp)s@tok#1{\csname %(cp)s@tok@#1\endcsname}
\def\%(cp)s@toks#1+{\ifx\relax#1\empty\else%%
    \%(cp)s@tok{#1}\expandafter\%(cp)s@toks\fi}
\def\%(cp)s@do#1{\%(cp)s@bc{\%(cp)s@tc{\%(cp)s@ul{%%
    \%(cp)s@it{\%(cp)s@bf{\%(cp)s@ff{#1}}}}}}}
\def\%(cp)s#1#2{\%(cp)s@reset\%(cp)s@toks#1+\relax+\%(cp)s@do{#2}}

%(styles)s

\def\%(cp)sZbs{\char`\\}
\def\%(cp)sZus{\char`\_}
\def\%(cp)sZob{\char`\{}
\def\%(cp)sZcb{\char`\}}
\def\%(cp)sZca{\char`\^}
\def\%(cp)sZam{\char`\&}
\def\%(cp)sZlt{\char`\<}
\def\%(cp)sZgt{\char`\>}
\def\%(cp)sZsh{\char`\#}
\def\%(cp)sZpc{\char`\%%}
\def\%(cp)sZdl{\char`\$}
\def\%(cp)sZhy{\char`\-}
\def\%(cp)sZsq{\char`\'}
\def\%(cp)sZdq{\char`\"}
\def\%(cp)sZti{\char`\~}
%% for compatibility with earlier versions
\def\%(cp)sZat{@}
\def\%(cp)sZlb{[}
\def\%(cp)sZrb{]}
\makeatother
c                     [         R                  " U 5      nU(       a  U$ SnUc/  U S   U-   nU R                  n [         R                  " U 5      nUc  M/  X-   $ )N )r   getparent)ttypefnameanames      r"   _get_ttype_namer-      s\    u%EE
-b	E!""5) - =r$   c                   F    \ rS rSrSrSrSS/rS/rS rS r	SS	 jr
S
 rSrg)r      aT  
Format tokens as LaTeX code. This needs the `fancyvrb` and `color`
standard packages.

Without the `full` option, code is formatted as one ``Verbatim``
environment, like this:

.. sourcecode:: latex

    \begin{Verbatim}[commandchars=\\\{\}]
    \PY{k}{def }\PY{n+nf}{foo}(\PY{n}{bar}):
        \PY{k}{pass}
    \end{Verbatim}

Wrapping can be disabled using the `nowrap` option.

The special command used here (``\PY``) and all the other macros it needs
are output by the `get_style_defs` method.

With the `full` option, a complete LaTeX document is output, including
the command definitions in the preamble.

The `get_style_defs()` method of a `LatexFormatter` returns a string
containing ``\def`` commands defining the macros needed inside the
``Verbatim`` environments.

Additional options accepted:

`nowrap`
    If set to ``True``, don't wrap the tokens at all, not even inside a
    ``\begin{Verbatim}`` environment. This disables most other options
    (default: ``False``).

`style`
    The style to use, can be a string or a Style subclass (default:
    ``'default'``).

`full`
    Tells the formatter to output a "full" document, i.e. a complete
    self-contained document (default: ``False``).

`title`
    If `full` is true, the title that should be used to caption the
    document (default: ``''``).

`docclass`
    If the `full` option is enabled, this is the document class to use
    (default: ``'article'``).

`preamble`
    If the `full` option is enabled, this can be further preamble commands,
    e.g. ``\usepackage`` (default: ``''``).

`linenos`
    If set to ``True``, output line numbers (default: ``False``).

`linenostart`
    The line number for the first line (default: ``1``).

`linenostep`
    If set to a number n > 1, only every nth line number is printed.

`verboptions`
    Additional options given to the Verbatim environment (see the *fancyvrb*
    docs for possible values) (default: ``''``).

`commandprefix`
    The LaTeX commands used to produce colored output are constructed
    using this prefix and some letters (default: ``'PY'``).

    .. versionadded:: 0.7
    .. versionchanged:: 0.10
       The default is now ``'PY'`` instead of ``'C'``.

`texcomments`
    If set to ``True``, enables LaTeX comment lines.  That is, LaTex markup
    in comment tokens is not escaped so that LaTeX can render it (default:
    ``False``).

    .. versionadded:: 1.2

`mathescape`
    If set to ``True``, enables LaTeX math mode escape in comments. That
    is, ``'$...$'`` inside a comment will trigger math mode (default:
    ``False``).

    .. versionadded:: 1.2

`escapeinside`
    If set to a string of length 2, enables escaping to LaTeX. Text
    delimited by these 2 characters is read as LaTeX code and
    typeset accordingly. It has no effect in string literals. It has
    no effect in comments if `texcomments` or `mathescape` is
    set. (default: ``''``).

    .. versionadded:: 2.0

`envname`
    Allows you to pick an alternative environment name replacing Verbatim.
    The alternate environment still has to support Verbatim's option syntax.
    (default: ``'Verbatim'``).

    .. versionadded:: 2.0
LaTeXlatextexz*.texc                    [         R                  " U 40 UD6  [        USS5      U l        UR	                  SS5      U l        UR	                  SS5      U l        [        USS5      U l        [        [        USS	5      5      U l
        [        [        US
S	5      5      U l        UR	                  SS5      U l        [        USS5      U l        UR	                  SS5      U l        [        USS5      U l        [        USS5      U l        UR	                  SS5      U l        [%        U R"                  5      S:X  a)  U R"                  S   U l        U R"                  S	   U l        OSU l        UR	                  SS5      U l        U R-                  5         g )NnowrapFdocclassarticlepreambler&   linenoslinenostart   
linenostepverboptionsnobackgroundr!   PYtexcomments
mathescapeescapeinside   r   envnameVerbatim)r   __init__r	   r4   r(   r5   r7   r8   absr
   r9   r;   r<   r=   r!   r?   r@   rA   lenleftrightrC   _create_stylesheet)selfoptionss     r"   rE   LatexFormatter.__init__   sL   4+7+"7He<J	:J3#GY>{7M1EFk'<CD";;}b9(.%H$[[$?'F&weD#KK;t  !Q&))!,DI**1-DJ "D{{9j9!r$   c           	         [         S0=ol        0 =o l        U R                  nS nU R                   GH  u  pV[        U5      nSnUS   (       a  US-  nUS   (       a  US-  nUS   (       a  US-  nUS	   (       a  US
-  nUS   (       a  US-  nUS   (       a  US-  nUS   (       a  USR                  U" US   5      5      -  nUS   (       a(  USR                  U" US   5      U" US   5      5      -  nO'US   (       a  USR                  U" US   5      5      -  nUS:X  a  M  UR                  SU5      nXqU'   XU'   GM     g )Nr&   c                     U (       a;  SR                  S Vs/ sH  nS[        X   XS-      -   S5      S-  -  PM!     sn5      $ gs  snf )N,)r   rB      z%.2fr:      g     o@z1,1,1)joinint)colis     r"   rgbcolor3LatexFormatter._create_stylesheet.<locals>.rgbcolor  sY    xx*3!5*3Q "(3svE
/BB+G%+O!P*3!5 6 6 !5s   %Aboldz\let\$$@bf=\textbfitalicz\let\$$@it=\textit	underlinez\let\$$@ul=\underlineromanz\let\$$@ff=\textrmsansz\let\$$@ff=\textsfmonocolorz-\def\$$@tc##1{{\textcolor[rgb]{{{}}}{{##1}}}}borderzj\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{\string -\fboxrule}}\fcolorbox[rgb]{{{}}}{{{}}}{{\strut ##1}}}}}}bgcolorzT\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{0pt}}\colorbox[rgb]{{{}}}{{\strut ##1}}}}}}z$$)r   
ttype2namecmd2defr!   styler-   formatr   )	rK   t2nc2dcprW   r*   ndefnamecmndefs	            r"   rJ   !LatexFormatter._create_stylesheet  sw   !&+ol	  ::KE"5)DFF|//H~//K 22G}//F|//F|//G}KRRS[\`ah\iSjklH~ LLRFS[\`ai\jSk$T)_5M78 i EEKVHUYZcUdLeEfh|^^D"-FJI9 &r$   c           
          U R                   n/ nU R                  R                  5        H   u  pEUR                  SU SU SU S35        M"     [        U R                   SR                  U5      S.-  $ )z
Return the command sequences needed to define the commands
used to format text in the verbatim environment. ``arg`` is ignored.
z
\@namedef{z@tok@}{r   
)rh   styles)r!   rc   itemsappendSTYLE_TEMPLATErS   )rK   argrh   rp   rj   
definitions         r"   get_style_defsLatexFormatter.get_style_defsA  su    
  $ 2 2 4DMM[E$tJ<rJK !5t'9'9+/99V+<!> > 	>r$   c                 
   U R                   nU R                  nU R                  (       a  Un[        5       nU R                  (       Gd  UR                  SU R                  -   S-   5        U R                  (       aX  U R                  U R                  pvUR                  SU=(       a    SU-  =(       d    S-   U=(       a    SU-  =(       d    S-   5        U R                  (       d"  U R                  (       d  U R                  (       a  UR                  S5        U R                  (       a  UR                  SU R                  -   5        UR                  S	5        U GH  u  pU[        R                  ;   Ga~  U R                  (       aT  U	S
S n[!        S[#        U	5      5       H  n
US
   X   :w  a    OXiU
   -  nM     U	[#        U5      S  n	[%        Xd5      nXi-   n	GO8U R                  (       aT  U	R'                  S5      nSn[)        U5       H   u  pU(       d  [%        X5      X'   U(       + nM"     SR+                  U5      n	OU R                  (       a  U	nSn	U(       a  UR-                  U R.                  5      u  nnnU(       aN  UR-                  U R0                  5      u  nnnU(       a  U	[%        X5      U-   -  n	O$U	[%        UU-   U-   U5      -  n	OU	[%        X5      -  n	U(       a  M  O+[%        X5      n	OU[        R2                  ;  a  [%        X5      n	/ nU[        La+   UR5                  X8   5        UR:                  nU[        La  M+  SR+                  [=        U5      5      nU(       a~  U	R'                  S5      nUS S  H6  nU(       a  UR                  SU SU SU S35        UR                  S5        M8     US   (       a!  UR                  SU SU SUS    S35        GM  GM  UR                  U	5        GM     U R                  (       d!  UR                  SU R                  -   S-   5        U R                  (       a  U R>                  =(       d    SnSSSS.RA                  URC                  SS5      U5      nWR                  [D        [G        U RH                  U RJ                  U RL                  UU RO                  5       URQ                  5       S9-  5        g g ! [6         a    UR5                  [9        U5      5         GNf = f)Nz\begin{z}[commandchars=\\\{\}z,numbers=leftz,firstnumber=%dr&   z,stepnumber=%dz6,codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}rP   z]
r   r:   r   F+ro   r'   r   r   rn   r   z\end{z}
utf8latin1)utf_8latin_1
iso_8859_1r   r   )r5   r7   titleencoding	styledefscode))rb   r!   fullr   r4   writerC   r8   r9   r;   r@   r?   rA   r<   r   CommentrangerG   r#   split	enumeraterS   	partitionrH   rI   Escaperr   KeyErrorr-   r)   reversedr   r(   r   DOC_TEMPLATEdictr5   r7   r   rv   getvalue)rK   tokensourceoutfilerf   rh   realoutfilestartstepr*   valuerV   partsin_mathpartr    asep1bsep2rp   stylevalsplliner   s                           r"   format_unencodedLatexFormatter.format_unencodedM  s<   oo99!KjG{{{MM*t||36QQR||"..to$B):U)BHbJ#?(84(?E2G H $"2"2d6G6G 8 9cD$4$445MM% 'LE%##!!AJE"1c%j1 8ux/!q) 2
 "#e*+.E&u1E "ME__!KK,E#G#,U#3&'1$';EH&-+ $4  HHUOE&& DE(,tyy(A4,0NN4::,FMAtT# %A):Q)> > %AHqL")E E!Z%66E $ 'u1Eell*"5-Fu$:MM#*-  u$ xx 01Hkk$'HD2$b
$tfB&GHMM$' % r7MMBrd"XJd3r7)2"FG  e$w (z {{MM(T\\1E9:99}}.H  #& c(""3,h7	 
 l!%!%!)!%!4!4!6!(!1!1!355 6 '   :MM/%"89:s   S$T T)rc   r!   r5   rC   rA   rH   r8   r9   r;   r@   r=   r4   r7   rI   r?   rb   r<   N)r&   )__name__
__module____qualname____firstlineno____doc__rj   aliases	filenamesrE   rJ   rv   r   __static_attributes__ r$   r"   r   r      s7    gP DG	I".(T
>e6r$   c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
LatexEmbeddedLexeri  a  
This lexer takes one lexer as argument, the lexer for the language
being formatted, and the left and right delimiters for escaped text.

First everything is scanned using the language lexer to obtain
strings and comments. All other consecutive tokens are merged and
the resulting text is scanned for escaped segments, which are given
the Token.Escape type. Finally text that is not escaped is scanned
again with the language lexer.
c                 V    Xl         X l        X0l        [        R                  " U 40 UD6  g N)rH   rI   langr   rE   )rK   rH   rI   r   rL   s        r"   rE   LatexEmbeddedLexer.__init__  s"    	
	t'w'r$   c                 V   Sn/ n/ nU R                  U5       HG  u  pVnUc+  U(       a  UR                  [        U5      U45        / nX'-  nM4  UR                  XVU45        MI     U(       a  UR                  [        U5      U45        [        UU R                  R                  U5      5      $ )Nr&   )_find_safe_escape_tokensrr   rG   r   r   get_tokens_unprocessed)rK   r    buffered
insertionsinsertion_bufrV   tvs           r"   r   )LatexEmbeddedLexer.get_tokens_unprocessed  s     
44T:GA!y %%s8}m&DE$&M$$aAY/ ; s8}m<=Z!YY==hGI 	Ir$   c              #      #    U R                  U R                  R                  U5      S 5       H5  u  p#nUc%  U R                  U5       H  u  pVnX%-   Xg4v   M     M.  USU4v   M7     g7f)z7find escape tokens that are not in strings or comments c                 \    U [         R                  ;   =(       d    U [         R                  ;   $ r   )r   r   String)r   s    r"   <lambda>=LatexEmbeddedLexer._find_safe_escape_tokens.<locals>.<lambda>  s    a5==(=A,==r$   N)
_filter_tor   r   _find_escape_tokens)rK   r    rV   r   r   i2t2v2s           r"   r   +LatexEmbeddedLexer._find_safe_escape_tokens  sk     II,,T2=
GA! y"&":":1"=JBB&".( #> qj 
s   A'A)c              #      #    SnSnU H8  u  pVnU" U5      (       a  U(       a	  USU4v   SnXVU4v   M+  U(       d  UnX7-  nM:     U(       a  USU4v   gg7f)zBKeep only the tokens that match `pred`, merge the others together r&   r   Nr   )rK   itpredbufidxrV   r   r   s           r"   r   LatexEmbeddedLexer._filter_to  sh     GA!AwwtS.(CAgC  tS.  s   AAc              #     #    SnU(       a  UR                  U R                  5      u  p4nU(       a  USU4v   U[        U5      -  nU(       a  UR                  U R                  5      u  pVnU(       aH  U[        U5      -   [        R
                  U4v   U[        U5      [        U5      -   [        U5      -   -  nO%U[        R                  U4v   U[        U5      -  nUnU(       a  M  gg7f)z:Find escape tokens within text, give token=None otherwise r   N)r   rH   rG   rI   r   r   Error)rK   r    indexr   r   r   r   s          r"   r   &LatexEmbeddedLexer._find_escape_tokens  s      NN4995MATT1n$Q $tzz :#d)+U\\1<<SYQ/#d);;Ed22SY&ED ds   C$C*(C*)r   rH   rI   N)r   r   r   r   r   rE   r   r   r   r   r   r   r$   r"   r   r     s!    	(I&
!!"r$   r   N)r   ior   pygments.formatterr   pygments.lexerr   r   pygments.tokenr   r   pygments.utilr	   r
   __all__r#   r   rs   r-   r   r   r   r$   r"   <module>r      s\     ( / 0 3 
:*n"J	_6Y _6D	Q Qr$   