Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/matplotlib/__pycache__/mathtext.cpython-37.pyc

1137 lines
93 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]<17><00>@s~dZddlmZddlZddlmZddlZddlZddlZddl Z ddl
Z ddl m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZe<18><1E>ddlm Z m!Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(dd l)m*Z*m+Z+m,Z,dd
l-m.Z.m/Z/m0Z0dd l1m2Z2m3Z3m4Z4m5Z5m6Z6e<06>7e8<65>Z9d<39>d d<0E>Z:e <20>;d<0F>e<<3C>Z=Gdd<11>de><3E>Z?Gdd<13>de?<3F>Z@Gdd<15>de@<40>ZAGdd<17>de?<3F>ZBGdd<19>de?<3F>ZCGdd<1B>de?<3F>ZDGdd<1D>de?<3F>ZEGdd<1F>de?<3F>ZFGd d!<21>d!e><3E>ZGGd"d#<23>d#eG<65>ZHGd$d%<25>d%eH<65>ZIGd&d'<27>d'eH<65>ZJGd(d)<29>d)eJ<65>ZKGd*d+<2B>d+eK<65>ZLGd,d-<2D>d-eK<65>ZMGd.d/<2F>d/eJ<65>ZNGd0d1<64>d1eN<65>ZOGd2d3<64>d3eG<65>ZPd4ZQd5eQZRd6ZSGd7d8<64>d8e><3E>ZTGd9d:<3A>d:eT<65>ZUGd;d<<3C>d<eT<65>ZVGd=d><3E>d>eT<65>ZWGd?d@<40>d@eT<65>ZXGdAdB<64>dBeT<65>ZYeYeYeXeUeUeUeUeUeUeUeVeVeVeVeVeVeVeYeYdC<64>ZZdDdE<64>Z[GdFdG<64>dGe\<5C>Z]GdHdI<64>dIe><3E>Z^GdJdK<64>dKe^<5E>Z_GdLdM<64>dMe_<65>Z`GdNdO<64>dOe_<65>ZaGdPdQ<64>dQe^<5E>ZbGdRdS<64>dSeb<65>ZcGdTdU<64>dUe_<65>ZdGdVdW<64>dWed<65>ZeGdXdY<64>dYed<65>ZfGdZd[<5B>d[e_<65>ZgGd\d]<5D>d]eg<65>ZhGd^d_<64>d_eg<65>ZiGd`da<64>dae^<5E>ZjGdbdc<64>dce><3E>Zkekddd5deddd<01>ekddd5dfddd<01>ekddd5dgddd<01>ekdddddd5de<64>ekdddddd5df<64>ekdddddd5dg<64>ekdddddddd<01>ekddd5dedhde<64>di<64>ek_lGdjdk<64>dkej<65>ZmGdldm<64>dmej<65>ZnGdndo<64>doej<65>ZoGdpdq<64>dqej<65>ZpGdrds<64>dsej<65>ZqGdtdu<64>duej<65>ZrGdvdw<64>dwej<65>ZsGdxdy<64>dyee<65>ZtGdzd{<7B>d{ee<65>ZuGd|d}<7D>d}e^<5E>ZvGd~d<64>dee<65>ZwGd<>d<EFBFBD><64>d<>ee<65>ZxGd<>d<EFBFBD><64>d<>ee<65>ZyGd<>d<EFBFBD><64>d<>e><3E>Zzez<65>Z{d<>d<EFBFBD><64>Z|Gd<>d<EFBFBD><64>d<>e><3E>Z}Gd<>d<EFBFBD><64>d<>e><3E>Z~d<>d<EFBFBD>d<EFBFBD><64>ZdS)<29>aK
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :doc:`/tutorials/text/mathtext`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _pyparsing: http://pyparsing.wikispaces.com/
The Bakoma distribution of the TeX Computer Modern fonts, and STIX
fonts are supported. There is experimental support for using
arbitrary fonts, but results may vary without proper tweaking and
metrics for those fonts.
<EFBFBD>)<01>
namedtupleN)<01>StringIO)<11>Combine<6E>Empty<74>
FollowedBy<EFBFBD>Forward<72>Group<75>Literal<61>oneOf<4F> OneOrMore<72>Optional<61>ParseBaseException<6F>ParseFatalException<6F> ParserElement<6E> QuotedString<6E>Regex<65> StringEnd<6E>Suppress<73>
ZeroOrMore)<04>cbook<6F>colors<72> get_data_path<74>rcParams)<01>AFM)<01>get_realpath_and_stat)<03>FT2Image<67>KERNING_DEFAULT<4C>LOAD_NO_HINTING)<03>findfont<6E>FontProperties<65>get_font)<05>latex_to_bakoma<6D>latex_to_standard<72>tex2uni<6E> latex_to_cmex<65>stix_virtual_fontsTcCsl|s t|<00>S|dkrdSyt|<00>Stk
r4YnXyt|<00>d<03>Stk
rftd<04>|<00><01><01>YnXdS)aD
Return the integer index (from the Unicode table) of *symbol*.
Parameters
----------
symbol : str
A single unicode character, a TeX command (e.g. r'\pi') or a Type1
symbol name (e.g. 'phi').
math : bool, default is True
If False, always treat as a single unicode character.
<20>-i"<00>\z9'{}' is not a valid Unicode character or TeX/Type1 symbolN)<07>ord<72> TypeErrorr#<00>strip<69>KeyError<6F>
ValueError<EFBFBD>format)<02>symbol<6F>math<74>r0<00>;/tmp/pip-install-i8dhxrtk/matplotlib/matplotlib/mathtext.py<70>get_unicode_index2s r2z3.0c@s@eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z dS)<0F>MathtextBackenda<64>
The base class for the mathtext backend-specific code. The
purpose of :class:`MathtextBackend` subclasses is to interface
between mathtext and a specific matplotlib graphics backend.
Subclasses need to override the following:
- :meth:`render_glyph`
- :meth:`render_rect_filled`
- :meth:`get_results`
And optionally, if you need to use a FreeType hinting style:
- :meth:`get_hinting_type`
cCsd|_d|_d|_dS)Nr)<03>width<74>height<68>depth)<01>selfr0r0r1<00>__init__gszMathtextBackend.__init__cCs||_||_||_dS)zDimension the drawing canvasN)r4r5r6)r7<00>w<>h<>dr0r0r1<00>set_canvas_sizelszMathtextBackend.set_canvas_sizecCs
t<00><00>dS)z_
Draw a glyph described by *info* to the reference point (*ox*,
*oy*).
N)<01>NotImplementedError)r7<00>ox<6F>oy<6F>infor0r0r1<00> render_glyphrszMathtextBackend.render_glyphcCs
t<00><00>dS)zR
Draw a filled black rectangle from (*x1*, *y1*) to (*x2*, *y2*).
N)r=)r7<00>x1<78>y1<79>x2<78>y2r0r0r1<00>render_rect_filledysz"MathtextBackend.render_rect_filledcCs
t<00><00>dS)zp
Return a backend-specific tuple to return to the backend after
all processing is done.
N)r=)r7<00>boxr0r0r1<00> get_resultsszMathtextBackend.get_resultscCstS)z\
Get the FreeType hinting type to use with this particular
backend.
)r)r7r0r0r1<00>get_hinting_type<70>sz MathtextBackend.get_hinting_typeN)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r8r<rArFrHrIr0r0r0r1r3Wsr3c@sHeZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z dd<0F>Z
dS)<11>MathtextBackendAggz<67>
Render glyphs and rectangles to an FTImage buffer, which is later
transferred to the Agg image by the Agg backend.
cCs4d|_d|_d|_d|_ddddg|_t<05>|<00>dS)Nr<00>bbox)r>r?<00>image<67>moderOr3r8)r7r0r0r1r8<00>s zMathtextBackendAgg.__init__cCsBt|jd|<01>t|jd|<02>t|jd|<03>t|jd|<04>g|_dS)Nr<00><00><00>)<03>minrO<00>max)r7rBrCrDrEr0r0r1<00> _update_bbox<6F>szMathtextBackendAgg._update_bboxcCs@t<00>||||<03>|jdkr<tt<04>|<01>t<04>|t|d<02><00><01>|_dS)NrOr)r3r<rQr<00>np<6E>ceilrVrP)r7r9r:r;r0r0r1r<<00>s
z"MathtextBackendAgg.set_canvas_sizecCsf|jdkr<|<00>||jj||jj||jj||jj<00>n&|jj|j |||jj
|j t dd<03>dS)NrOztext.antialiased)Z antialiased) rQrW<00>metrics<63>xmin<69>ymax<61>xmax<61>ymin<69>fontZdraw_glyph_to_bitmaprP<00>iceberg<72>glyphr)r7r>r?r@r0r0r1rA<00>s


zMathtextBackendAgg.render_glyphcCs<>|jdkr|<00>||||<04>nhtt||<00>dd<03>}|dkr\||d}t||dd<00>}nt|<02>}|j<04>t|<01>|t<06>|<03>||<00>dS)NrOrRrg@)rQrWrV<00>intrPZdraw_rect_filledrXrY)r7rBrCrDrEr5<00>center<65>yr0r0r1rF<00>s
 z%MathtextBackendAgg.render_rect_filledcCs<>d|_|j}|j}tdd|<01>|j}|dd|dd|dd|ddg}d|_|<00>|d|d|d|d||d|d|<00>t|d |d |<01>|j|j|j|j|j|j|j |f}d|_ |S)NrOrrRrSrT<00>render)
rQr5r6<00>shiprOr<r>r?r4rP)r7rG<00>used_charactersZ orig_heightZ
orig_depthrO<00>resultr0r0r1rH<00>s* ,
zMathtextBackendAgg.get_resultscCsddlm}|<01><02>S)Nr)<01> backend_agg)<03>matplotlib.backendsriZget_hinting_flag)r7rir0r0r1rI<00>s z#MathtextBackendAgg.get_hinting_typeN) rJrKrLrMr8rWr<rArFrHrIr0r0r0r1rN<00>s  rNc@seZdZdd<02>ZdS)<04>MathtextBackendBitmapc
Cs$t<00>|||<02>\}}}}}}} ||fS)N)rNrH)
r7rGrgr>r?r4r5r6rP<00>
charactersr0r0r1rH<00>sz!MathtextBackendBitmap.get_resultsN)rJrKrLrHr0r0r0r1rk<00>srkc@s:eZdZdZedd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Z d S) <0A>MathtextBackendPszT
Store information to write a mathtext rendering to the PostScript backend.
<20> _PSResultz+width height depth pswriter used_characterscCst<00>|_d|_dS)N)r<00>pswriter<65>lastfont)r7r0r0r1r8<00>szMathtextBackendPs.__init__cCsj|j||j}|j}|j}|j}||f|jkrPdt<06>}||f|_|j<07>|<07>dt<06>}|j<07>|<07>dS)Nz=/%(postscript_name)s findfont
%(fontsize)s scalefont
setfont
z1%(ox)f %(oy)f moveto
/%(symbol_name)s glyphshow
) r5<00>offset<65>postscript_name<6D>fontsize<7A> symbol_namerp<00>localsro<00>write)r7r>r?r@rrrsrt<00>psr0r0r1rA<00>s

 
zMathtextBackendPs.render_glyphcCs.d||j|||||f}|j<01>|<05>dS)Nz%f %f %f %f rectfill
)r5rorv)r7rBrCrDrErwr0r0r1rF<00>sz$MathtextBackendPs.render_rect_filledcCs,tdd|<01>|<00>|j|j|j|j|j|<02>S)Nr)rfrnr4r5r6ro)r7rGrgr0r0r1rHs  
zMathtextBackendPs.get_resultsN)
rJrKrLrMrrnr8rArFrHr0r0r0r1rm<00>srmc@s:eZdZdZedd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Z d S) <0A>MathtextBackendPdfzCStore information to write a mathtext rendering to the PDF backend.<2E>
_PDFResultz/width height depth glyphs rects used_characterscCsg|_g|_dS)N)<02>glyphs<68>rects)r7r0r0r1r8szMathtextBackendPdf.__init__cCs:|jj}|j||j}|j<04>||||j|j|jf<06>dS)N) r_<00>fnamer5rqrz<00>appendrs<00>numrt)r7r>r?r@<00>filenamer0r0r1rAs

zMathtextBackendPdf.render_glyphcCs&|j<00>||j|||||f<04>dS)N)r{r}r5)r7rBrCrDrEr0r0r1rFsz%MathtextBackendPdf.render_rect_filledcCs0tdd|<01>|<00>|j|j|j|j|j|j|<02>S)Nr)rfryr4r5r6rzr{)r7rGrgr0r0r1rH!s 
zMathtextBackendPdf.get_resultsN)
rJrKrLrMrryr8rArFrHr0r0r0r1rx srxc@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>MathtextBackendSvgzQ
Store information to write a mathtext rendering to the SVG
backend.
cCsg|_g|_dS)N)<02>
svg_glyphs<EFBFBD> svg_rects)r7r0r0r1r80szMathtextBackendSvg.__init__cCs4|j||j}|j<02>|j|j|j|||jf<06>dS)N)r5rqr<>r}r_rsr~rZ)r7r>r?r@r0r0r1rA4szMathtextBackendSvg.render_glyphcCs*|j<00>||j|d||||f<04>dS)NrR)r<>r}r5)r7rBrCrDrEr0r0r1rF:sz%MathtextBackendSvg.render_rect_filledcCs8tdd|<01>tj|j|jd<02>}|j|j|j|j||fS)Nr)r<>r<>)rf<00>types<65>SimpleNamespacer<65>r<>r4r5r6)r7rGrgZ svg_elementsr0r0r1rH>s 

zMathtextBackendSvg.get_resultsN)rJrKrLrMr8rArFrHr0r0r0r1r<>+s
r<>c@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>MathtextBackendPathzY
Store information to write a mathtext rendering to the text path
machinery.
cCsg|_g|_dS)N)rzr{)r7r0r0r1r8OszMathtextBackendPath.__init__cCs4|j||j}|j}|j<03>|j|j|||f<05>dS)N)r5rqr~rzr}r_rs)r7r>r?r@<00>thetextr0r0r1rASsz MathtextBackendPath.render_glyphcCs&|j<00>||j|||||f<04>dS)N)r{r}r5)r7rBrCrDrEr0r0r1rFYsz&MathtextBackendPath.render_rect_filledcCs*tdd|<01>|j|j|j|j|j|jfS)Nr)rfr4r5r6rzr{)r7rGrgr0r0r1rH\s  
zMathtextBackendPath.get_resultsN)rJrKrLrMr8rArFrHr0r0r0r1r<>Is
r<>c@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>MathtextBackendCairozS
Store information to write a mathtext rendering to the Cairo
backend.
cCsg|_g|_dS)N)rzr{)r7r0r0r1r8kszMathtextBackendCairo.__init__cCs8||j|j}t|j<03>}|j<04>|j|j|||f<05>dS)N)rqr5<00>chrr~rzr}r_rs)r7r>r?r@r<>r0r0r1rAos
z!MathtextBackendCairo.render_glyphcCs&|j<00>|||j||||f<04>dS)N)r{r}r5)r7rBrCrDrEr0r0r1rFusz'MathtextBackendCairo.render_rect_filledcCs*tdd|<01>|j|j|j|j|j|jfS)Nr)rfr4r5r6rzr{)r7rGrgr0r0r1rHys  
z MathtextBackendCairo.get_resultsN)rJrKrLrMr8rArFrHr0r0r0r1r<>es
r<>c@sreZdZdZdd<03>Zdd<05>Zdd<07>Zdd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dd<14>Z dd<16>Z dd<18>Zdd<1A>ZdS)<1D>Fontsz<73>
An abstract base class for a system of fonts to use for mathtext.
The class must be able to take symbol keys and font file names and
return the character metrics. It also delegates to a backend class
to do the actual drawing.
cCs||_||_i|_dS)aH
*default_font_prop*: A
:class:`~matplotlib.font_manager.FontProperties` object to use
for the default non-math font, or the base font for Unicode
(generic) font rendering.
*mathtext_backend*: A subclass of :class:`MathTextBackend`
used to delegate the actual rendering.
N)<03>default_font_prop<6F>mathtext_backendrg)r7r<>r<>r0r0r1r8<00>s
zFonts.__init__cCs
d|_dS)za
Fix any cyclical references before the object is about
to be destroyed.
N)rg)r7r0r0r1<00>destroy<6F>sz Fonts.destroyc
CsdS)av
Get the kerning distance for font between *sym1* and *sym2*.
*fontX*: one of the TeX font names::
tt, it, rm, cal, sf, bf or default/regular (non-math)
*fontclassX*: TODO
*symX*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'
*fontsizeX*: the fontsize in points
*dpi*: the current dots-per-inch
gr0)
r7<00>font1<74>
fontclass1<EFBFBD>sym1<6D> fontsize1<65>font2<74>
fontclass2<EFBFBD>sym2<6D> fontsize2<65>dpir0r0r1<00>get_kern<72>szFonts.get_kernTcCs|<00>||||||<06>}|jS)a4
*font*: one of the TeX font names::
tt, it, rm, cal, sf, bf or default/regular (non-math)
*font_class*: TODO
*sym*: a symbol in raw TeX form. e.g., '1', 'x' or '\sigma'
*fontsize*: font size in points
*dpi*: current dots-per-inch
*math*: whether sym is a math character
Returns an object with the following attributes:
- *advance*: The advance distance (in points) of the glyph.
- *height*: The height of the glyph in points.
- *width*: The width of the glyph in points.
- *xmin*, *xmax*, *ymin*, *ymax* - the ink rectangle of the glyph
- *iceberg* - the distance from the baseline to the top of
the glyph. This corresponds to TeX's definition of
"height".
)<02> _get_inforZ)r7r_<00>
font_class<EFBFBD>symrsr<>r/r@r0r0r1<00> get_metrics<63>szFonts.get_metricscCs6t<00>|||g<03>\|_|_|_|j<05>|j|j|j<04>dS)z<>
Set the size of the buffer used to render the math expression.
Only really necessary for the bitmap backends.
N)rXrYr4r5r6r<>r<)r7r9r:r;r0r0r1r<<00>szFonts.set_canvas_sizec CsZ|<00>|||||<07>}t|jj<03>\} }
|j<04>|
| t<06>f<02>} | d<00>|j<08>|j <09>
|||<08>dS)a
Draw a glyph at
- *ox*, *oy*: position
- *facename*: One of the TeX face names
- *font_class*:
- *sym*: TeX symbol name or single character
- *fontsize*: fontsize in points
- *dpi*: The dpi to draw at.
rRN) r<>rr_r|rg<00>
setdefault<EFBFBD>set<65>addr~r<>rA) r7r>r?Zfacenamer<65>r<>rsr<>r@<00>realpathZstat_keyrgr0r0r1rA<00>s zFonts.render_glyphcCs|j<00>||||<04>dS)zL
Draw a filled rectangle from (*x1*, *y1*) to (*x2*, *y2*).
N)r<>rF)r7rBrCrDrEr0r0r1rF<00>szFonts.render_rect_filledcCs
t<00><00>dS)zF
Get the xheight for the given *font* and *fontsize*.
N)r=)r7r_rsr<>r0r0r1<00> get_xheight<68>szFonts.get_xheightcCs
t<00><00>dS)z<>
Get the line thickness that matches the given font. Used as a
base unit for drawing lines such as in a fraction or radical.
N)r=)r7r_rsr<>r0r0r1<00>get_underline_thicknessszFonts.get_underline_thicknesscCs|jS)z<>
Get the set of characters that were used in the math
expression. Used by backends that need to subset fonts so
they know which glyphs to include.
)rg)r7r0r0r1<00>get_used_charactersszFonts.get_used_characterscCs|j<00>||<00><02><00>}|<00><03>|S)z<>
Get the data needed by the backend to render the math
expression. The return value is backend-specific.
)r<>rHr<>r<>)r7rGrhr0r0r1rHs zFonts.get_resultscCs
||fgS)a
Override if your font provides multiple sizes of the same
symbol. Should return a list of symbols matching *sym* in
various sizes. The expression renderer will select the most
appropriate size for a given situation from this list.
r0)r7<00>fontnamer<65>r0r0r1<00>!get_sized_alternatives_for_symbolsz'Fonts.get_sized_alternatives_for_symbolN)T)rJrKrLrMr8r<>r<>r<>r<rArFr<>r<>r<>rHr<>r0r0r0r1r<><00>s
! 
r<EFBFBD>c@sReZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zdd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dS)<15> TruetypeFontsza
A generic base class for all font setups that use Truetype fonts
(through FT2Font).
cCsBt<00>|||<02>i|_i|_t|<01>}t|<03>}||jd<||jd<dS)N<>default<6C>regular)r<>r8<00>glyphd<68>_fontsrr )r7r<>r<>r<00> default_fontr0r0r1r8(s
zTruetypeFonts.__init__cCsd|_t<01>|<00>dS)N)r<>r<>r<>)r7r0r0r1r<>2szTruetypeFonts.destroycCsl||jkr|j|}n|}|j<01>|<02>}|dkrhtj<04>|<02>rht|<02>}||j|<||j|j<||j|j<07><08><|S)N) <09>fontmapr<70><00>get<65>os<6F>path<74>existsr rr<00>lower)r7r_<00>basename<6D> cached_fontr0r0r1<00> _get_font6s
  
 zTruetypeFonts._get_fontcCs,|jdkr(|jdd|d|dSdS)NZCmex10gP@g@g@gR@g)rrr5)r7r_rarsr<>r0r0r1<00> _get_offsetCs
zTruetypeFonts._get_offsetTc Cs<>|||||f}|j<00>|<07>}|dk r&|S|<00>|||||<06>\} }
} }} | <09>||<05>| j|
|j<05><06>d<01>} dd<03>| jD<00>\}}}}|<00>| | ||<05>}t j
| j d| j d| j d||||||| jd|| d<06> }t j
| || j|| |
| |d<07>}|j|<|S)N)<01>flagscSsg|] }|d<00>qS)gP@r0)<02>.0<EFBFBD>valr0r0r1<00>
<listcomp>Vsz+TruetypeFonts._get_info.<locals>.<listcomp>g<00>@gP@) <09>advancer5r4r[r]r^r\r`<00>slanted)r_rsrrrZrtr~rarq)r<>r<><00>
_get_glyph<EFBFBD>set_sizeZ load_charr<72>rIrOr<>r<>r<>ZlinearHoriAdvancer5r4Z horiBearingYrr)r7r<>r<>r<>rsr<>r/<00>keyZbunchr_r~rtr<>rar[r^r]r\rqrZrhr0r0r1r<>Hs>   zTruetypeFonts._get_infocCsd|<00>|<01>}|<04>||<03>|<04>d<01>}|dkrD|<00>|tdd||<03>}|jS|dd|d|d}|S)N<>pcltzmathtext.default<6C>x<>xHeightgP@g(@gY@)r<>r<>Zget_sfnt_tabler<65>rr`)r7r<>rsr<>r_r<>rZr<>r0r0r1r<>qs
 
zTruetypeFonts.get_xheightcCsd||dS)Ng<00>?gR@r0)r7r_rsr<>r0r0r1r<>}sz%TruetypeFonts.get_underline_thicknessc
Csl||krP||krP|<00>||||| <09>}
|<00>||||| <09>} |
j} | <0C>|
j| jt<04>dSt<05>|||||||||| <09>
S)N<>@)r<>r_<00> get_kerningr~rr<>r<>) r7r<>r<>r<>r<>r<>r<>r<>r<>r<><00>info1<6F>info2r_r0r0r1r<><00>szTruetypeFonts.get_kernN)T) rJrKrLrMr8r<>r<>r<>r<>r<>r<>r<>r0r0r0r1r<>#s
 
) r<>c@s0eZdZdZdddddddd <09>Zd
d <0B>Zed <0C><07><00>Zd`dd<0F>Z dddddgdddddgdddddgdd d!d"d#gd$d%d&d'gd(d)d*d+gd,d-d.d/gd0d1d2d3gd4d5d6d7gd8d9d:d;gd<d=d>d?gd@dAdBdCgdDdEdFdGgdHdIdJdKgdLdMdNdOdPgdQdRdSdTgdUdVdWdXgdYd=gdZdAgd[<5B>Z
xd\D]\Z Z e
e e
e <<00>q
Wd]d^<5E>Z d_S)a<> BakomaFontsz<73>
Use the Bakoma TrueType fonts for rendering.
Symbols are strewn about a number of font files, each of which has
its own proprietary 8-bit encoding.
<20>cmsy10<31>cmr10<31>cmtt10<31>cmmi10<31>cmb10<31>cmss10<31>cmex10)<07>cal<61>rm<72>tt<74>it<69>bf<62>sf<73>excOs\t||<02>|_tj|f|<01>|<02>i|_x2|j<05><06>D]$\}}t|<04>}||j|<||j|<q0WdS)N)<08> StixFonts<74>_stix_fallbackr<6B>r8r<><00>_fontmap<61>itemsr)r7<00>args<67>kwargsr<73>r<><00>fullpathr0r0r1r8<00>s 
zBakomaFonts.__init__z
\int \ointTc Cs<>d}d}||jkrD|tkrDt|\}} |dkp6||jk}
|<00>|<08>}n.t|<03>dkrr|dk}
|<00>|<01>}|dk rrt|<03>} |dk r<>|<07>| <09>} | dkr<>|<07>| <0B>}|dkr<>|j<08> |||||<05>S|| |||
fS)Nr<4E>rRr<>r)
r<EFBFBD>r!<00>_slanted_symbolsr<73><00>lenr(<00>get_char_index<65>get_glyph_namer<65>r<>) r7r<>r<>r<>rsr/rtr_r<>r~r<><00>gidr0r0r1r<><00>s&   


zBakomaFonts._get_glyph)r<><00>()r<><00>¡)r<><00>³)r<><00>µ)r<><00>Ã)r<><00>))r<><00>¢)r<><00>´)r<><00>¶)r<><00>!)r<><00>{)r<><00>©)r<><00>n)r<><00>½)r<>r<>)r<><00>})r<><00>ª)r<><00>o)r<><00>¾)r<>r<>)r<><00>[)r<><00>£)r<>r:)r<><00>")r<><00>])r<><00>¤)r<><00>i)r<><00>#)r<><00>¥)r<><00>j)r<><00>¹)r<><00>$)r<><00>¦)r<><00>k)r<><00>º)r<><00>%)r<><00>§)r<><00>l)r<><00>»)r<><00>&)r<><00>¨)r<><00>m)r<><00>¼)r<><00>')r<><00>­)r<><00>D)r<><00>¿)r<><00>*)r<><00>®)r<><00>E)r<><00>À)r<><00>+)r<><00>p)r<><00>q)r<><00>r)r<><00>s)r<><00>²)r<><00>/)r<><00>Â)r<>r&)r<>r)r<><00>±)r<><00>.)r<><00>Ë)r<><00>,)r<><00>^)r<><00>b)r<><00>c)r<>r;)r<><00>~)r<><00>e)r<><00>f)r<><00>g)r<>r:)r<>r<>)r<>r<>r<>r<>r<>r<>z\lfloorz\rfloorz\lceilz\rceilz\langlez\ranglez \__sqrt__z
\backslashrz\widehatz
\widetilde<64><<3C>>)
)z
\leftparenr<6E>)z \rightparentr<74>)z
\leftbracer<65>)z \rightbracer<65>)z \leftbracketr<74>)z \rightbracketr<74>)z\{r<>)z\}r<>)z\[r<>)z\]r<>cCs|j<00>|||fg<01>S)N)<02>_size_alternativesr<73>)r7r<>r<>r0r0r1r<><00>sz-BakomaFonts.get_sized_alternatives_for_symbolN)T)rJrKrLrMr<>r8r<><00>splitr<74>r<>r$<00>alias<61>targetr<74>r0r0r0r1r<><00>sd

 
r<>c@sBeZdZdZdZdd<04>Zed<05><07><00>Zdd<07>Z d dd <09>Z
d
d <0B>Z d S)<0E> UnicodeFontsaa
An abstract base class for handling Unicode fonts.
While some reasonably complete Unicode fonts (such as DejaVu) may
work in some situations, the only Unicode font I'm aware of with a
complete set of math symbols is STIX.
This class will "fallback" on the Bakoma fonts when a required
symbol can not be found in the font.
TcOs<>tdrt||<02>|_nd|_tj|f|<01>|<02>i|_x.d<02><06>D]"}td|}t|<04>}||j|<q>Wtd<04>}t|<04>}||jd<dS)Nzmathtext.fallback_to_cmzcal rm tt it bf sfz mathtext.r<>r<>) rr<><00> cm_fallbackr<6B>r8r<>r%rr)r7r<>r<>Ztexfont<6E>propr_r0r0r1r8 s zUnicodeFonts.__init__z
\int \ointcCs||fS)Nr0)r7r<>r<><00>uniindexr0r0r1<00>_map_virtual_fontszUnicodeFonts._map_virtual_fontcCs<>d}|jr$t<01>|<03>}|dk r$d}d}|shyt||<05>}d}Wn,tk
rftd<04>}t<06>d<05>|<03><01>YnX|<00> |||<07>\}}|}|r<>|dkr<>|dkr<>t
|<07>} t <0B> | <09>dd kr<>t <0B> | <09><01>d
<EFBFBD>r<>d }|dkp<>||jk}
d}|<00>|<08>} | dk r<>| <0B>|<07>} | dkr<>d}|<06>s<>|j<12>rbt|jt<14><02>r$t<06>d <0C>|d k<06>rNt|jt<15><02>rN|j<12>d |||<04>S|j<12>||||<04>SnZ|d k<06>r<>t|t<15><02>r<>|<00>d |||<04>St<06>d<0E>|||<07><03>d }|<00>|<01>} d}| <0B>|<07>} d}
| <0B>| <0C>} | || ||
fS)NFr<46>T<>?z#No TeX to unicode mapping for {!a}.r<>ir<00>Lz GREEK CAPITALr<4C>z0Substituting with a symbol from Computer Modern.)r<>r<>zTFont {!r} does not have a glyph for {!a} [U+{:x}], substituting with a dummy symbol.<2E><>)<18>use_cmexr$r<>r2r,r(<00>_log<6F>warningr-r,r<><00> unicodedata<74>category<72>name<6D>
startswithr<EFBFBD>r<>r<>r)<00>
isinstancer<EFBFBD>r<>r<>r<>)r7r<>r<>r<>rsr/<00> found_symbolr+Z new_fontname<6D>charr<72>r_<00>
glyphindexrtr0r0r1r<> sj




 
  


zUnicodeFonts._get_glyphcCs|jr|j<00>||<02>S||fgS)N)r)r<>)r7r<>r<>r0r0r1r<>dsz.UnicodeFonts.get_sized_alternatives_for_symbolN)T) rJrKrLrMr0r8r<>r%r<>r,r<>r<>r0r0r0r1r(<00>s
 
Dr(cs*eZdZdZdd<03>Zd<07>fdd<06> Z<05>ZS)<08> DejaVuFontsFcOs<>t|t<01>rt||<02>|_n t||<02>|_t||<02>|_tj|f|<01>|<02>i|_ |j
<EFBFBD> dddddd<06><05>x2|j
<EFBFBD> <0C>D]$\}}t |<04>}||j |<||j |<qlWdS)N<>STIXSizeOneSym<79>STIXSizeTwoSym<79>STIXSizeThreeSym<79>STIXSizeFourSym<79>STIXSizeFiveSym)rRrSrT<00><00>)r7<00>DejaVuSerifFontsr<73>r)<00> StixSansFontsr<73><00>bakomar<61>r8r<>r<><00>updater<65>r)r7r<>r<>r<>r5r<>r0r0r1r8ns 
  

zDejaVuFonts.__init__Tc st|dkr|j<00>|||||<05>St|<03>}|<00>d<02>}|dk r\|<07>|<06>}|dkr\t<05><00>d||||<05>St<05><00>|||||<05>SdS)Nz\primer<65>r)rEr<>r2r<>r<><00>super) r7r<>r<>r<>rsr/r+r_r:)<01> __class__r0r1r<><00>s

zDejaVuFonts._get_glyph)T)rJrKrLr0r8r<><00> __classcell__r0r0)rHr1r;ksr;c@s$eZdZdZdddddddd<08>Zd S)
rCzv
A font handling class for the DejaVu Serif fonts
If a glyph is not found it will fallback to Stix Serif
z DejaVu SerifzDejaVu Serif:italiczDejaVu Serif:weight=boldz DejaVu SanszDejaVu Sans MonozDejaVu Serif Display)r<>r<>r<>r<>r<>r<>rN)rJrKrLrMr<>r0r0r0r1rC<00>srCc@s$eZdZdZdddddddd<07>ZdS) <09>DejaVuSansFontszt
A font handling class for the DejaVu Sans fonts
If a glyph is not found it will fallback to Stix Sans
z DejaVu SanszDejaVu Sans:italiczDejaVu Sans:weight=boldzDejaVu Sans MonozDejaVu Sans Display)r<>r<>r<>r<>r<>r<>rN)rJrKrLrMr<>r0r0r0r1rJ<00>srJc @sVeZdZdZddddddddd d
d d d <0A> ZdZdZdZdd<10>Zdd<12>Z iZ
dd<14>Z dS)r<>aa
A font handling class for the STIX fonts.
In addition to what UnicodeFonts provides, this class:
- supports "virtual fonts" which are complete alpha numeric
character sets with different font styles at special Unicode
code points, such as "Blackboard".
- handles sized alternative characters for the STIXSizeX fonts.
<20> STIXGeneralzSTIXGeneral:italiczSTIXGeneral:weight=bold<6C>STIXNonUnicodezSTIXNonUnicode:italiczSTIXNonUnicode:weight=boldr<r=r>r?r@) r<>r<>r<>ZnonunirmZnonuniitZnonunibfrrRrSrTrArBFcOsPtj|f|<01>|<02>i|_x2|j<03><04>D]$\}}t|<04>}||j|<||j|<q$WdS)N)r<>r8r<>r<>r<>r)r7r<>r<>r<>r5r<>r0r0r1r8<00>s 
zStixFonts.__init__c
CsPt<00>|<01>}|jr.|dkr.|dkr.td}d}nd}|dk <09>rt|t<04>rpy ||}Wntk
rn|d}YnXd}t|<04>}xJ||kr<>||d}||} || dkr<>|}q~|| dkr<>Pq~|d}q~W| d|kr<>| dk<01>rnn|| d| d }| d}n|<05>sd}td
}|d k<06>rHd |k<01>r<d k<01>rHnnd|}||fS)N)r<>r<>r<>TFr<46>rrSrRrTzmathtext.default)r<>r<>r<>i<00>i<><69>Znonuni)r%r<><00>_sansr7<00>dictr+r<>r)
r7r<>r<>r+<00>mappingZdoing_sans_conversion<6F>lo<6C>hiZmid<69>ranger0r0r1r,<00>s>


 
    "
&zStixFonts._map_virtual_fontc
Cs<>ddddd<05>}|<03>||<02>}|j<01>|<02>}|r.|Sg}y t|<02>}Wntk
rX||fgSXtd<06>dtd<08>d i}|<06>||<05>}x>td
<EFBFBD>D]2}|<00>|<07>}|<08>|<05>} | d kr<>|<04>|t |<05>f<02>q<>W|d kr<>|dd <0A>}||j|<|S)Nr<4E>r<>r<>r<>)z\{z\}z\[z\]r"i<>'r#i<>'<00>rz \__sqrt__<5F><5F><EFBFBD><EFBFBD><EFBFBD>)
r<EFBFBD>r$r2r,r(rRr<>r<>r}r<>)
r7r<>r<><00>fixes<65> alternativesr+Zfix_upsr<73>r_r:r0r0r1r<>
s,      

 
z+StixFonts.get_sized_alternatives_for_symbolN) rJrKrLrMr<>r0r)rMr8r,r$r<>r0r0r0r1r<><00>s( -r<>c@seZdZdZdZdS)rDzd
A font handling class for the STIX fonts (that uses sans-serif
characters by default).
TN)rJrKrLrMrMr0r0r0r1rD-srDc@sheZdZdZej<05>e<07>dd<03>Zdddddd d
d <0B>Z d d <0A>Z
dd<0F>Z ddd<12>Z dd<14>Z dd<16>Zdd<18>ZdS)<1B>StandardPsFontsz<73>
Use the standard postscript fonts for rendering to backend_ps
Unlike the other font classes, BakomaFont and UnicodeFont, this
one requires the Ps backend.
<20>fonts<74>afmZpzcmi8aZpncr8aZpcrr8aZpncri8aZphvr8aZpncb8aZpsyr)r<>r<>r<>r<>r<>r<>Nc Cs<>t<00>||t<02><00>i|_i|_t|d|jd<02>}|dkrDtdd|jd<02>}t|d<04><02>}t|<03>}WdQRX||_ ||jd<||jd<t
<EFBFBD>|_ dS)NrY)Zfontext<78> directoryZ Helvetica<63>rbr<62>r<>) r<>r8rmr<>rXr<00>basepath<74>openrr|rro)r7r<>r<00>fdr<64>r0r0r1r8Gs

 

zStandardPsFonts.__init__c Cs<>||jkr|j|}n|}|j<01>|<02>}|dkr~tj<04>|j|d<00>}t|d<02><02>}t|<05>}WdQRX||_ ||j|<||j|<03>
<EFBFBD><|S)Nz.afmr[) r<>rXr<>r<>r<><00>joinr\r]rr|<00> get_fontname)r7r_r<>r<>r|r^r0r0r1r<>Ys
   
zStandardPsFonts._get_fontTc s<>||||f}|j<00>|<07>}|dk r$|S|dkrLt|<03>dksHt<03>|<03><01>d<04>sLd}d} |tkrrt|\}}
t|
<EFBFBD>} d} n.t|<03>dkr<>|} t| <0B>}
d} nt <09>
d<08> |<03><01>|dk} |<00> |<01>} | r<>y| <0A> | <0B>}Wn.tk
r<EFBFBD>t <09>
d <09> | <0A><0F>|<03><02>d} YnX| <09>sd
} t| <0B>}
| <0A> | <0B>}d }d |<00><00>fd d<0E>| <0A>| <0B>D<00>\}}}}tj| <0A>| <0B><01>| <0A>| <0B><01>| <0A>| <0B><01>||||||||| d<0F> }tj| || <0A><0F>|||
| |d<10>|j|<|j|S)z/load the cmfont, metrics and glyph with cachingNr<4E>rRr.r<>FTz.No TeX to built-in Postscript mapping for {!r}z2No glyph in standard Postscript font {!r} for {!r}r-rg<><67><EFBFBD><EFBFBD>MbP?csg|] }|<01><00>qSr0r0)r<>r<>)<01>scaler0r1r<><00>sz-StandardPsFonts._get_info.<locals>.<listcomp>) r<>r4r5r[r]r^r\r`r<>)r_rsrrrZrtr~rarq)r<>r<>r<>r3r4r6r"r<>r(r1r2r-r<>Z get_name_charr+r`Z get_bbox_charr<72>r<>Zget_width_charZget_height_char)r7r<>r<>r<>rsr<>r/r<><00>tupr8r~rar<>r_rtrqr[r^r]r\rZr0)rar1r<>isr      



   zStandardPsFonts._get_infoc
Csn||krR||krR|<00>||||| <09>}
|<00>||||| <09>} |
j} | <0C>|
j| j<03>d|St<04>|||||||||| <09>
S)Ng<4E><67><EFBFBD><EFBFBD>MbP?)r<>r_Z get_kern_distrar<>r<>) r7r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r_r0r0r1r<><00>szStandardPsFonts.get_kerncCs|<00>|<01>}|<01><01>d|S)Ng<4E><67><EFBFBD><EFBFBD>MbP?)r<>r<>)r7r_rsr<>r0r0r1r<><00>s
zStandardPsFonts.get_xheightcCs|<00>|<01>}|<01><01>d|S)Ng<4E><67><EFBFBD><EFBFBD>MbP?)r<>r<>)r7r_rsr<>r0r0r1r<><00>s
z'StandardPsFonts.get_underline_thicknessN)T)rJrKrLrMr<>r<>r_rr\r<>r8r<>r<>r<>r<>r<>r0r0r0r1rW5s
N rWgffffff<66>?g<00>?rSc@s0eZdZdZdZdZdZdZdZdZ dZ
d Z d
S) <0B>FontConstantsBasez<65>
A set of constants that controls how certain things, such as sub-
and superscripts are laid out. These are all metrics that can't
be reliably retrieved from the font metrics in the font itself.
g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?gffffff<66>?g333333<33>?g<00>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?N) rJrKrLrM<00> script_space<63>subdrop<6F>sup1<70>sub1<62>sub2<62>delta<74> delta_slanted<65>delta_integralr0r0r0r1rc<00>srcc@s,eZdZdZdZdZdZdZdZdZ dZ
dS)<06>ComputerModernFontConstantsg333333<33>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g333333<33>?N) rJrKrLrdrerfrgrhrirjrkr0r0r0r1rlsrlc@s$eZdZdZdZdZdZdZdZdS)<07>STIXFontConstantsg<73><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g333333<33>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g333333<33>?N) rJrKrLrdrfrhrirjrkr0r0r0r1rms rmc@seZdZdZdZdZdZdS)<06>STIXSansFontConstantsg<73><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g333333<33>?g333333<33>?N)rJrKrLrdrfrjrkr0r0r0r1rn$srnc@s eZdZdS)<02>DejaVuSerifFontConstantsN)rJrKrLr0r0r0r1ro+sroc@s eZdZdS)<02>DejaVuSansFontConstantsN)rJrKrLr0r0r0r1rp/srp)z DejaVu SanszDejaVu Sans Monoz DejaVu Serifr<66>r<>r<>r<>r<>r<>r<>rKrLr@r?r>r=r<zBitstream Vera SanszBitstream VeracCs4t<00>|j<02>|j<04>jt<06>}|tkr0t|jt <09>r0t
S|S)N) <0B>_font_constant_mappingr<67><00> font_outputr<74>r_Z family_namercrmr7rDrn)<02>state<74> constantsr0r0r1<00>_get_font_constant_setLs ruc@s eZdZdS)<02>MathTextWarningN)rJrKrLr0r0r0r1rvXsrvc@s@eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z dS)<0F>Nodez%
A node in the TeX box model
cCs
d|_dS)Nr)<01>size)r7r0r0r1r8`sz Node.__init__cCs|jjS)N)rHrJ)r7r0r0r1<00>__repr__csz Node.__repr__cCsdS)Ngr0)r7<00>nextr0r0r1r<>fszNode.get_kerningcCs|jd7_dS)z<>
Shrinks one level smaller. There are only three levels of
sizes, after which things will no longer get smaller.
rRN)rx)r7r0r0r1<00>shrinkisz Node.shrinkcCs|jd8_dS)zb
Grows one level larger. There is no limit to how big
something can get.
rRN)rx)r7r0r0r1<00>growpsz Node.growcCsdS)Nr0)r7r<>rdr0r0r1rewsz Node.renderN)
rJrKrLrMr8ryr<>r{r|rer0r0r0r1rw\srwc@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>Boxz7
Represents any node with a physical location.
cCs t<00>|<00>||_||_||_dS)N)rwr8r4r5r6)r7r4r5r6r0r0r1r8s
z Box.__init__cCsBt<00>|<00>|jtkr>|jt9_|jt9_|jt9_dS)N)rwr{rx<00>NUM_SIZE_LEVELSr4<00> SHRINK_FACTORr5r6)r7r0r0r1r{<00>s


z
Box.shrinkcCs8t<00>|<00>|jt9_|jt9_|jt9_dS)N)rwr|r4<00> GROW_FACTORr5r6)r7r0r0r1r|<00>s
zBox.growcCsdS)Nr0)r7rBrCrDrEr0r0r1re<00>sz
Box.renderN)rJrKrLrMr8r{r|rer0r0r0r1r}{s
r}c@seZdZdZdd<03>ZdS)<05>Vboxz.
A box with only height (zero width).
cCst<00>|d||<02>dS)Ng)r}r8)r7r5r6r0r0r1r8<00>sz Vbox.__init__N)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@seZdZdZdd<03>ZdS)<05>Hboxz8
A box with only width (zero height and depth).
cCst<00>||dd<01>dS)Ng)r}r8)r7r4r0r0r1r8<00>sz Hbox.__init__N)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@sReZdZdZddd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dS)<15>Chara#
Represents a single character. Unlike TeX, the font information
and metrics are stored with each :class:`Char` to make it easier
to lookup the font metrics when needed. Note that TeX boxes have
a width, height, and depth, unlike Type1 and Truetype which use a
full bounding box and an advance in the x-direction. The metrics
must be converted to the TeX way, and the advance (if different
from width) must be converted into a :class:`Kern` node when the
:class:`Char` is added to its parent :class:`Hlist`.
TcCsJt<00>|<00>||_|j|_|j|_|j|_|j|_|j|_||_|<00> <09>dS)N)
rwr8rrrr_r<>rsr<>r/<00>_update_metrics)r7rrsr/r0r0r1r8<00>s
z Char.__init__cCs
d|jS)Nz`%s`)r)r7r0r0r1ry<00>sz Char.__repr__cCs`|j<00>|j|j|j|j|j|j<07>}|_|jdkr<|j |_
n|j
|_
|j |_ |j |j  |_ dS)N<> )rrr<>r_r<>rrsr<>r/<00>_metricsr<73>r4r`r5r6)r7rZr0r0r1r<><00>s

zChar._update_metricscCs|jjS)N)r<>r<>)r7r0r0r1<00>
is_slanted<EFBFBD>szChar.is_slantedc CsR|jj|j}d}t|t<04>rJ|j<05>|j|j|j |j
|j|j|j |j
|j <0B> }||S)z<>
Return the amount of kerning between this and the given
character. Called when characters are strung together into
:class:`Hlist` to create :class:`Kern` nodes.
g) r<>r<>r4r7r<>rrr<>r_r<>rrsr<>)r7rzr<><00>kernr0r0r1r<><00>s
zChar.get_kerningc Cs&|j<00>|||j|j|j|j|j<06>dS)z4
Render the character to the canvas
N)rrrAr_r<>rrsr<>)r7r<>rdr0r0r1re<00>sz Char.rendercCsPt<00>|<00>|jtkrL|jt9_|jt9_|jt9_|jt9_dS)N) rwr{rxr~rsrr4r5r6)r7r0r0r1r{<00>s 

z Char.shrinkcCsFt<00>|<00>|jt9_|jt9_|jt9_|jt9_dS)N)rwr|rsr<>r4r5r6)r7r0r0r1r|<00>s

z Char.growN)T) rJrKrLrMr8ryr<>r<>r<>rer{r|r0r0r0r1r<><00>s

 r<>c@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>Accentz<74>
The font metrics need to be dealt with differently for accents,
since they are already offset correctly from the baseline in
TrueType fonts.
cCsJ|j<00>|j|j|j|j|j<06>}|_|j|j |_
|j |j |_ d|_dS)Nr)rrr<>r_r<>rrsr<>r<>r]r[r4r\r^r5r6)r7rZr0r0r1r<><00>s
zAccent._update_metricscCst<00>|<00>|<00><02>dS)N)r<>r{r<>)r7r0r0r1r{s
z Accent.shrinkcCst<00>|<00>|<00><02>dS)N)r<>r|r<>)r7r0r0r1r|s
z Accent.growc Cs6|j<00>||jj||jj|j|j|j|j|j <09>dS)z5
Render the character to the canvas.
N)
rrrAr<>r[r^r_r<>rrsr<>)r7r<>rdr0r0r1re sz Accent.renderN)rJrKrLrMr<>r{r|rer0r0r0r1r<><00>s
r<>csLeZdZdZdd<03>Z<04>fdd<05>Zedd<07><00>Zdd <09>Zd
d <0B>Z d d <0A>Z
<EFBFBD>Z S)<0E>Listz:
A list of nodes (either horizontal or vertical).
cCs2t<00>|ddd<01>d|_||_d|_d|_d|_dS)Ngr)r}r8<00> shift_amount<6E>children<65>glue_set<65> glue_sign<67>
glue_order)r7<00>elementsr0r0r1r8s z List.__init__c
s4dt<00><00><01>|j|j|j|jd<02>dd<04>|jD<00><01>fS)Nz![%s <%.02f %.02f %.02f %.02f> %s]r<>cSsg|] }t|<01><01>qSr0)<01>repr)r<>r<>r0r0r1r<>&sz!List.__repr__.<locals>.<listcomp>)rGryr4r5r6r<>r_r<>)r7)rHr0r1ry!s
z List.__repr__cCs4x.tt|<00><01>ddd<02>D]}||dkr|SqWdS)z<>
Determine the highest order of glue used by the members of this list.
Helper function used by vpack and hpack.
NrTr)rRr<>)<02>totalsr<73>r0r0r1<00>_determine_order(s zList._determine_ordercCsh|<00>|<03>}||_||_||dkr2||||_n d|_d|_|dkrdt|j<06>rdt<07>d||j j
|<00>dS)Ngrz %s %s: %r) r<>r<>r<>r<><00>
glue_ratior<EFBFBD>r<>r1r2rHrJ)r7r<><00>signr<6E>Z
error_typer<EFBFBD>r0r0r1<00> _set_glue4s
 
zList._set_gluecCsLx|jD] }|<01><01>qWt<02>|<00>|jtkrH|jt9_|jt9_dS)N)r<>r{r}rxr~r<>rr<>)r7<00>childr0r0r1r{Bs   

z List.shrinkcCsBx|jD] }|<01><01>qWt<02>|<00>|jt9_|jt9_dS)N)r<>r|r}r<>r<>r<>)r7r<>r0r0r1r|Js
  
z List.grow) rJrKrLrMr8ry<00> staticmethodr<64>r<>r{r|rIr0r0)rHr1r<>s  r<>c@s,eZdZdZd dd<06>Zdd<08>Zd d d
<EFBFBD>Zd S)<0E>Hlistz%
A horizontal list of boxes.
<20><00>
additionalTcCs$t<00>||<01>|r|<00><02>|<00><03>dS)N)r<>r8r<><00>hpack)r7r<>r9r<00>do_kernr0r0r1r8Vs zHlist.__init__cCs<>g}t|j<01>}|r<>xht|<02>D]\}|j|}||dkrF|j|d}nd}|<01>|<04>|<04>|<05>}|dkrt|<06>}|<01>|<07>qW||_dS)a)
Insert :class:`Kern` nodes between :class:`Char` nodes to set
kerning. The :class:`Char` nodes themselves determine the
amount of kerning they need (in :meth:`~Char.get_kerning`),
and this function just creates the linked list in the correct
way.
rRNg)r<>r<>rRr}r<><00>Kern)r7<00> new_childrenZ num_childrenr<6E><00>elemrzZkerning_distancer<65>r0r0r1r<>\s

 

z
Hlist.kernc Cs<>d}d}d}dgd}dgd}x<>|jD]<5D>}t|t<02>rZ||j7}t||j<05>}t||j<06>}q(t|t<07>r<>||j7}t<08> |j<05>s<>t<08> |j<06>s<>t
|dd<01>} t||j| <00>}t||j| <00>}q(t|t <0B>r<>|j }
||
j7}||
j |
j7<||
j|
j7<q(t|t<11>r(||j7}q(W||_||_|dk<02>r.||7}||_||}|dk<02>r\d|_d|_d|_dS|dk<04>rx|<00>|d|d<08>n|<00>|d |d
<EFBFBD>dS) a
The main duty of :meth:`hpack` is to compute the dimensions of
the resulting boxes, and to adjust the glue if one of those
dimensions is pre-specified. The computed sizes normally
enclose all of the material inside the new box; but some items
may stick out if negative glue is used, if the box is
overfull, or if a ``\vbox`` includes other boxes that have
been shifted left.
- *w*: specifies a width
- *m*: is either 'exactly' or 'additional'.
Thus, ``hpack(w, 'exactly')`` produces a box whose width is
exactly *w*, while ``hpack(w, 'additional')`` yields a box
whose width is the natural width plus *w*. The default values
produce a box with the natural width.
grAr<>r<>rNrR<00>OverfullrT<00> Underfull)r<>r7r<>r4rVr5r6r}rX<00>isinf<6E>getattr<74>Glue<75> glue_spec<65> stretch_order<65>stretch<63> shrink_orderr{r<>r<>r<>r<>r<>) r7r9rr:r;r<><00> total_stretch<63> total_shrinkrrr<>r0r0r1r<><00>sJ

 

 

 





z Hlist.hpackN)r<>r<>T)r<>r<>)rJrKrLrMr8r<>r<>r0r0r0r1r<>Rs
'r<>c@s,eZdZdZd dd<05>Zddejfdd<07>ZdS)
<EFBFBD>Vlistz#
A vertical list of boxes.
<20>r<>cCst<00>||<01>|<00><02>dS)N)r<>r8<00>vpack)r7r<>r:rr0r0r1r8<00>s zVlist.__init__c Cs<>d}d}d}dgd}dgd}x<>|jD]<5D>} t| t<02>rt||| j7}| j}t<05>| j<07>s<>t| dd<01>}
t || j|
<00>}q(t| t
<EFBFBD>r<>||7}d}| j } || j7}|| j | j 7<|| j| j7<q(t| t<10>r<>||| j7}d}q(t| t<11>r(td<04><01>q(W||_||k<04>r|||7}||_n||_|dk<02>r4||7}||_||}|dk<02>rbd|_d|_d|_dS|dk<04>r~|<00>|d|d <09>n|<00>|d
|d <0B>dS) a6
The main duty of :meth:`vpack` is to compute the dimensions of
the resulting boxes, and to adjust the glue if one of those
dimensions is pre-specified.
- *h*: specifies a height
- *m*: is either 'exactly' or 'additional'.
- *l*: a maximum height
Thus, ``vpack(h, 'exactly')`` produces a box whose height is
exactly *h*, while ``vpack(h, 'additional')`` yields a box
whose height is the natural height plus *h*. The default
values produce a box with the natural width.
grAr<>z1Internal mathtext error: Char node found in Vlistr<74>rNrRr<>rTr<>)r<>r7r}r5r6rXr<>r4r<>rVr<>r<>r<>r<>r<>r{r<>r<><00> RuntimeErrorr<72>r<>r<>r<>) r7r:rrr9r;r<>r<>r<>rrr<>r0r0r1r<><00>sT

 
  





 


z Vlist.vpackN)r<>r<>)rJrKrLrMr8rX<00>infr<66>r0r0r0r1r<><00>s
r<>c@s eZdZdZdd<03>Zdd<05>ZdS)<07>Rulea<65>
A :class:`Rule` node stands for a solid black rectangle; it has
*width*, *depth*, and *height* fields just as in an
:class:`Hlist`. However, if any of these dimensions is inf, the
actual value will be determined by running the rule up to the
boundary of the innermost enclosing box. This is called a "running
dimension." The width is never running in an :class:`Hlist`; the
height and depth are never running in a :class:`Vlist`.
cCst<00>||||<03>|j|_dS)N)r}r8rr)r7r4r5r6rsr0r0r1r8sz Rule.__init__cCs|j<00>||||||<00>dS)N)rrrF)r7r<>rdr9r:r0r0r1resz Rule.renderN)rJrKrLrMr8rer0r0r0r1r<>s r<>c@seZdZdZddd<04>ZdS)<06>Hrulez8
Convenience class to create a horizontal rule.
NcCsB|dkr|j<00>|j|j|j<04>}|d}}t<05>|tj|||<01>dS)Ng<00>?) rrr<>r_rsr<>r<>r8rXr<>)r7rs<00> thicknessr5r6r0r0r1r8%s
 zHrule.__init__)N)rJrKrLrMr8r0r0r0r1r<>!sr<>c@seZdZdZdd<03>ZdS)<05>Vrulez6
Convenience class to create a vertical rule.
cCs0|j<00>|j|j|j<04>}t<05>||tjtj|<01>dS)N) rrr<>r_rsr<>r<>r8rXr<>)r7rsr<>r0r0r1r81szVrule.__init__N)rJrKrLrMr8r0r0r0r1r<>-sr<>c@s*eZdZdZd
dd<04>Zdd<06>Zdd<08>Zd S) r<>a
Most of the information in this object is stored in the underlying
:class:`GlueSpec` class, which is shared between multiple glue objects.
(This is a memory optimization which probably doesn't matter anymore, but
it's easier to stick to what TeX does.)
FcCsTt<00>|<00>d|_t|t<04>r&t<05>|<01>}nt|t<05>r6|}ntd<02><01>|rJ|<03><08>}||_ dS)N<>normalz.glue_type must be a glue spec name or instance)
rwr8Z glue_subtyper7<00>str<74>GlueSpec<65>factoryr,<00>copyr<79>)r7<00> glue_typer<65>r<>r0r0r1r8>s

 
z Glue.__init__cCs@t<00>|<00>|jtkr<|jjdkr<|j<04><06>|_|jjt9_dS)Ng)rwr{rxr~r<>r4r<>r)r7r0r0r1r{Ks


  z Glue.shrinkcCs6t<00>|<00>|jjdkr2|j<02><04>|_|jjt9_dS)Ng)rwr|r<>r4r<>r<>)r7r0r0r1r|Rs
  z Glue.growN)F)rJrKrLrMr8r{r|r0r0r0r1r<>7s
r<>c@s2eZdZdZd dd<05>Zdd<07>Zdd <09>Zee<06>Zd
S) r<>z
See :class:`Glue`.
<20>rcCs"||_||_||_||_||_dS)N)r4r<>r<>r{r<>)r7r4r<>r<>r{r<>r0r0r1r8]s
zGlueSpec.__init__cCst|j|j|j|j|j<05>S)N)r<>r4r<>r<>r{r<>)r7r0r0r1r<>es z GlueSpec.copycCs
|j|S)N)<01>_types)<02>clsr<73>r0r0r1r<>mszGlueSpec.factoryN)r<>r<>rr<>r)rJrKrLrMr8r<>r<><00> classmethodr0r0r0r1r<>Ys 
r<>grRrSrTg<00><>)<08>fil<69>fill<6C>filll<6C>neg_fil<69>neg_fill<6C> neg_filll<6C>empty<74>ssc@seZdZdd<02>ZdS)<04>FilcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>sz Fil.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>FillcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>sz Fill.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>FilllcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>szFilll.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>NegFilcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>szNegFil.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>NegFillcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>szNegFill.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>NegFilllcCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>szNegFilll.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdd<02>ZdS)<04>SsGluecCst<00>|d<01>dS)Nr<4E>)r<>r8)r7r0r0r1r8<00>szSsGlue.__init__N)rJrKrLr8r0r0r0r1r<><00>sr<>c@seZdZdZdd<03>ZdS)<05> HCenteredzs
A convenience class to create an :class:`Hlist` whose contents are
centered within its enclosing box.
cCs$tj|t<02>g|t<02>gdd<02>dS)NF)r<>)r<>r8r<>)r7r<>r0r0r1r8<00>szHCentered.__init__N)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@seZdZdZdd<03>ZdS)<05> VCenteredzr
A convenience class to create a :class:`Vlist` whose contents are
centered within its enclosing box.
cCs t<00>|t<02>g|t<02>g<00>dS)N)r<>r8r<>)r7r<>r0r0r1r8<00>szVCentered.__init__N)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@s8eZdZdZdZdZdd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Z d S) r<>a<>
A :class:`Kern` node has a width field to specify a (normally
negative) amount of spacing. This spacing correction appears in
horizontal lists between letters like A and V when the font
designer said that it looks better to move them closer together or
further apart. A kern node can also appear in a vertical list,
when its *width* denotes additional spacing in the vertical
direction.
rcCst<00>|<00>||_dS)N)rwr8r4)r7r4r0r0r1r8<00>s
z Kern.__init__cCs
d|jS)Nzk%.02f)r4)r7r0r0r1ry<00>sz Kern.__repr__cCs&t<00>|<00>|jtkr"|jt9_dS)N)rwr{rxr~r4r)r7r0r0r1r{<00>s

z Kern.shrinkcCst<00>|<00>|jt9_dS)N)rwr|r4r<>)r7r0r0r1r|<00>s
z Kern.growN)
rJrKrLrMr5r6r8ryr{r|r0r0r0r1r<><00>s r<>c@seZdZdZdd<03>ZdS)<05>SubSuperClusteraR
:class:`SubSuperCluster` is a sort of hack to get around that fact
that this code do a two-pass parse like TeX. This lets us store
enough information in the hlist itself, namely the nucleus, sub-
and super-script, such that if another script follows that needs
to be attached, it can be reconfigured on the fly.
cCs"d|_d|_d|_t<03>|g<00>dS)N)<05>nucleus<75>subrGr<>r8)r7r0r0r1r8<00>szSubSuperCluster.__init__N)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@seZdZdZddd<05>ZdS)<07>AutoHeightCharaG
:class:`AutoHeightChar` will create a character as close to the
given height and depth as possible. When using a font with
multiple height versions of some characters (such as the BaKoMa
fonts), the correct glyph will be selected, otherwise this will
always just return a scaled version of the glyph.
FNcCs<>|j<00>|j|<01>}|j<00>|j|j|j<05>}|<04><06>}||} x:|D]2\}
} |
|_t| |<04>} | j| j | d|kr<Pq<Wd} |jdkr<>|dkr<>| | j| j }|j|9_t| |<04>} || j } t
<EFBFBD> || g<01>| |_ dS)Ng<4E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?r) rrr<>r_r<>rsr<>r<>r<>r5r6r<>r8r<>)r7rr5r6rs<00>always<79>factorrVr<>Z target_totalr<6C>r<>r9<00>shiftr0r0r1r8<00>s(




zAutoHeightChar.__init__)FN)rJrKrLrMr8r0r0r0r1r<><00>sr<>c@seZdZdZdefdd<04>ZdS)<06> AutoWidthChara:
:class:`AutoWidthChar` will create a character as close to the
given width as possible. When using a font with multiple width
versions of some characters (such as the BaKoMa fonts), the
correct glyph will be selected, otherwise this will always just
return a scaled version of the glyph.
Fc Cs<>|j<00>|j|<01>}|<03><03>}x,|D]$\}}||_|||<03>} | j|krPqW|| j}
|j|
9_|||<03>} t<06>|| g<01>| j|_dS)N)rrr<>r_r<>r4rsr<>r8) r7rr4rsr<><00>
char_classrVr<>r<>r9r<>r0r0r1r8s




zAutoWidthChar.__init__N)rJrKrLrMr<>r8r0r0r0r1r<>
sr<>c@s8eZdZdZdd<03>Zdd<05>Zee<05>Zdd<07>Zdd <09>Zd
S) <0B>Shipa<70>
Once the boxes have been set up, this sends them to output. Since
boxes can be inside of boxes inside of boxes, the main work of
:class:`Ship` is done by two mutually recursive routines,
:meth:`hlist_out` and :meth:`vlist_out`, which traverse the
:class:`Hlist` nodes and :class:`Vlist` nodes inside of horizontal
and vertical boxes. The global variables used in TeX to store
state as it processes have become member variables here.
cCs8d|_d|_d|_d|_||_||j|_|<00>|<03>dS)Nrg)<08>max_push<73>cur_s<5F>cur_v<5F>cur_h<5F>off_hr5<00>off_v<5F> hlist_out)r7r>r?rGr0r0r1<00>__call__/s z Ship.__call__cCs|dkr dS|dkrdS|S)Nge<><65><EFBFBD>ge<><65>Ar0)<01>valuer0r0r1<00>clamp8s
z
Ship.clampcCs^d}d}|j}|j}|j}|j}|jd7_t|j|j<06>|_|j}<08>x|jD<00>]<5D>} t | t
<EFBFBD>r<>| <09> |j|j |j|j <00>|j| j7_qNt | t<0F>r<>|j| j7_qNt | t<10><02>rt| j<08>dkr<>|j| j7_nF|j}
|| j|_t | t<13><02>r<>|<00>| <09>n
|<00>| <09>|
| j|_||_qNt | t<16><02>r<>| j} | j} | j} t<19>| <0B><01>rL|j} t<19>| <0C><01>r^|j} | dk<04>r<>| dk<04>r<>|| |_| <09> |j|j |j|j | | <0B>||_|j| 7_qNt | t<1B>rN| j}|j|} |dk<03>r2|dk<02>r
|j|k<02>r2||j7}t||j |<00><01>}n(|j!|k<02>r2||j"7}t||j |<00><01>}| |7} |j| 7_qNW|jd8_dS)NrgrR)#r<>r<>r<>r<>r<>rVr<>r<>r<>r7r<>rer<>r<>r4r<>r<>r<>r<>r<>r<><00> vlist_outr}r5r6rXr<>r<>r<>r<>r<><00>roundr<64>r<>r{)r7rG<00>cur_g<5F>cur_gluer<65>r<>Z base_line<6E> left_edger<65>rZedge<67> rule_height<68>
rule_depth<EFBFBD>
rule_widthr<EFBFBD>r0r0r1r<>@sl

    
    





 
 
zShip.hlist_outcCsNd}d}|j}|j}|jd7_t|j|j<02>|_|j}|j|j8_|j}|j}<08>x<>|j D<00>]<5D>} t
| t <0B>r<>|j| j 7_q^t
| t <0A><02>rt| j <09>dkr<>|j| j| j7_n\|j| j7_|| j|_|j}
|j | _ t
| t<11>r<>|<00>| <09>n
|<00>| <09>|
| j|_||_q^t
| t<14><02>r<>| j} | j} | j } t<15>| <0A><01>r@|j } | | 7} | dk<04>r8| dk<04>r8|j| 7_| <09>|j|j|j|j| | <0B>q^t
| t<1A><02>r&| j}|j |} |dk<03>r|dk<02>r<>|j|k<02>r||j7}t||j|<00><01>}n(|j |k<02>r||j!7}t||j|<00><01>}| |7} |j| 7_q^t
| t"<22>r^t#d<04><01>q^W|jd8_dS)NrgrRz1Internal mathtext error: Char node found in vlist)$r<>r<>r<>rVr<>r<>r<>r5r<>r<>r7r<>r4r<>r<>r6r<>r<>r<>r<>r}rXr<>rer<>r<>r<>r<>r<>r<>r<>r<>r<>r{r<>r<>)r7rGr<>r<>r<>r<>r<>Ztop_edger<65>rZsave_vr<76>r<>r<>r<>r0r0r1r<>sl
  
 
   

 


 
 


zShip.vlist_outN) rJrKrLrMr<>r<>r<>r<>r<>r0r0r0r1r<>%s   ?r<>cs <00>fdd<02>}t<00>}|<02>|<01>|S)z.
Helper class to raise parser errors.
cst||<01><00><03>dS)N)r)r<00>loc<6F>toks)<01>msgr0r1<00> raise_error<6F>szError.<locals>.raise_error)r<00>setParseAction)r<>r<>r<>r0)r<>r1<00>Error<6F>s 
r<>cs<>eZdZdZeddddd<06>Zed<07><07><00>Zed<08><07><00>Z ed <09><07><00>Z
ee Be
BZ ed
<EFBFBD><07><00>Z ed <0B><07><00>Z ed <0C><07><00>Zed <0A><07><00>Zed<0E><07><00>Zed<0F><07><00>Zed<10><07><00>Zed<11><07><00>Zed<12><07><00>Zdd<14>Zdd<16>ZGdd<18>de<17>Zdd<1A>Zdd<1C>Zdd<1E>Zdd <20>Zd!d"<22>Zd#d$<24>Zd%d&<26>Zd'd(<28>Z d)d)d)d*d*d+d,d,d-ddd.d/<2F> Z!d0d1<64>Z"d2d3<64>Z#d4d5<64>Z$e$Z%d6d7<64>Z&d8d9iZ'd:d;<3B>Z(d<d=d>d?d@dAdBdCdDdCd?d@dAdBd<dEdFdGdH<64>Z)edI<64><07><00>Z*dJdK<64>ee)<29><01>Z+dLdM<64>Z,dNdO<64>Z-dPdQ<64>Z.dRdS<64>Z/dTdU<64>Z0e0Z1Z2dVdW<64>Z3dXdY<64>Z4dZd[<5B>Z5d\d]<5D>Z6d^d_<64>Z7d`da<64>Z8<5A>fdbdc<64>Z9ddde<64>Z:dfdg<64>Z;dhdi<64>Z<djdk<64>Z=e>j?dldmdndo<64>dpdq<64><00>Z@drds<64>ZAdtdu<64>ZBdvdw<64>ZCdxdy<64>ZDdzd{<7B>ZE<5A>ZFS)|<7C>Parsera
This is the pyparsing-based parser for math expressions. It
actually parses full strings *containing* math expressions, in
that raw text may also appear outside of pairs of ``$``.
The grammar is based directly on that in TeX, though it cuts a few
corners.
rrRrSrT)<04> displaystyle<6C> textstyleZ scriptstyleZscriptscriptstylea<65>
+ * -
\pm \sqcap \rhd
\mp \sqcup \unlhd
\times \vee \unrhd
\div \wedge \oplus
\ast \setminus \ominus
\star \wr \otimes
\circ \diamond \oslash
\bullet \bigtriangleup \odot
\cdot \bigtriangledown \bigcirc
\cap \triangleleft \dagger
\cup \triangleright \ddagger
\uplus \lhd \amalga<67>
= < > :
\leq \geq \equiv \models
\prec \succ \sim \perp
\preceq \succeq \simeq \mid
\ll \gg \asymp \parallel
\subset \supset \approx \bowtie
\subseteq \supseteq \cong \Join
\sqsubset \sqsupset \neq \smile
\sqsubseteq \sqsupseteq \doteq \frown
\in \ni \propto \vdash
\dashv \dots \dotplus \doteqdota<74>
\leftarrow \longleftarrow \uparrow
\Leftarrow \Longleftarrow \Uparrow
\rightarrow \longrightarrow \downarrow
\Rightarrow \Longrightarrow \Downarrow
\leftrightarrow \longleftrightarrow \updownarrow
\Leftrightarrow \Longleftrightarrow \Updownarrow
\mapsto \longmapsto \nearrow
\hookleftarrow \hookrightarrow \searrow
\leftharpoonup \rightharpoonup \swarrow
\leftharpoondown \rightharpoondown \nwarrow
\rightleftharpoons \leadstoz, ; . ! \ldotp \cdotpz}
\sum \prod \coprod \bigcap \bigcup \bigsqcup \bigvee
\bigwedge \bigodot \bigotimes \bigoplus \biguplus
zlim liminf limsup sup max minz
\int \ointz6rm cal it tt sf bf default bb frak circled scr regularz<72>
arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim
liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan
coth inf max tanhzr
| \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
\Downarrow \Updownarrow . \vert \Vert \\|z( [ \{ < \lfloor \langle \lceilz) ] \} > \rfloor \rangle \rceilc
Cs<>t<00><01>}t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_ t<02>|_
t<02>|_ t<02>|_ t<02>|_ t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_t<02>|_ t<02>|_!t<02>|_"t<02>|_#t<02>|_$t<02>|_%t<02>|_&t<02>|_'t<02>|_(t<02>|_)t<02>|_*t<02>|_+t<02>|_,t<02>|_-t<02>|_.t<02>|_/t<02>|_0t<02>|_1x0t2|<01><01>3<EFBFBD>D] \}}|<02>4d<01><01>s<>|<03>5|<02><00>q<>W|j t6d<02>K_ |jt6d<03>K_|jt7d<04><01>8<EFBFBD>K_|jt7d<05><01>8<EFBFBD>K_|jt7d<06><01>8<EFBFBD>K_|j t7d<07><01>8<EFBFBD>K_ |jt7d<08>K_|j(t9t:|j;<3B><01>K_(|j
t<t7d <09><01>|j|j |jt=d
<EFBFBD>BK_
d }|j&t6d |<00>K_&|j't<|j<08>t9|j><3E>K_'|j/t?|jt9t:t@<40><01><00>tAt6d <0A><01>B<EFBFBD>tC<74>B<00>K_/|j.|j&|j/B<00>B<EFBFBD>K_.|jt6d<0E>K_|j t<|j<08>t9t:|jD<6A><01>K_ |jtEt<|j<08>t9|jF|jG<6A><02>|j<00>K_|jt<|j<08>t9t:|jH<6A><01>K_|j+tI|j<14>|jK_+|j |j<1F>J<EFBFBD>K_ |j%tE|jtK|j0<6A>|j<00>K_%|j!tE|jtL|j0<6A>|j<00>K_!|jtE|j+tK|j0<6A>|j <00>K_|j t<|j<08>t9t:|jM<6A><01>K_ |jt<|j<08>t9dd<10>|jMD<00><01>K_|jtEt<t7d<11><01>|j!|j!t=d<12>B<00>K_|jtEt<t7d<13><01>|j!|j!t=d<14>B<00>K_|j*tEt<t7d<15><01>|j!|j!t=d<16>B<00>K_*|jtEt<t7d<17><01>|j!|j!t=d<18>B<00>K_|jt9t:|jN<6A><01>K_|jt9t:|jO<6A><01>K_|j"t9t:|jP<6A><01>K_"|j#t9|jPdhd-<2D><02>K_#|jtEt<t7d<1A><01>|jtI|j|jBdd<1C>|j|jtI|j|j#Bdd<1C>|j|j|j |j|j%|j!|j!t=d<1D>B<00>K_|j)tEt<t7d<1E><01>tI|j|j|j dd<1C>|j!t=d<1F>B<00>K_)|jtEt<t7d <20><01>|j!t=d!<21>B<00>K_|j1t?|jt6d"<22><00>K_1|jtEt<t7d#<23><01>|jtK|j$|j1B<00>|jt=d$<24>B<00>K_|j|j'|jB|j.B|j B|jB|jB|jB|jB|j*B|jB|jB|j)B|jB|jBK_|j$|j(|j
B|j B|j,BK_$|j-t9dd%g<02>K_-|j,tEtI|j<1E>tL|j-|j<00>tI|j<05>|jtI|j<05>B|jB<00>K_,|j0|j$|jB|j1BK_0|jt<t7d&<26><01>|j|jBt=d'<27>BtEtK|j$|jB<00><01>t<t7d(<28><01>|j"|jBt=d'<27>BK_|jtL|j0<6A>K_|jtQd)dd*d+<2B>K_|jt6d,<2C><01>B<EFBFBD>K_|j|jtK|j|j<00>tC<74>K_xBt2|<01><01>3<EFBFBD>D]2\}}|<02>4d<01><01>s<>tR||<02><02>r<>|<03>StT||<02><02><00>q<>W|j|_U|j|_VdS).N<>_z[-+]?([0-9]+\.?[0-9]*|\.[0-9]+)z [-+]?[0-9]+r<>r<>r<>r<>r'z\hspacezExpected \hspace{n}u€-🿿z;([a-zA-Z0-9 +\-*/<>=:,.;!\?&'@()\[\]|%s])|(\\[%%${}\[\]_|])z [^A-Za-z]z'+cSsg|] }d|<00>qS)r/r0)r<>r<>r0r0r1r<><00> sz#Parser.__init__.<locals>.<listcomp>z\fraczExpected \frac{num}{den}z\dfraczExpected \dfrac{num}{den}z \stackrelzExpected \stackrel{num}{den}z\binomzExpected \binom{num}{den}<7D>\}z\genfrac<61>)r<>z<Expected \genfrac{ldelim}{rdelim}{rulesize}{style}{num}{den}z\sqrtzExpected \sqrt{value}z \overlinezExpected \overline{value}z [A-Za-z]*z \operatornamezExpected \operatorname{value}rz\leftzExpected a delimiterz\rightr<74>F)<01>unquoteResultsz(?:(?:\\[$])|[^$])*)r<>)Wr<57>r<>r<00>accentZ
ambi_delimZ
apostrophe<EFBFBD>
auto_delim<EFBFBD>binomZbslash<73>c_over_c<5F> customspace<63> end_groupZ float_literalr_<00>frac<61>dfrac<61>function<6F>genfrac<61>groupZ int_literalZ latexfontZlbracketZ
left_delimZlbrace<63>mainr/<00> math_string<6E>non_math<74> operatorname<6D>overlineZ placeable<6C>rbraceZrbracket<65>required_groupZ right_delimZright_delim_safe<66>simple<6C> simple_groupZ single_symbol<6F> snowflake<6B>space<63>sqrt<72>stackrel<65> start_group<75>subsuperZ
subsuperopr.rt<00>token<65>unknown_symbol<6F>varsr<73>r6<00>setNamerr <00>suppressr
<00>list<73> _space_widthsrr<><00>
_snowflakerr#r<00>leaveWhitespacer<00>_char_over_charsr<00> _accent_map<61> _wide_accents<74>_function_namesr r<>rr <00>
_fontnames<EFBFBD> _ambi_delim<69> _left_delim<69> _right_delimr<00>hasattrr<72>r<><00> _expression<6F>_math_expression)r7rr<>r<>Z unicode_ranger0r0r1r8" s. 
 &$$"








b


X@H   zParser.__init__c Cs<>|<00>|dd||<04>g|_i|_y|j<03>|<01>}WnLtk
rx}z.td<03>d|jd|j ddt
|<06>g<04><01><01>Wdd}~XYnXd|_i|_|j<03> <0B>|d S)
z<EFBFBD>
Parse expression *s* using the given *fonts_object* for
output, at the given *fontsize* and *dpi*.
Returns the parse tree of :class:`Node` instances.
r<>r<><00>
r<EFBFBD>r<>rRrNr) <0C>State<74> _state_stack<63>_em_width_cacher%<00> parseStringr r,r_<00>line<6E>columnr<6E><00>
resetCache)r7rZ fonts_objectrsr<>rh<00>errr0r0r1<00>parse
s 
z Parser.parsec@s:eZdZdZdd<03>Zdd<05>Zedd<07><00>Zejdd<07><00>Zd S)
z Parser.Statez<65>
Stores the state of the parser.
States are pushed and popped from a stack as necessary, and
the "current" state is always at the top of the stack.
cCs"||_||_||_||_||_dS)N)rr<00>_fontr<74>rsr<>)r7rrr_r<>rsr<>r0r0r1r8<
s
zParser.State.__init__cCst<00>|j|j|j|j|j<06>S)N)r<>r(rrr_r<>rsr<>)r7r0r0r1r<>C
s zParser.State.copycCs|jS)N)r1)r7r0r0r1r_K
szParser.State.fontcCs2|dkrtjddddd<06>|dkr(||_||_dS)NZcircledz3.1z \mathcircledzmathtext commandzJunicode characters (e.g. '\N{CIRCLED LATIN CAPITAL LETTER A}' or '\u24b6'))r5<00>obj_type<70> alternative)r<>r<>r<>)rZwarn_deprecatedr<64>r1)r7r5r0r0r1r_O
sN) rJrKrLrMr8r<><00>propertyr_<00>setterr0r0r0r1r(5
s
 r(cCs
|jdS)z?
Get the current :class:`State` of the parser.
rT)r))r7r0r0r1<00> get_stateZ
szParser.get_statecCs|j<00><01>dS)z8
Pop a :class:`State` off of the stack.
N)r)<00>pop)r7r0r0r1<00> pop_state`
szParser.pop_statecCs|j<00>|<00><02><00><03><00>dS)zm
Push a new :class:`State` onto the stack which is just a copy
of the current state.
N)r)r}r6r<>)r7r0r0r1<00>
push_statef
szParser.push_statecCs
t|<03>gS)N)r<>)r7rr<>r<>r0r0r1rm
sz Parser.maincCs|j<00>|ddd<03><00>S)NrrRrT)r&r+)r7rr<>r<>r0r0r1rp
szParser.math_stringcCst|<03>}|<00><01>|gS)N)r<>r8)r7rr<>r<><00>hlistr0r0r1r/s
sz Parser.mathcsF|d<00>dd<03>}<01>fdd<05>|D<00>}t|<04>}<05><00><02>td<00><00><04>_|gS)Nrz\$r<>csg|]}t|<01><00><01>dd<01><03>qS)F)r/)r<>r6)r<>r)r7r0r1r<>z
sz#Parser.non_math.<locals>.<listcomp>zmathtext.default)<06>replacer<65>r9rr6r_)r7rr<>r<><00>symbolsr:r0)r7r1rx
s zParser.non_mathcCsf|<00><00>}|j|j|jf}|j<04>|<03>}|dkrZ|j<06>|jtdd|j|j<03>}|j }||j|<t
||<00>S)Nzmathtext.defaultr) r6r_rsr<>r*r<>rrr<>rr<>r<>)r7<00>
percentagersr<>r4rZr0r0r1<00> _make_space<63>
s 
zParser._make_spaceg<65><67><EFBFBD>KqU<71>?g<>0Bx<42>q<EFBFBD>?g<><67><EFBFBD><EFBFBD>%<25><>?g<><67>1ZGU<47>?g<00>?g<><67><EFBFBD>KqUſ) z\,z
\thinspacez\/z\>z\:z\;z\ rz\enspacez\quadz\qquadz\!cCs.t|<03>dkst<01>|j|d}|<00>|<04>}|gS)NrRr)r<><00>AssertionErrorrr>)r7rr<>r<>r~rGr0r0r1r<00>
s
z Parser.spacecCs|<00>t|d<00><01>gS)Nr)r><00>float)r7rr<>r<>r0r0r1r<><00>
szParser.customspacecCs<>|d}yt||<00><01><00>}Wn$tk
r>t||d|<00><03>YnX||jkr<>tdd<04>|d|<02>ddd<05>D<00>d<06>}||jkr<>t|d|<02><00><08><00>dks<>|dks<>||j kr<>|gSt
|<00> d<08>||<00> d<08>gd d
<EFBFBD>gSn<>||j k<06>r<>|d k<02>rBtd d<04>|d|<02>ddd<05>D<00>d<06>}td d<04>||dd<00>D<00>d<06>}|dk<02>rB|dk<02>rB|gS|dk<02>rv||d<00> <0A><00>rv||d<00> <0A><00>rv|gSt
||<00> d<08>gd d
<EFBFBD>gS|gS)NrzUnknown symbol: %scss|]}|dkr|VqdS)r<>Nr0)r<>rr0r0r1<00> <genexpr><3E>
sz Parser.symbol.<locals>.<genexpr>rTr<>r<>g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?T)r<>rcss|]}|dkr|VqdS)r<>Nr0)r<>rr0r0r1rA<00>
scss|]}|dkr|VqdS)r<>Nr0)r<>rr0r0r1rA<00>
srRr<>r)r<>r6r,r<00>_spaced_symbolsrz<00>_binary_operatorsr<73>r%r"r<>r><00>_punctuation_symbols<6C>isdigit)r7rr<>r<>rr9Z prev_charZ next_charr0r0r1r.<00>
s6
&
 


  
& .

z Parser.symbolcCs|d}t||d|<00><03>dS)NrzUnknown symbol: %s)r)r7rr<>r<>rr0r0r1r<00>
szParser.unknown_symbolZAA))r<><00>Ag<00>?)Nz\circg<00>?gcCs|d}|<00><00>}|j<01>|j|j|j<05>}|j<06>|d<02>\}}} |dkrJtd<03><01>|<05> <09>}
|ddk rh|d|
_|
j|d9_t
|d|
<EFBFBD>} |<05> <09>} |ddk r<>|d| _| j|d9_t |d| <0C>} t | j | j <0A>}t| g<01>}|<0F>|d<06>t| g<01>}|<10>|d<06>t|td|| <00>|g<03>S)Nr)NNgzError parsing symbolrSrR<00>exactlyg)r6rrr<>r_rsr<>rr<>rr<>r<>r<>rVr4r<>r<>r<>r<>)r7rr<>r<>r<>rsr<>Z
under_descZ over_descrZ
over_stateZoverZ under_stateZunderr4Z over_centeredZunder_centeredr0r0r1r<><00>
s4 
 

 
  zParser.c_over_cz\circumflexaccentz\combiningbrevez\combiningoverlinez\combininggraveaccentz\combiningacuteaccentz\combiningtildez\combiningdotabovez\combiningdiaeresisz\combiningrightarrowabovez \rightarrowz
\leftarrowz\circ)ZhatZbreve<76>barZgrave<76>acute<74>tilde<64>dotZddotZvecr<63><00>`rrrrZoverrightarrowZ overleftarrow<6F>mathringzwidehat widetilde widebarcs<00>fdd<02>tD<00>S)Ncs&g|]<1E>t<00>fdd<01><08>D<00><01>r<04><00>qS)c3s |]}<01><00>|<01>o|<01>kVqdS)N)r6)r<><00>a)rr0r1rA sz-Parser.<lambda>.<locals>.<listcomp>.<genexpr>)<01>any)r<>)<01>am)rr1r<> sz#Parser.<lambda>.<locals>.<listcomp>)r#)rPr0)rPr1<00><lambda> <00>zParser.<lambda>c
Cs<>t|<03>dkst<01>|<00><02>}|j<03>|j|j|j<07>}t|d<00>dkrFtd<04><01>|d\}}||j krtt
d||j |t d<06>}nt |j ||<04>}|dkr<>|<08><0E>|<08><0E>tt|j d<00>|g<02>} | <09>|j d <09>t| td
|d <00>t|g<01>g<03>S) NrRrrSzError parsing accentr')r<>rMg@rGgg@)r<>r?r6rrr<>r_rsr<>rrr<>r4r<>rr{r<>r<>r<>r<>r<>r<>)
r7rr<>r<>rsr<>r<>r<>Z
accent_boxZcenteredr0r0r1r<> s( 
 z Parser.accentcsF|<00><00>|<00><01><00>d<01>_t<03>fdd<03>|dD<00><01>}|<00><04>|d|_|S)Nr<4E>csg|]}t|<01><00><02>qSr0)r<>)r<>r)rsr0r1r<>6 sz#Parser.function.<locals>.<listcomp>r)r9r6r_r<>r8<00> function_name)r7rr<>r<>r:r0)rsr1r2 s
zParser.functioncCsT|<00><00>|<00><01>}d|_x(|dD]}t|t<04>r d|_|<05><05>q W|<00><06>t|d<00>S)Nr<4E>r)r9r6r_r7r<>r<>r8r<>)r7rr<>r<>rsrr0r0r1r; s
 zParser.operatornamecCs*|<00><00>t|<03>r&|ddd<00>|<00><02>_gS)NrrA)r9r<>r6r_)r7rr<>r<>r0r0r1rG szParser.start_groupcCst|d<00>}|gS)Nr)r<>)r7rr<>r<><00>grpr0r0r1rN s z Parser.groupcCs |<00><00>gS)N)r8)r7rr<>r<>r0r0r1r<>S szParser.end_groupcCs&t|<03>dkst<01>|d}||<00><02>_gS)NrRr)r<>r?r6r_)r7rr<>r<>r5r0r0r1r_W s
z Parser.fontcCs:t|t<01>r|j|jkSt|t<04>r6t|d<01>r6|j|jkSdS)NrSF)r7r<>r<00>_overunder_symbolsr<73>r$rS<00>_overunder_functions)r7r<>r0r0r1<00> is_overunder] s

  zParser.is_overundercCst|t<01>r|j|jkSdS)NF)r7r<>r<00>_dropsub_symbols)r7r<>r0r0r1<00>
is_dropsubd s
 zParser.is_dropsubcCst|t<01>r|<01><02>SdS)NF)r7r<>r<>)r7r<>r0r0r1r<>i s
zParser.is_slantedcCsdS)NFr0)r7rr<>r0r0r1<00>is_between_bracketsn szParser.is_between_bracketsc%s<>t|<03>dkst<01>d}d}d}d}g}xX|dD]L} t| t<03>rR| dkrR|t| <09>7}q.t| t<04>rp| jdkrp|d7}q.|<08>| <09>q.W|}t|<03>dkr<>|s<>t<01>td<05>}<04>n<>t|<03>dkr<>|s<>|dS|d}n<>t|<03>dk<06>rt|<03>dkr<>|dntd<05>}|dd<00>\}
} |
d k<02>r| }n| }n<>t|<03>d
k<06>r<>t|<03>d k<02>r8|dntd<05>}|d d<00>\} } }}| |k<02>rz| d k<02>rrtd <0A><01>ntd<0E><01>| d k<02>r<>| }|}n| }|}ntd<0F><01>|<00> <09>}|j
<EFBFBD> |j |j |j<0E>}|j
<EFBFBD>|j |j |j<0E>}|<07>r(|dk<08>r<>tg<00>}x*t|<07>D]}|j<12>|<00>||dg<01><03><00>q<>W|<06><15>|<06><16>|<00>|<04><01>r4g}d}|j}|dk <09>r`|<06><19>t||j<18>}|dk <09>r~|<05><19>t||j<18>}|dk <09>r<>t|g<01>}|<17>|d<11>|<14>|t|d<00>g<02>t|g<01>}|<17>|d<11>|<14>|<17>|dk <09>rt|g<01>}|<17>|d<11>|<14>t|d<00>|g<02>|j}t|<14>}||j|_ t|g<01>}|gS|}t|t<10><02>r<>|j}t|<1A><01>r<>t|dt<1C><02>r<>t!|dd<14><02>r<>|dd<13>}|d}t!|d<14><02>r<>|j"j#|_t|dd<16>}n t|t<04><02>r<>|j"j#|_t|g<01>}t$|<10>}|j}d}|<00>%|<19><01>r<>|j}|j&|}|j&|}|<00>'|<19><01>rr||j&|7}||j(||dd7}|<00>%|<19><01>rnd|j&|j)|}d|j&|j)|}nd}|dk<08>r<>tt|<1F>|g<02>} | <20><19>|<00>%|<19><01>r<>||j*|}!n
|j+|}!|!| _ n<>tt|<1E>|g<02>} | <20><19>|<00>%|<19><01>r<>||j*|}"n
|j,|}"|dk<08>r|" | _ n<>tt|<1F>|g<02>}#|#<23><19>|<00>%|<19><01>rH||j*|}!n
|j-|}!d||"| j|#j|!}$|$dk<04>r<>|"|$7}"t| t|"| j|#j|!<00>|#g<03>} |!| _ |<00>%|<19><01>s<>| j|j.|7_t|| g<02>}|gS)NrRr)rr<>rg)rSrTrT<00><><EFBFBD><EFBFBD><EFBFBD>r<EFBFBD>)rArBrB<00><><EFBFBD><EFBFBD><EFBFBD>zDouble subscriptzDouble superscriptzOSubscript/superscript sequence is too long. Use braces { } to remove ambiguity.z\primerGg@rTr<>F)r<>g@)/r<>r?r7r<>r<>rr}r<>rr6rrr<>r_rsr<>r<>r<>rRr<><00>extendr.r<>r<>rWr4r{rVr<>r<>r5r<>r6r<>r$r<>r<>rurYrir<>rjrkrergrfrhrd)%r7rr<>r<>r<>r<>rGZ napostrophesZnew_toks<6B>tok<6F>oprz<00>op1Znext1<74>op2Znext2rsZrule_thicknessr<73>r<><00>vlistr<74>r4r:rh<00> last_charr<72>rtZ lc_heightZ lc_baselineZ superkernZsubkernr<6E>Z
shift_downZshift_uprdZclr)rHr0r1rq s
   






 
 
 

 
 


  
  
  
 

 

   
 
 


 

  zParser.subsupercCs<|<00><00>}|j<01>|j|j|j<05>}t|<03>}||jdkrD|<05><08>|<06><08>t |g<01>} t |g<01>}
t
|j |j <0B>} | <09> | d<02>|
<EFBFBD> | d<02>t | td|d<00>t||<03>td|d<00>|
g<05>} |j<01>|jtdd|j|j<05>} |
j| j| jd|d}|| _t| t|d<00>g<02>g}|<01>s|<02>r8|d k<02>rd
}|d k<02>r*d
}|<00>|||<02>S|S) Nr<4E>rGrg@zmathtext.default<6C>=rSg@r<>r)r6rrr<>r_rsr<>r@<00>_math_style_dictr{r<>rVr4r<>r<>r<>r<>r<>rr5r\r^r<>r<>r<><00>_auto_sized_delimiter)r7ZldelimZrdelimZrule<6C>styler~<00>denrsr<>ZcnumZcdenr4rbrZr<>rhr0r0r1<00>_genfrac/ s@

    
  

zParser._genfraccCs6t|<03>dkst<01>t|d<00>dks$t<01>|jt|d<00><01>S)NrRrrS)r<>r?ri<00>tuple)r7rr<>r<>r0r0r1rY szParser.genfraccCsht|<03>dkst<01>t|d<00>dks$t<01>|<00><02>}|j<03>|j|j|j<07>}|d\}}|<00>dd||j d||<07>S)NrRrrSr<>r<>)
r<EFBFBD>r?r6rrr<>r_rsr<>rire)r7rr<>r<>rsr<>r~rhr0r0r1r<>_ s 
z Parser.fraccCsht|<03>dkst<01>t|d<00>dks$t<01>|<00><02>}|j<03>|j|j|j<07>}|d\}}|<00>dd||j d||<07>S)NrRrrSr<>r<>)
r<EFBFBD>r?r6rrr<>r_rsr<>rire)r7rr<>r<>rsr<>r~rhr0r0r1rk s 
z Parser.dfracz3.1zmathtext commandz\genfrac)r2r3cCsJt|<03>dkst<01>t|d<00>dks$t<01>|d\}}|<00>ddd|jd||<05>S)NrRrrSr<>gr<>)r<>r?rire)r7rr<>r<>r~rhr0r0r1rw s
 
zParser.stackrelcCsJt|<03>dkst<01>t|d<00>dks$t<01>|d\}}|<00>ddd|jd||<05>S)NrRrrSr<>r<>gr<>)r<>r?rire)r7rr<>r<>r~rhr0r0r1r<><00> s
 
z Parser.binomcsD|d\}}|<00><00><00><00>j<01><02>j<03>j<04>j<05>}|j|j|d}|j|j}t d||<08>dd<05>} | j| j}| j| j}t
t |d<00>|t |d<00>g<03>}
t t <0A><00>t<0E>|
g<03>} | <0B>|<07>j<04>jdd|<08>|dkr<>t| jd d
d
<EFBFBD>}n&t
<EFBFBD>fd d <0C>|D<00><01>}|<04><12>|<04><12>t t
|g<01>g<01>} | d | _t
| t| j d <00>| | g<04>} | gS)Nrg@z \__sqrt__T)r<>g@g<00><>@rGg<00>?gcsg|]}t|<01><00><02>qSr0)r<>)r<>r<>)rsr0r1r<><00> szParser.sqrt.<locals>.<listcomp>g333333<33>?)r6rrr<>r_rsr<>r5r<>r6r<>r<>r<>r<>r<>r<>r<>r}r4r{r<>)r7rr<>r<><00>root<6F>bodyr<79>r5r6<00>checkZ padded_body<64> rightsideZ
root_vlistr:r0)rsr1r<00> s:      z Parser.sqrtc Cs<>t|<03>dkst<01>t|d<00>dks$t<01>|dd}|<00><02>}|j<03>|j|j|j<07>}|j|j |d}|j
|j }t t |<05>t <0A>t|g<01>g<03>} | <09>||j|jdd|<08>t| g<01>}
|
gS)NrRrg@g<00><>@rG)r<>r?r6rrr<>r_rsr<>r5r<>r6r<>r<>r<>r<>r<>) r7rr<>r<>rlrsr<>r5r6rnr:r0r0r1r<00> s  
zParser.overlinec
Cs<>|<00><00>}t|<02>r:tdd<02>|D<00><01>}tdd<02>|D<00><01>}d}n d}d}d}g}|dkrj|<08>t|||||d<07><05>|<08>|<02>|dkr<>|<08>t|||||d<07><05>t|<08>} | S)Ncss|] }|jVqdS)N)r5)r<>r<>r0r0r1rA<00> sz/Parser._auto_sized_delimiter.<locals>.<genexpr>css|] }|jVqdS)N)r6)r<>r<>r0r0r1rA<00> srg<00>?r)r<>)r6r<>rVr}r<>r]r<>)
r7<00>front<6E>middle<6C>backrsr5r6r<><00>partsr:r0r0r1rf<00> s$
zParser._auto_sized_delimitercCs|\}}}|<00>||<05><01>|<06>S)N)rf<00>asList)r7rr<>r<>rorprqr0r0r1r<><00> s
zParser.auto_delim)GrJrKrLrMrNrer<>r%rCZ_relation_symbolsZ_arrow_symbolsrBrDrUrVrXr rr!r"r#r8r0<00>objectr(r6r8r9rrr/rr>rrr<>r.r rrr<>rrrr<>rrrrr
r r<>r_rWrYr<>rZrrirr<>rr<00>
deprecatedrr<>rrrfr<>rIr0r0)rHr1r<><00>s<>



  

 


  z%  '& 
   ?*   ,r<>c @s|eZdZdZeeeeee e
ed<02>Z e e eeeed<03>Zdd<05>Ze<14>d<06>ddd <09><01>Zdd d <0A>Zddd<10>Zddd<12>Zddd<14>ZdS)<1A>MathTextParserN)<08>bitmapZaggrwZpdf<64>svgr<67>Zcairo<72>macosx)<06>cmZ dejavuserifZ
dejavusansZstixZstixsansZcustomcCs|<01><00>|_dS)zI
Create a MathTextParser for the given backend *output*.
N)r<><00>_output)r7<00>outputr0r0r1r8 szMathTextParser.__init__<5F>2<00>Hc
Cs<>|dkrt<00>}|jdkr*tdr*t|<03>}n>|j|j<00>}td<00><05>}tj|j|d<05>|j|}|||<05>}|<03> <09>}|j
dkr<>t <0B>|j _
|j
<EFBFBD> ||||<02>} |<04>| j| j| j<11>|<04>| <09>S)a<>
Parse the given math expression *s* at the given *dpi*. If
*prop* is provided, it is a
:class:`~matplotlib.font_manager.FontProperties` object
specifying the "default" font to use in the math expression,
used for all non-math text.
The results are cached, so multiple calls to :meth:`parse`
with the same expression should be fast.
Nrwz ps.useafmzmathtext.fontset)<01>fontset)rr{rrW<00>_backend_mappingr<67>rZ_check_in_list<73>_font_type_mappingZget_size_in_points<74>_parserr<72>rHr0r<r4r5r6rH)
r7rr<>r*rr<00>backendrZ fontset_classrsrGr0r0r1r0 s 
 



zMathTextParser.parse<73>x<00>cCs<|jdkst<01>t|d<02>}|j|||d<03>\}}|<05><04>}||fS)a<>
Parameters
----------
texstr : str
A valid mathtext string, e.g., r'IQ: $\sigma_i=15$'.
dpi : float
The dots-per-inch setting used to render the text.
fontsize : int
The font size in points
Returns
-------
array : 2D uint8 alpha
Mask array of rasterized tex.
depth : int
Offset of the baseline from the bottom of the image, in pixels.
rw)rx)r<>r*)r{r?rr0Zas_array)r7<00>texstrr<72>rsr*<00>ftimager6r<>r0r0r1<00>to_mask/ s

zMathTextParser.to_mask<73>blackc Cs<>|j|||d<01>\}}t<01>|<02>\}}} }
tj|jd|jddftjd<05>} d|| dd<07>dd<07>df<d|| dd<07>dd<07>df<d| | dd<07>dd<07>df<|| dd<07>dd<07>d f<| |fS)
a0
Parameters
----------
texstr : str
A valid mathtext string, e.g., r'IQ: $\sigma_i=15$'.
color : color
The text color.
dpi : float
The dots-per-inch setting used to render the text.
fontsize : int
The font size in points.
Returns
-------
array : (M, N, 4) array
RGBA color values of rasterized tex, colorized with *color*.
depth : int
Offset of the baseline from the bottom of the image, in pixels.
)r<>rsrrRrA)Zdtype<70><65>NrSrT)r<><00>mcolors<72>to_rgbarX<00>zeros<6F>shapeZuint8) r7r<><00>colorr<72>rsr<>r6rr!rrNZRGBAr0r0r1r<>H s"zMathTextParser.to_rgbac Cs2ddlm}|j||||d<03>\}}|<06>||<01>|S)a7
Render a tex expression to a PNG file.
Parameters
----------
filename
A writable filename or fileobject.
texstr : str
A valid mathtext string, e.g., r'IQ: $\sigma_i=15$'.
color : color
The text color.
dpi : float
The dots-per-inch setting used to render the text.
fontsize : int
The font size in points.
Returns
-------
depth : int
Offset of the baseline from the bottom of the image, in pixels.
r)<01>_png)r<>r<>rs)<04>
matplotlibr<EFBFBD>r<>Z write_png) r7rr<>r<>r<>rsr<>Zrgbar6r0r0r1<00>to_pngf s
  zMathTextParser.to_pngcCs0|jdkst<01>t|d<02>}|j|||d<03>\}}|S)aY
Parameters
----------
texstr : str
A valid mathtext string, e.g., r'IQ: $\sigma_i=15$'.
dpi : float
The dots-per-inch setting used to render the text.
Returns
-------
depth : int
Offset of the baseline from the bottom of the image, in pixels.
rw)rx)r<>r*)r{r?rr0)r7r<>r<>rsr*r<>r6r0r0r1<00> get_depth<74> s
zMathTextParser.get_depth)r~N)r<>r<>)r<>r<>r<>)r<>r<>r<>)r<>r<>)rJrKrLr<>rkrNrmrxr<>r<>r<>r<>r<>rCrJr<>rDr(r<>r8<00> functools<6C> lru_cacher0r<>r<>r<>r<>r0r0r0r1rv<00> s, #


rvc Cs<>ddlm}ddlm}|dkr&t<04>}td<05>}|j|d|d<07>\}} }
} } |j|d| dfd <09>} | jd|
| ||d
<EFBFBD>|<06> | <0C>| j
|||d <0B>|
S) a<>
Given a math expression, renders it in a closely-clipped bounding
box to an image file.
*s*
A math expression. The math portion should be enclosed in
dollar signs.
*filename_or_obj*
A filepath or writable file-like object to write the image data
to.
*prop*
If provided, a FontProperties() object describing the size and
style of the text.
*dpi*
Override the output dpi, otherwise use the default associated
with the output format.
*format*
The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not
provided, will be deduced from the filename.
r)<01>figure)riNr<4E>r~)r<>r*gR@)Zfigsize)Zfontproperties)r<>r-) r<>r<>rjrirrvr0ZFigure<72>textZFigureCanvasAggZsavefig) rZfilename_or_objr*r<>r-r<>ri<00>parserr4r5r6r<>Zfigr0r0r1<00> math_to_image<67> s  
r<>)T)NNN)<29>rM<00> collectionsrr<><00>ior<00>loggingr<67>r<>r3ZnumpyrX<00> pyparsingrrrrrr r
r r r rrrrrrr<00> enablePackratr<74>rrr<>rrZmatplotlib.afmrZmatplotlib.cbookrZmatplotlib.ft2fontrrrZmatplotlib.font_managerrrr Zmatplotlib._mathtext_datar!r"r#r$r%<00> getLoggerrJr1r2rur<>Z unichr_safertr3rNrkrmrxr<>r<>r<>r<>r<>r<>r(r;rCrJr<>rDrWrr<>r~rcrlrmrnrorprqru<00>Warningrvrwr}r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rfr<>r<>rvr<>r0r0r0r1<00><module>s<>  L  

"7K-"kpm+w1$   P>qL 
"
 & ()