
*2Qc           @   s  d  d l  Z  d e f d     YZ d  d l Z d  d l  Z  d e f d     YZ d e f d     YZ d e f d	     YZ d
 e f d     YZ d e f d     YZ	 d e f d     YZ
 d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d  e f d!     YZ d" e f d#     YZ d$ e f d%     YZ d& e f d'     YZ d  d l Z d( e f d)     YZ d* e f d+     YZ d, e f d-     YZ d. e f d/     YZ d0 e f d1     YZ d2 e f d3     YZ d4 e f d5     YZ d6 e f d7     YZ d8 e f d9     YZ  d: e f d;     YZ! d< e f d=     YZ" d> e" f d?     YZ# d@ e" f dA     YZ$ dB e" f dC     YZ% dD e% f dE     YZ& dF e% f dG     YZ' dH e" f dI     YZ( d  d l  Z  d  d l) Z) dJ e f dK     YZ* dL e f dM     YZ+ dN e f dO     YZ, dP e f dQ     YZ- dR e f dS     YZ. dT e, f dU     YZ/ dV e/ f dW     YZ0 dX e/ f dY     YZ1 dZ e f d[     YZ2 d\ e2 f d]     YZ3 d^ e3 f d_     YZ4 d` e2 f da     YZ5 db e5 f dc     YZ6 dd e2 f de     YZ7 df e f dg     YZ8 dh e f di     YZ9 dj e9 f dk     YZ: dl e2 f dm     YZ; dn e; f do     YZ< dp e6 f dq     YZ= dr e; f ds     YZ> dt e; f du     YZ? dv e; f dw     YZ@ dx e; f dy     YZA dz e; f d{     YZB d| e; f d}     YZC d~ eC f d     YZD d e f d     YZE d e f d     YZF d e2 f d     YZG d e; f d     YZH d e f d     YZI d  d lJ ZJ d  d lK ZK d e f d     YZL eL   eL _M d e f d     YZN d eN f d     YZO d e f d     YZP d eP f d     YZQ eQ   eP _R eP   eP _S d e f d     YZT d e2 f d     YZU d e2 f d     YZV d e7 f d     YZW d e7 f d     YZX d e7 f d     YZY d e7 f d     YZZ d e7 f d     YZ[ d e7 f d     YZ\ d e7 f d     YZ] d e7 f d     YZ^ d e7 f d     YZ_ d e3 f d     YZ` d e3 f d     YZa d e2 f d     YZb d e2 f d     YZc d e2 f d     YZd d e2 f d     YZe d ee f d     YZf d e2 f d     YZg d e7 f d     YZh d e3 f d     YZi d e2 f d     YZj d ej f d     YZk d ek f d     YZl d e" f d     YZm d e f d     YZn d e f d     YZo d ej f d     YZp d ej f d     YZq d e; f d     YZr d er f d     YZs d es f d     YZt d es f d     YZu d et f d     YZv d es f d     YZw d es f d     YZx d es f d     YZy d es f d     YZz d ew f d     YZ{ eI j| er ex g 7_| ev et ew e{ ez ey eu g er _| d e f d     YZ} d e} f d     YZ~ d es f d     YZ d er f d     YZ d er f d     YZ d es f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d es f d     YZ er j| e g 7_| d ew f d     YZ d ew f d     YZ d et f d     YZ d e f d    YZ deE f d    YZ dew f d    YZ deE f d    YZ er j| e e e e g 7_| eF j e   e   g 7_ de f d	    YZ d
es f d    YZ de f d    YZ de f d    YZ er j| e g 7_| de f d    YZ de f d    YZ de f d    YZ des f d    YZ de; f d    YZ des f d    YZ deG f d    YZ eI j| e g 7_| er j| e g 7_| d  Z d  Z e d k re   n  d S(!  iNt   Tracec           B   s   e  Z d  Z e Z e Z e Z d Z d   Z	 d   Z
 d   Z d   Z d   Z e e	  Z	 e e
  Z
 e e  Z e e  Z e e  Z RS(   s   A tracing classc         C   s.   t  j s t  j r d St  j | t j  d S(   s   Show a debug messageN(   R    t	   debugmodet	   quietmodet   showt   syst   stdout(   t   clst   message(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   debug%   s    c         C   sF   t  j r d St  j r/ t  j r/ t  j | } n  t  j | t j  d S(   s   Show a trace messageN(   R    R   t   prefixt   showlinesmodeR   R   R   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   +   s
    	c         C   sC   d | } t  j r, t  j r, t  j | } n  t  j | t j  d S(   s   Show an error messages   * N(   R    R	   R
   R   R   t   stderr(   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   error3   s    
c         C   s   t  j d |  t d  d S(   s#   Show an error message and terminates   FATAL: iN(   R    R   t   exit(   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   fatal:   s    c         C   s6   t  j d k  r! | j d  } n  | j | d  d S(   s   Show a message out of a channeli   i    s   utf-8s   
N(   i   i    (   R   t   version_infot   encodet   write(   R   R   t   channel(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   ?   s    N(   t   __name__t
   __module__t   __doc__t   FalseR   R   R
   t   NoneR	   R   R   R   R   R   t   classmethod(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR       s   					t   BibStylesConfigc           B   sk  e  Z d  Z i d d 6d d 6d d 6Z i d d 6d d 6d	 d 6Z i d
 d 6d d 6d d 6d d 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d 6d d 6Z i d" d# 6d$ d% 6d$ d& 6Z i d' d 6d( d 6d! d 6d) d 6Z i d* d 6d+ d 6d, d 6d- d 6d! d 6d. d 6Z	 i d/ d 6d0 d 6d! d 6d1 d 6Z
 RS(2   s+   Configuration class from elyxer.config fileuy   $authors. $title. <i>$journal</i>,{ {$volume:}$pages,} $month $year.{ doi: $doi.}{ URL <a href="$url">$url</a>.}{ $note.}u   @articleu   $surname($year)u   citeuS   $authors. <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}u   defaultu   $authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{: $pages}{, $year}.}{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}u   $Sur$YYut   $authors. $title.{ <i>$journal</i>,} $year.{ <a href="$url">$url</a>.}{ <a href="$filename">$filename</a>.}{ $note.}ur   $authors. $year. $title. <i>$journal</i>, <b>$volume</b>($number), $pages.{ URL <a href="$url">$url</a>.}{ $note.}uS   $authors. $year. <i>$title</i>. $publisher.{ URL <a href="$url">$url</a>.}{ $note.}u   @booku   $surname, $yearue   $authors: “$title”, <i>$journal</i>,{ pp. $pages,} $year.{ URL <a href="$url">$url</a>.}{ $note.}uj   {$authors: }<i>$title</i>{ ($editor, ed.)}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}uW   $authors: <i>$title</i>.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}u   @bookletu   @conferenceu   @inbooku   $authors: <i>$title</i>{ in <i>$booktitle</i>{ ($editor, ed.)}}.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}u   @incollectionu   @inproceedingsu   @manualu   @mastersthesisuh   $authors: <i>$title</i>.{{ $publisher,}{ $howpublished,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}u   @miscu
   @phdthesisu   @proceedingsuG   $authors: <i>$title</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}u   @techreportuW   $authors: “$title”, <i>$journal</i>, $year.{ URL <a href="$url">$url</a>.}{ $note.}u   @unpublishedu   $indexu   ??u   YYu    u   authorsu   surnameu~   $authors, “$title”, <i>$journal</i>, vol. $volume, no. $number, pp. $pages, $year.{ URL <a href="$url">$url</a>.}{ $note.}uS   $authors, <i>$title</i>. $publisher, $year.{ URL <a href="$url">$url</a>.}{ $note.}uF   $authors, “$title”. $year.{ URL <a href="$url">$url</a>.}{ $note.}uv   $authors. $title.{ <i>$journal</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}u\   $authors. <i>$title</i>. $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}u~   $authors. $title.{ In <i>$booktitle</i> {($editor, ed.)}.} $publisher,{ $month} $year.{ URL <a href="$url">$url</a>.}{ $note.}uy   $authors. $title. { <i>$booktitle</i>{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL <a href="$url">$url</a>.}{ $note.}uR   {$authors. }$title.{{ $publisher,} $year.}{ URL <a href="$url">$url</a>.}{ $note.}uy   $authors. $title. <i>$journal</i>, $year{;{<b>$volume</b>}{($number)}{:$pages}}.{ URL: <a href="$url">$url</a>.}{ $note.}uO   $authors. $title. {$publisher, }$year.{ URL: <a href="$url">$url</a>.}{ $note.}u`   $authors. $title; {$publisher, }$year.{ $howpublished.}{ URL: <a href="$url">$url</a>.}{ $note.}(   R   R   R   t   abbrvnatt   alphat   authordate2t   defaultt   defaulttagst   ieeetrt   plaint	   vancouver(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   R   sd   





t   BibTeXConfigc           B   s"   e  Z d  Z i d d 6d d 6Z RS(   s+   Configuration class from elyxer.config fileu   —u   --u   .u   ..(   R   R   R   t   replaced(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR"      s   t   ContainerConfigc           B   s  e  Z d  Z i d d 6d d 6d d 6d d 6d	 d
 6d	 d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d# d$ 6Z i d% d& d' g d( 6d) g d* 6d+ d, d d- d" d d$ d d d d. d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< d= d> g d? 6Z i d@ dA 6d dB 6d dC 6Z i~ d% d) 6dD dE 6dD dF 6d dG 6dH dI 6d dJ 6d dK 6d d 6dD dL 6dD dM 6dD dN 6dO dA 6dD dP 6d dQ 6dR dS 6dT dU 6dV dW 6d- dX 6dY dZ 6d[ d\ 6d] d^ 6d_ d` 6da db 6dc dd 6de df 6dg dh 6di dj 6dk dl 6dm dn 6do dp 6dq dr 6ds dt 6du dv 6dw dx 6dw dy 6dz d{ 6d| d} 6d~ d 6d d 6d/ d 6d d 6d d 6d d 6d d 6dY d 6d[ d 6d] d 6d] d 6d] d 6d] d 6d_ d 6d d 6de d 6dk d 6dm d 6dc d 6di d 6dm d 6do d 6d_ d 6dm d 6dw d 6d d 6d d 6d d 6dR d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d dC 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d+ d 6d d 6d d 6d d 6d
 d 6d d 6dD d	 6d d 6dD d 6dD d 6dD d 6dD d 6d d 6d d 6d d 6d" d! 6dD d 6dD d 6d d 6dD d 6d. d 6d d 6d d 6d d 6d d 6d d 6dD d 6dD d 6dD d 6d$ d 6dD d 6d d 6dD d 6dD d 6d d 6dD d 6dD d 6d d 6dD d 6d d 6dD d 6d  d 6Z i d d 6Z i d d g d 6Z RS(   s+   Configuration class from elyxer.config fileu   \end_layoutu   Alignu   \baru
   BarredTextu   \seriesu   BoldTextu   </cellu   Cellu   \change_unchangedu   ChangeDeletedu   ChangeInsertedu   \coloru	   ColorTextu   \emphu   EmphaticTextu   \hfillu   Hfillu
   \end_insetu   Insetu   Layoutu   \end_documentu	   LyXFooteru   \end_headeru	   LyXHeaderu   </rowu   Rowu   \shapeu
   ShapedTextu   \sizeu   SizeTextu
   \strikeoutu	   StrikeOutu   \familyu
   TextFamilyu   \nounu   VersalitasTextu   StringContaineru   Constantu   FormulaConstantu   allowedu    u   clonedu   PlainLayoutu
   TaggedTextu   Captionu   LangLineu   Formulau   Bracketu   RawTextu   BibTagu   FormulaNumberu   AlphaCommandu   EmptyCommandu   OneParamFunctionu   SymbolFunctionu   TextFunctionu   FontFunctionu   CombiningFunctionu   DecoratingFunctionu   FormulaSymbolu   BracketCommandu   TeXCodeu	   extractedu   \end_deeperu   \begin_deeperu   \begin_insetu   \begin_layoutu   BlackBoxu   #LyXu   </lyxtabularu   <cellu   Columnu   <columnu   <rowu   \alignu   \bar defaultu   \bar nou   \begin_bodyu
   DeeperListu   \begin_documentu   \begin_headeru
   ShortTitleu   \begin_inset Argumentu   BoxInsetu   \begin_inset Boxu   Branchu   \begin_inset Branchu   \begin_inset Captionu   BiblioEntryu!   \begin_inset CommandInset bibitemu   BibTeXu    \begin_inset CommandInset bibtexu   BiblioCitationu"   \begin_inset CommandInset citationu   URLu   \begin_inset CommandInset hrefu   IncludeInsetu!   \begin_inset CommandInset includeu
   PrintIndexu%   \begin_inset CommandInset index_printu   Labelu   \begin_inset CommandInset labelu	   LineInsetu   \begin_inset CommandInset lineu   PrintNomenclatureu'   \begin_inset CommandInset nomencl_printu   NomenclatureEntryu&   \begin_inset CommandInset nomenclatureu	   Referenceu   \begin_inset CommandInset refu   TableOfContentsu   \begin_inset CommandInset tocu   ERTu   \begin_inset ERTu	   FlexInsetu   \begin_inset Flexu   NewfangledChunkRefu   \begin_inset Flex Chunkrefu   SideNoteu   \begin_inset Flex Marginnoteu   \begin_inset Flex Sidenoteu   FlexURLu   \begin_inset Flex URLu   Floatu   \begin_inset Floatu   ListOfu   \begin_inset FloatListu   Footnoteu   \begin_inset Footu   \begin_inset Formulau   FormulaMacrou   \begin_inset FormulaMacrou   Imageu   \begin_inset Graphicsu   IndexReferenceu   \begin_inset Indexu	   InfoInsetu   \begin_inset Infou!   \begin_inset LatexCommand bibitemu    \begin_inset LatexCommand bibtexu   \begin_inset LatexCommand citeu!   \begin_inset LatexCommand citealtu   \begin_inset LatexCommand citepu   \begin_inset LatexCommand citetu!   \begin_inset LatexCommand htmlurlu   \begin_inset LatexCommand indexu   \begin_inset LatexCommand labelu&   \begin_inset LatexCommand nomenclatureu#   \begin_inset LatexCommand prettyrefu$   \begin_inset LatexCommand printindexu+   \begin_inset LatexCommand printnomenclatureu   \begin_inset LatexCommand refu)   \begin_inset LatexCommand tableofcontentsu   \begin_inset LatexCommand urlu   \begin_inset LatexCommand vrefu   \begin_inset Marginalu   NewlineInsetu   \begin_inset Newlineu   NewPageInsetu   \begin_inset Newpageu   Noteu   \begin_inset Noteu   \begin_inset OptArgu   PhantomTextu   \begin_inset Phantomu   QuoteContaineru   \begin_inset Quotesu   Tableu   \begin_inset Tabularu	   InsetTextu   \begin_inset Textu   VerticalSpaceu   \begin_inset VSpaceu   Wrapu   \begin_inset Wrapu   Listingu   \begin_inset listingsu   Spaceu   \begin_inset spaceu   Abstractu   \begin_layout Abstractu   Authoru   \begin_layout Authoru   Bibliographyu   \begin_layout Bibliographyu   NewfangledChunku   \begin_layout Chunku   Descriptionu   \begin_layout Descriptionu   ListItemu   \begin_layout Enumerateu   \begin_layout Itemizeu   Listu   \begin_layout Listu   LyXCodeu   \begin_layout LyX-Codeu   \begin_layout Plainu   StandardLayoutu   \begin_layout Standardu   Titleu   \begin_layout Titleu   LyXPreambleu   \begin_preambleu   \change_deletedu   \change_insertedu   \color inheritu   \color noneu   \emph defaultu	   \emph offu   \emph onu   \emph toggleu	   \end_bodyu   \family defaultu   \family romanu   \labelwidthstringu   \langu   InsetLengthu   \lengthu	   LyXFormatu
   \lyxformatu   LyXLineu   \lyxlineu   Newlineu   \newlineu   NewPageu   \newpageu	   \noindentu   \noun defaultu	   \noun offu   \noun onu   \paragraph_spacingu   \series boldu   \series defaultu   \series mediumu   \shape defaultu	   \shape upu   \size normalu   StartAppendixu   \start_of_appendixu   \strikeout defaultu   \strikeout onu   \u   startcommandu   <lyxtabularu	   <featuresu   headers(	   R   R   R   t   endingst   extracttextt   startendingst   startst   stringt   table(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR$      s   
[

t   EscapeConfigc           B   s   e  Z d  Z i d d 6d d 6d d 6d d 6d	 d
 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6Z i d d 6d  d! 6d" d# 6Z i d# d$ 6Z i d% d 6d& d' 6d( d) 6Z i d* d) 6Z RS(+   s+   Configuration class from elyxer.config fileu    u   
u    — u    -- u   ’u   'u   —u   ---u   ‘u   `u    u   \InsetSpace \space{}u    u   \InsetSpace \thinspace{}u   \InsetSpace ~u   \SpecialChar \-u   .u   \SpecialChar \@.u   …u   \SpecialChar \ldots{}u    ▷ u   \SpecialChar \menuseparatoru   -u   \SpecialChar \nobreakdash-u   /u   \SpecialChar \slash{}u    \SpecialChar \textcompwordmark{}u   \u
   \backslashu   &amp;u   &u   &lt;u   <u   &gt;u   >u   />u   &nbsp;u   &emsp;u    u   &#8197;u    u    (	   R   R   R   t   charst   commandst   entitiest   htmlt	   iso885915t
   nonunicode(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR+   "  s$   &
t   FormulaConfigc           B   s  e  Z d  Z i= d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d# d$ 6d# d% 6d& d' 6d( d) 6d( d* 6d+ d, 6d- d. 6d/ d0 6d1 d2 6d3 d4 6d5 d6 6d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6dC dD 6dE dF 6dG dH 6dI dJ 6dK dL 6dM dN 6dO dP 6dQ dR 6dS dT 6dU dV 6dW dX 6dY dZ 6d[ d\ 6d] d^ 6d_ d` 6da db 6dc dd 6de df 6dg dh 6di dj 6d; dk 6dl dm 6dn do 6dp dq 6dr ds 6dt du 6dv dw 6Z i dx dy 6dz d{ 6d| d} 6d~ d 6Z i d d d g d 6d d d g d 6d d d g d 6d d d g d 6d d d d g d 6d g d 6d d d d g d 6d g d 6Z i d d g d 6d d g d 6Z i d d 6d d 6d d 6d d 6d d 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6Z id d 6d d 6d d 6d d 6d d 6dz d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d6dd6dd6dd6dS d6d	d
6dd6dd6dd6dU d6dd6dd6dd6dd6dd6dd6dd6d d!6dW d"6d#d$6dY d%6d[ d&6d'd(6d] d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d_ d66d7d86d9d:6d;d<6da d=6d>d?6d@dA6dc dB6dCdD6d dE6dFdG6dHdI6de dJ6dKdL6dMd~ 6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6d`da6dbdc6ddde6dfdg6dhdi6djdk6dldm6dndo6dpdq6drds6dtdu6dvdw6d dx6dydz6d{d|6d}d~6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dvd6dd6dd6dd6dd6dd6dd6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dRd6dd6dd6dd6dd6dd6dd6dyd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d6dd6dd6dd6dd6dd6dd6dd6d d6dd6dd6dd6dd	6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06d1d26d/d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dNdZ6d[d\6d]d^6d_d`6d# d% 6dadb6dcdd6dedf6d( d* 6dgdh6didj6ddk6dldm6dndo6d dp6d dq6d dr6dsdt6ddu6dvdw6d4dx6dydz6d{d|6d}d~6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d6dMd6dd6dd6dd6d	d
6dd6dd6dd6dd6dd6dd6dd6dd6d d6d d6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06d1d26d3d46d5d66d7d86d9d:6d;d<6d=d>6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6d{dM6ddN6dOdP6dQdR6dSdT6dUdV6dWdX6dYdZ6d}d[6d\d]6dd^6dd_6d d`6dadb6ddc6ddde6dfdg6dhdi6djdk6dldm6dndo6dpdq6drds6drdt6dudv6dwdx6dydz6d{d|6d d}6d~d6dd6d d6d d6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dld6dd6dd6dd6dd6dd6dd6dd 6dd6dd6dd6dd6d	d
6dd6dd6dd6d4d6dd6dd6d d6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6dd+6d!d,6d!d-6d.d/6d0d16d2d36d4d56dd66d7d86d9d:6dd;6d<d=6dd>6dPd?6dd@6dAdB6dCdD6dEdF6ddG6ddH6dIdJ6ddK6dLdM6ddN6ddO6dPdQ6dRdS6dTdU6d dV6d dW6d dX6Z	 i  Z
 i dd 6dd 6ddY6Z i d dZ6d[d\6d d]6d^d_6d d`6Z i dadbg dc6dadddbg de6dbdbg df6Z i: dgdh6didj6dkdl6dmdn6dodp6dqdr6dsdt6dudv6dwdx6dydz6d{d|6d}d~6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dgd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d	d6d.d6dd6dd6d d6dd6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6Z i" dddddg d6dddg d6ddddddg d6dddg d6dddg d6dddddg d6ddddddg d6dddg d6dddg d6dddg d6dddg d6dddg d6ddddddg d6dddg d6dddg d6ddd g d6dddg d6ddddddg d6dd	d
g d6dddg d6dd g d6dddg d6dddg d6dddg d6dddddddg d6dd d!d"d#g d$6dddddg d%6dddg d&6ddd'g d(6dd)d*g d+6d,d-dd.d/g d06ddd1g d26d3d4dg d56ddd6g d76Z i d8d6d8d6d9d6d8d6d8d6d9d%6Z i d:d;6Z i d d<6d d=6d>d?6d@dA6d dB6d dC6Z x  dD] Z dDe e e e <qWi dEdF6dGdH6dGdI6dJdK6dLdM6dLdN6Z i d dO6d d 6d d 6dPdz 6ddQ6dRdS6dTdU6dVdW6dXdY6dZd6d[d\6d]d6d d^6d d6Z i dd_6d`da6dbd 6dcdd6d de6dfdg6ddh6ddi6djdk6dldm6dndo6dpdq6drds6dtdu6dndv6dwdx6dydz6dnd{6Z i d|d}6d~d6dd6dd6dd6d/d6d/d6dd6dd6dd6d4d6dd6dd6dd6d#d6dyd6dd6dvd6dd6dd6dd6dd6dd6dd6dd6Z i	 d d6dd6d dZ6dld6d d6dd\6d d6d d`6dd6Z i dd6ddN6Z i dd6dd6dgd6dd6dd6dd6dd6dd6dd6dd6dd6dd6Z i dddd d d d ddddd d4dg d6Z i dd6Z RS(  s+   Configuration class from elyxer.config fileu   Åu   \AAu   Æu   \AEu#   <span class="versalitas">AmS</span>u   \AmSu   Ðu   \DHu   Łu   \Lu   Øu   \Ou   Œu   \OEu   Þu   \THu   åu   \aau   æu   \aeu   αu   \alphau   βu   \betau   δu   \deltau   ðu   \dhu   ϵu   \epsilonu   ηu   \etau   γu   \gammau   ıu   \iu   \imathu   ιu   \iotau   ȷu   \ju   \jmathu   κu   \kappau   łu   \lu   λu   \lambdau   μu   \muu   νu   \nuu   øu   \ou   œu   \oeu   ωu   \omegau   φu   \phiu   πu   \piu   ψu   \psiu   ρu   \rhou   σu   \sigmau   ßu   \ssu   τu   \tauu   ħu   \textcrhu   þu   \thu   θu   \thetau   υu   \upsilonu   ∆u	   \varDeltau   Γu	   \varGammau   Λu
   \varLambdau   Ωu	   \varOmegau   Φu   \varPhiu   Πu   \varPiu   Ψu   \varPsiu   Σu	   \varSigmau   Θu	   \varThetau   Υu   \varUpsilonu   Ξu   \varXiu   εu   \varepsilonu   ϰu	   \varkappau   \varphiu   ϖu   \varpiu   ϱu   \varrhou   ςu	   \varsigmau   ϑu	   \varthetau   ξu   \xiu   ζu   \zetau   \beginu   beginu   &u   cellseparatoru   \endu   endu   \\u   rowseparatoru   ⎛u   ⎜u   ⎝u   (u   ⎞u   ⎟u   ⎠u   )u   ⎡u   ⎢u   ⎣u   [u   ⎤u   ⎥u   ⎦u   ]u   ⎧u   ⎪u   ⎨u   ⎩u   {u   |u   ⎫u   ⎬u   ⎭u   }u   ∥u   ⎲u   ⎳u   ∑u   ⌠u   ⌡u   ∫u   span class="symbol"u   \leftu   <span class="leftdot"></span>u   \left.u   \middleu   \rightu   <span class="rightdot"></span>u   \right.u   ̈u   \"u   ́u   \'u   ̂u   \^u   ̀u   \`u   \acuteu   ̄u   \baru   ̆u   \breveu   ̧u   \cu   ̌u   \checku   ⃛u   \dddotu   \ddotu   ̇u   \dotu   \graveu   \hatu   ̊u	   \mathringu   ⃖u   \overleftarrowu   ⃗u   \overrightarrowu   \ru   ̩u   \su   ⃝u   \textcircledu   ̥u   \textsubringu   ̃u   \tildeu   \vu   \vecu   \~u    u   \ u    u   \!u   #u   \#u   $u   \$u   %u   \%u   \&u    u   \,u    u   \:u    u   \;u   ⍗u   \APLdownarrowboxu   ⍇u   \APLleftarrowboxu   ⍈u   \APLrightarrowboxu   ⍐u   \APLuparrowboxu   □u   \Boxu   ≎u   \Bumpequ   ●u   \CIRCLEu   ⋒u   \Capu   ☑u   \CheckedBoxu   ○u   \Circleu   ⩴u	   \Coloneqqu   ≙u   \Correspondsu   ⋓u   \Cupu   Δu   \Deltau   ◇u   \Diamondu   ⇓u
   \Downarrowu   €u   \EURu   ⅁u   \Gameu   \Gammau   ℑu   \Imu   ⨝u   \Joinu   ◖u   \LEFTCIRCLEu   ◐u   \LEFTcircleu   \Lambdau   ⇐u
   \Leftarrowu   ⇚u   \Lleftarrowu   ⟸u   \Longleftarrowu   ⟺u   \Longleftrightarrowu   ⟹u   \Longrightarrowu   ↰u   \Lshu   ⇐|u	   \Mapsfromu   |⇒u   \Mapstou   \Omegau   ¶u   \Pu   \Phiu   \Piu   Pru   \Pru   \Psiu   ◗u   \RIGHTCIRCLEu   ◑u   \RIGHTcircleu   ℜu   \Reu   ⇛u   \Rrightarrowu   ↱u   \Rshu   §u   \Su   \Sigmau   ☐u   \Squareu   ⋐u   \Subsetu   ⋑u   \Supsetu   \Thetau   ⇑u   \Uparrowu   ⇕u   \Updownarrowu   \Upsilonu   ⊩u   \Vdashu   \Vertu   ⊪u   \Vvdashu   ☒u   \XBoxu   \Xiu   ⅄u   \Yupu   <br/>u   _u   \_u   ℵu   \alephu   ∐u   \amalgu   ∠u   \angleu   ♒u	   \aquariusu   arccosu   \arccosu   arcsinu   \arcsinu   arctanu   \arctanu   argu   \argu   ♈u   \ariesu   ∗u   \astu   ≍u   \asympu   ∍u   \backepsilonu   ‵u
   \backprimeu   ⋍u
   \backsimequ   \u
   \backslashu   ⊼u	   \barwedgeu   ∵u   \becauseu   ℶu   \bethu   ≬u   \betweenu   ∩u   \bigcapu   \bigcircu   ∪u   \bigcupu   ⊙u   \bigodotu   ⊕u	   \bigoplusu   ⊗u
   \bigotimesu   ⊔u	   \bigsqcupu   ★u   \bigstaru   ▽u   \bigtriangledownu   △u   \bigtriangleupu   ⊎u	   \biguplusu   ∨u   \bigveeu   ∧u	   \bigwedgeu   ⧫u   \blacklozengeu   ☻u   \blacksmileyu   ■u   \blacksquareu   ▲u   \blacktriangleu   ▼u   \blacktriangledownu   ▶u   \blacktrianglerightu   ⊥u   \botu   ⋈u   \bowtieu   ▫u   \boxu   ⊡u   \boxdotu   •u   \bulletu   ≏u   \bumpequ   ♋u   \canceru   \capu   ♑u   \capricornusu   ⋅u   \cdotu   ⋯u   \cdotsu   ∙u
   \centerdotu   ✓u
   \checkmarku   χu   \chiu   \circu   ≗u   \circequ   ®u	   \circledRu   ⊛u   \circledastu   ⊚u   \circledcircu   ⊝u   \circleddashu   ♣u	   \clubsuitu   ≔u	   \coloneqqu   ∁u   \complementu   ≅u   \congu   \coprodu   ©u
   \copyrightu   cosu   \cosu   coshu   \coshu   cotu   \cotu   cothu   \cothu   cscu   \cscu   \cupu   ↶u   \curvearrowleftu   ↷u   \curvearrowrightu   †u   \dagu   \daggeru   ℸu   \dalethu   ⇠u   \dashleftarrowu   ⊣u   \dashvu   ‡u   \ddagu   \ddaggeru   ⋱u   \ddotsu   degu   \degu   detu   \detu   ╲u	   \diagdownu   ╱u   \diagupu   \diamondu   ♦u   \diamondsuitu   dimu   \dimu   ÷u   \divu   ⋇u   \divideontimesu   ∸u   \dotdivu   ≐u   \dotequ   ≑u	   \doteqdotu   ∔u   \dotplusu   …u   \dotsu   ⌆u   \doublebarwedgeu   ↓u
   \downarrowu   ⇊u   \downdownarrowsu   ⇃u   \downharpoonleftu   ⇂u   \downharpoonrightu   ♁u   \earthu   ℓu   \ellu   ∅u	   \emptysetu   ≖u   \eqcircu   ≕u   \eqcolonu   ≂u   \eqsimu   \eurou   ∃u   \existsu   expu   \expu   ≒u   \fallingdotsequ   ♀u   \femaleu   ♭u   \flatu   ∀u   \forallu   ⌢u   \frownu   ☹u   \frownieu   gcdu   \gcdu   ♊u   \geminiu   ≥u   \geq)u   ≧u   \geqqu	   \geqslantu   ←u   \getsu   ≫u   \ggu   ⋙u   \gggu   ℷu   \gimelu   ≩u   \gneqqu   ⋧u   \gnsimu   ⋗u   \gtrdotu   ⋚u
   \gtreqlessu   ⪌u   \gtreqqlessu   ≷u   \gtrlessu   ≳u   \gtrsimu   «u   \guillemotleftu   »u   \guillemotrightu   ℏu   \hbaru   ♥u
   \heartsuitu   <span class="hfill"> </span>u   \hfillu   homu   \homu   ↩u   \hookleftarrowu   ↪u   \hookrightarrowu   \hslashu(   <span class="bigsymbol">∫⋯∫</span>u	   \idotsintu"   <span class="bigsymbol">∭</span>u   \iiintu"   <span class="bigsymbol">∬</span>u   \iintu   infu   \infu   ∞u   \inftyu   ⌐u   \invnegu   ♃u   \jupiteru   keru   \keru   \landu"   <span class="bigsymbol">∱</span>u
   \landupintu   ⟨u   \langleu   \lbraceu   \lbrace)u   \lbracku   ⌈u   \lceilu   \ldotsu   ⇝u   \leadstou   \leftarrow)u   ↢u   \leftarrowtailu   ⇤u   \leftarrowtobaru   ↽u   \leftharpoondownu   ↼u   \leftharpoonupu   ⇇u   \leftleftarrowsu   ⥢u   \leftleftharpoonsu   ☾u	   \leftmoonu   ↔u   \leftrightarrowu   ⇆u   \leftrightarrowsu   ⇋u   \leftrightharpoonsu   ⋋u   \leftthreetimesu   ♌u   \leou   ≤u   \leq)u   ≦u   \leqqu	   \leqslantu   ⋖u   \lessdotu   ⋛u
   \lesseqgtru   ⪋u   \lesseqqgtru   ≶u   \lessgtru   ≲u   \lesssimu   ⌊u   \lflooru   lgu   \lgu   ⊲u   \lhdu   ♎u   \librau   ↯u
   \lightningu   liminfu   \liminfu   limsupu   \limsupu   ≪u   \llu   ⋘u   \lllu   lnu   \lnu   ≨u   \lneqqu   ¬u   \lnotu   ⋦u   \lnsimu   logu   \logu   ⟵u   \longleftarrowu   ⟷u   \longleftrightarrowu   ⟼u   \longmapstou   ⟶u   \longrightarrowu   ↫u   \looparrowleftu   ↬u   \looparrowrightu   \loru   ◊u   \lozengeu   ⋉u   \ltimesu   \lyxlocku   ♂u   \maleu   ✠u   \malteseu   ↤u	   \mapsfromu   ↦u   \mapstou   ^u   \mathcircumflexu   maxu   \maxu   ∡u   \measuredangleu   ☿u   \mercuryu   ℧u   \mhou   ∣u   \midu   minu   \minu   ⊨u   \modelsu   ∓u   \mpu   ⊸u	   \multimapu   ⇍u   \nLeftarrowu   ⇎u   \nLeftrightarrowu   ⇏u   \nRightarrowu   ⊯u   \nVDashu   ∇u   \nablau   ≉u   \napproxu   ♮u   \naturalu   ≇u   \ncongu   ↗u   \nearrowu   \negu   \neg)u   ♆u   \neptuneu   ≢u   \nequivu   \newlineu   ∄u   \nexistsu   ≱u
   \ngeqslantu   ≯u   \ngtru   ≹u	   \ngtrlessu   ∋u   \niu   \ni)u   ↚u   \nleftarrowu   ↮u   \nleftrightarrowu   ≰u
   \nleqslantu   ≮u   \nlessu   ≸u	   \nlessgtru   ∤u   \nmidu	   \nolimitsu	   \nonumberu   \notu   \not<u   ≠u   \not=u   \not>u   ⍀u   \notbackslashu   ∉u   \notinu   ∌u   \notniu   ⌿u	   \notslashu   ∦u
   \nparallelu   ⊀u   \nprecu   ↛u   \nrightarrowu   ≁u   \nsimu   ≄u   \nsimequ   ⊏̸u
   \nsqsubsetu   ⊈u
   \nsubsetequ   ⊁u   \nsuccu   ⋡u   \nsucccurlyequ   ⊅u   \nsupsetu   ⊉u
   \nsupsetequ   ⋪u   \ntriangleleftu   ⋬u   \ntriangleleftequ   ⋫u   \ntrianglerightu   ⋭u   \ntrianglerightequ   ⊭u   \nvDashu   ⊬u   \nvdashu   ↖u   \nwarrowu   \odotu   \officialeurou"   <span class="bigsymbol">∰</span>u   \oiiintu"   <span class="bigsymbol">∯</span>u   \oiintu"   <span class="bigsymbol">∮</span>u   \ointu"   <span class="bigsymbol">∲</span>u   \ointclockwiseu"   <span class="bigsymbol">∳</span>u   \ointctrclockwiseu   ⊖u   \ominusu   \oplusu   ⊘u   \oslashu   \otimesu   \ownsu	   \parallelu   ∂u   \partialu   \perpu   ♓u   \piscesu   ⋔u
   \pitchforku   ♇u   \plutou   ±u   \pmu   ➪u   \pointeru   £u   \poundsu   ≺u   \precu   ≼u   \preccurlyequ   \precequ   ≾u   \precsimu   ′u   \primeu   ∝u   \promptou     u   \qquadu   \quadu   ♩u   \quarternoteu   ⟩u   \rangleu   \rbraceu   \rbrace)u   \rbracku   ⌉u   \rceilu   ⌋u   \rflooru   ⊳u   \rhdu   →u   \rightarrow)u   ↣u   \rightarrowtailu   ⇥u   \rightarrowtobaru   ⇁u   \rightharpoondownu   ⇀u   \rightharpoonupu   \rightharpooondownu   \rightharpooonupu   ⇄u   \rightleftarrowsu   ⇌u   \rightleftharpoonsu   ☽u
   \rightmoonu   ⇉u   \rightrightarrowsu   ⥤u   \rightrightharpoonsu   ⋌u   \rightthreetimesu   ≓u   \risingdotsequ   ⋊u   \rtimesu   ♐u   \sagittariusu   ♄u   \saturnu   ♏u   \scorpiou   ↘u   \searrowu   secu   \secu   ∖u	   \setminusu   ♯u   \sharpu   ≃u   \simequ   sinu   \sinu   sinhu   \sinhu   ∕u   \slashu   ⌣u   \smileu   ☺u   \smileyu   ♠u
   \spadesuitu   ∢u   \sphericalangleu   ⊓u   \sqcapu   \sqcupu   ⊏u	   \sqsubsetu   ⊑u   \sqsubsetequ   ⊐u	   \sqsupsetu   ⊒u   \sqsupsetequ   \squareu   ⋆u   \staru   ⫅u
   \subseteqqu   ⫋u   \subsetneqqu   ≻u   \succu   ≽u   \succcurlyequ   \succequ   ⋩u	   \succnsimu   ≿u   \succsimu   ☼u   \sunu   supu   \supu   ⫆u
   \supseteqqu   ⫌u   \supsetneqqu   √u   \surdu   ↙u   \swarrowu   tanu   \tanu   tanhu   \tanhu   ♉u   \taurusu   \textasciicircumu   ~u   \textasciitildeu   \textbackslashu   ©'u   \textcopyrightu   °u   \textdegreeu   \textellipsisu   —u   \textemdashu   \textendashu	   \texteurou   >u   \textgreateru   <u	   \textlessu   ªu   \textordfeminineu   ºu   \textordmasculineu   “u   \textquotedblleftu   ”u   \textquotedblrightu   ’u   \textquoterightu   \textregisteredu   \textrightarrowu   \textsectionu   ™u   \texttrademarku   ²u   \texttwosuperioru   \textvisiblespaceu   ∴u
   \thereforeu   ⊤u   \topu	   \triangleu   \triangleleftu   ⊴u   \triangleleftequ   ≜u
   \trianglequ   ▷u   \trianglerightu   ⊵u   \trianglerightequ   ↞u   \twoheadleftarrowu   ↠u   \twoheadrightarrowu   ♫u	   \twonotesu   ⊍u   \udotu   \unlhdu   \unrhdu   \unrhlu   ↑u   \uparrowu   ↕u   \updownarrowu   ↿u   \upharpoonleftu   ↾u   \upharpoonrightu   \uplusu   ⇈u   \upuparrowsu   ♅u   \uranusu   \vDashu   ♧u   \varclubsuitu   \vardiamondsuitu   \varheartsuitu   \varnothingu   ♤u   \varspadesuitu   ⊢u   \vdashu   ⋮u   \vdotsu   \veeu   \vee)u   ⊻u   \veebaru   \vertu   ♍u   \virgou   \wedgeu   \wedge)u   ℘u   \wpu   ≀u   \wru   ¥u   \yenu   \{u   \|u   \}u   \widehatu   bracketu   \]u   complexu   endafteru   \end{u	   endbeforeu   squarebracketu   ru   lu   alignu   cu   eqnarrayu   gatheredu   bu   \boldsymbolu   span class="blackboard"u   \mathbbu   𝔸u
   \mathbb{A}u   𝔹u
   \mathbb{B}u   ℂu
   \mathbb{C}u   𝔻u
   \mathbb{D}u   𝔼u
   \mathbb{E}u   𝔽u
   \mathbb{F}u   𝔾u
   \mathbb{G}u   ℍu
   \mathbb{H}u   𝕁u
   \mathbb{J}u   𝕂u
   \mathbb{K}u   𝕃u
   \mathbb{L}u   ℕu
   \mathbb{N}u   𝕆u
   \mathbb{O}u   ℙu
   \mathbb{P}u   ℚu
   \mathbb{Q}u   ℝu
   \mathbb{R}u   𝕊u
   \mathbb{S}u   𝕋u
   \mathbb{T}u   𝕎u
   \mathbb{W}u   ℤu
   \mathbb{Z}u   \mathbfu   span class="scriptfont"u   \mathcalu   ℬu   \mathcal{B}u   ℰu   \mathcal{E}u   ℱu   \mathcal{F}u   ℋu   \mathcal{H}u   ℐu   \mathcal{I}u   ℒu   \mathcal{L}u   ℳu   \mathcal{M}u   ℛu   \mathcal{R}u   span class="fraktur"u	   \mathfraku   ℭu   \mathfrak{C}u   𝔉u   \mathfrak{F}u   ℌu   \mathfrak{H}u   \mathfrak{I}u   \mathfrak{R}u   ℨu   \mathfrak{Z}u   iu   \mathitu   \mathring{A}u   Ůu   \mathring{U}u   \mathring{a}u   ůu   \mathring{u}u   ẘu   \mathring{w}u   ẙu   \mathring{y}u   span class="mathrm"u   \mathrmu   \mathscru   \mathscr{B}u   \mathscr{E}u   \mathscr{F}u   \mathscr{H}u   \mathscr{I}u   \mathscr{L}u   \mathscr{M}u   \mathscr{R}u   span class="mathsf"u   \mathsfu   ttu   \mathttu   {$1}{$2}u   f2{(}f0{f1{$1}f1{$2}}f2{)}u   span class="binom"u   span class="binomstack"u   span class="bigsymbol"u   \binomu   {$1}u   f0{$1}u   span class="boxed"u   \boxedu   [$p!]{$1}{$2}u!   f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}u   span class="fullfraction"u   span class="numerator align-$p"u   span class="denominator"u   span class="ignored"u   \cfracu	   {$p!}{$1}u   span style="color: $p;"u   \coloru-   span class="colorbox" style="background: $p;"u	   \colorboxu%   (f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})u   span class="binomial"u   span class="binomrow"u   span class="binomcell"u   \dbinomu   span class="numerator"u   \dfracu   span class="displaystyle"u   \displaystyleu   span class="fbox"u   \fboxu   {$p!}u   f0{}u   ignoredu	   \fboxruleu   \fboxsepu   {$p!}{$q!}{$1}u<   span class="boxed" style="border-color: $p; background: $q;"u
   \fcolorboxu   span class="fraction"u   \fracu   [$p!][$q!]{$1}u1   span class="framebox align-$q" style="width: $p;"u	   \frameboxu   [$o]{$u!}{$t!}u   f0{$t}u   a href="$u"u   \hrefu   f0{ }u&   span class="hspace" style="width: $p;"u   \hspaceu*   span class="leftroot" style="width: $p;px"u	   \leftrootu   f0{f1{$1}⁄f2{$2}}u   sup class="numerator"u   sub class="denominator"u	   \nicefracu   [$p!]{$w!}{$1}u   f0{1}u$   div class="Boxed" style="width: $w;"u   \parboxu   f0{$1.font}u1   span class="raisebox" style="vertical-align: $p;"u	   \raiseboxu   {$1!}{$2!}{$3!}u   \renewenvironmentu   [$v!]{$w!}{$h!}u   f0/u.   hr class="line" style="width: $w; height: $h;"u   \ruleu   span class="scriptscriptstyle"u   \scriptscriptstyleu   span class="scriptstyle"u   \scriptstyleu   [$0]{$1}u!   f0{f1{$0}f2{√}f4{(}f3{$1}f4{)}}u   span class="sqrt"u   sup class="root"u   span class="radical"u   span class="root"u   \sqrtu   f0{f1{$1}f2{$2}}u   span class="stackrel"u   span class="upstackrel"u   span class="downstackrel"u	   \stackrelu   \tbinomu
   \textcoloru   span class="textstyle"u
   \textstyleu   $0f0{$1.font}u   span class="unit"u   \unitu   [$0]{$1}{$2}u   $0f0{f1{$1.font}⁄f2{$2.font}}u   sup class="unit"u   sub class="unit"u	   \unitfracu(   span class="uproot" style="width: $p;px"u   \uprootu   {$u!}u   f0{$u}u   \urlu'   span class="vspace" style="height: $p;"u   \vspaceu   $1+$2u   $1+$2+1u
   a name="#"u   \labelu   \intu   \intopu   limu   \limu   ∏u   \produ	   \smallintu   \sums   <span class="symbol">%s</span>u   LimitPreviousCommandu   \limitsu   MacroDefinitionu   \newcommandu   \renewcommandu   SetCounterFunctionu   \setcounteru
   FormulaTagu   \tagu   \tag*u   
u       u   'u    + u   +u   , u   ,u	    − u   -u	    ⁄ u   /u
    &lt; u    = u   =u
    &gt; u   @u   \Bigu   span class="hugesymbol"u   \Biggu   span class="bar"u   span class="arraydef"u   \begin{array}u   \bigu   span class="largesymbol"u   \biggu   \biglu   \bigru   span class="align-center"u
   \centeringu   span class="ensuremath"u   \ensuremathu   span class="phantom"u	   \hphantomu   span class="noindent"u	   \noindentu   span class="overbrace"u
   \overbraceu   span class="overline"u	   \overlineu   \phantomu   span class="underbrace"u   \underbraceu   uu
   \underlineu	   \vphantomu   ⇔u   \Leftrightarrowu   ⇒u   \Rightarrowu   ≈u   \approxu   ⇢u   \dashrightarrowu   ≡u   \equivu   \geu   \gequ	    ⇒ u   \impliesu   ∈u   \inu   \leu
   \leftarrowu   \lequ   \neu   \nequ   \not\inu   \proptou   \rightarrowu   \rightsquigarrowu   \simu   ⊂u   \subsetu   ⊆u	   \subsetequ   ⊃u   \supsetu   ⊇u	   \supsetequ   ×u   \timesu   \tou
   beginafteru   \begin{u   beginbeforeu   commandu   commentu   \[u   simpleu   *u
   unnumberedu   subu   span class="mbox"u   \mboxu   span class="text"u   \textu   \textbfu   span class="textipa"u   \textipau   \textitu   span class="textnormal"u   \textnormalu   span class="textrm"u   \textrmu   span class="versalitas"u   \textscu   span class="textsf"u   \textsfu   \textslu   \textttu   span class="normal"u   \textupu   .u   :u   ·u   !u   ;u   "u
   charactersu-   http://chart.googleapis.com/chart?cht=tx&chl=u   googlecharts(   u   \intu   \intopu   \produ   \sum(   R   R   R   t   alphacommandst   arrayt   bigbracketst
   bigsymbolst   bracketcommandst   combiningfunctionsR-   t   decoratedcommandt   decoratingfunctionsR%   t   environmentst   fontfunctionst   hybridfunctionst   hybridsizest   labelfunctionst   limitcommandst   keyt   misccommandst   modifiedt   onefunctionst   spacedcommandsR(   t   symbolfunctionst   textfunctionst
   unmodifiedt   urls(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR2   B  s  ##
0- 
###



*#

4t   GeneralConfigc           B   s)   e  Z d  Z i d d 6d d 6d d 6Z RS(   s+   Configuration class from elyxer.config fileu
   2011-06-27u   dateu   413u	   lyxformatu   1.2.3u   number(   R   R   R   t   version(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRJ     s   t   HeaderConfigc        1   B   sB  e  Z d  Z i d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6Z i d d d d d d d d  d! d" d# d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< d= d> d? d@ dA dB dC dD dE dF dG dH g0 d 6dI dJ dK dL dM dN dO dP dQ dR dS dT dU dV dW dX dY dZ g dI 6Z RS([   s+   Configuration class from elyxer.config fileu   \begin_preambleu   beginpreambleu   \branchu   branchu
   \textclassu   documentclassu   \end_branchu	   endbranchu   \end_preambleu   endpreambleu	   \languageu   languageu   \lstsetu   lstsetu   \output_changesu   outputchangesu   \paragraph_separationu   paragraphseparationu
   \pdf_titleu   pdftitleu   \secnumdepthu   secnumdepthu	   \tocdepthu   tocdepthu   articleu   aastexu   aapaperu   acmsiggraphu   sigplanconfu   achemsou   amsartu   apau   arab-articleu   armenian-articleu   article-beameru   chessu   dtku
   elsarticleu   heb-articleu   IEEEtranu   iopartu   kluweru   scrarticle-beameru   scrartclu
   extarticleu   paperu   mwartu   revtex4u   spieu	   svglobal3u   ltugboatu   agu-dtdu   jgrgau   agumsu   entcsu   egsu   ijmpcu   ijmpdu   singlecol-newu   doublecol-newu   isprsu   tarticleu	   jsarticleu   jarticleu   jssu   literate-articleu   siamltexu   cl2emultu   llncsu   svglobalu   svjogu   svprobthu   booku   amsbooku   scrbooku   extbooku
   tufte-booku   reportu	   extreportu   scrreprtu   memoiru   tbooku   jsbooku   jbooku   mwbku   svmonou   svmultu   treportu   jreportu   mwrep(   R   R   R   t
   parameterst   styles(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRL     s   
t   ImageConfigc           B   sW   e  Z d  Z i d d 6d d 6Z i d d 6d d 6d d	 6Z i d
 d 6d d g d 6Z RS(   s+   Configuration class from elyxer.config fileuO   convert[ -density $scale][ -define $format:use-cropbox=true] "$input" "$output"u   imagemagicku(   inkscape "$input" --export-png="$output"u   inkscapeu   psu   .epsu   pdfu   .pdfu   .psu   .pngu   defaultu   .svgu   vector(   R   R   R   t
   converterst   cropboxformatst   formats(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRO     s   
t   LayoutConfigc           B   s?   e  Z d  Z i d d d d d d d d d	 d
 d d g d 6Z RS(   s+   Configuration class from elyxer.config fileu   StringContaineru   Constantu
   TaggedTextu   Alignu
   TextFamilyu   EmphaticTextu   VersalitasTextu
   BarredTextu   SizeTextu	   ColorTextu   LangLineu   Formulau   allowed(   R   R   R   t	   groupable(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRS     s   t   NewfangleConfigc           B   s7   e  Z d  Z i d d 6d d 6d d 6d d 6d	 d
 6Z RS(   s+   Configuration class from elyxer.config fileu	   chunkref{u   chunkrefu   }u
   endcommandu   &gt;u   endmarku   \u   startcommandu   =&lt;u	   startmark(   R   R   R   t	   constants(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRU     s   t   NumberingConfigc           B   sb   e  Z d  Z i d d d d d g d 6d d g d	 6Z i d
 d d d d d d d d d g
 d 6Z RS(   s+   Configuration class from elyxer.config fileu   Chapteru   Sectionu
   Subsectionu   Subsubsectionu	   Paragraphu   orderedu   Partu   Booku   romanu   *u   **u   †u   ‡u   §u   §§u   ¶u   ¶¶u   #u   ##u   symbols(   R   R   R   t   layoutst   sequence(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRW     s   t   StyleConfigc           B   s  e  Z d  Z i d d 6d d 6d d 6d d 6d d	 6d d
 6d d 6d d 6d d 6d d 6d d 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d d# 6d d$ 6d d% 6d d& 6d' d( 6d) d* 6d+ d, 6d- d. 6d' d/ 6d) d0 6d1 d2 6d3 d4 6d1 d5 6d1 d6 6Z i d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6dC dD 6Z i dE dF dG dH dI dJ g dK 6Z i dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6Z RS(V   s+   Configuration class from elyxer.config fileu    u	   \enskip{}u   <span class="hfill"> </span>u   \hfill{}u    u   \hspace*{\fill}u    u
   \hspace*{}u	   \hspace{}u   \negthinspace{}u     u   \qquad{}u   \quad{}u    u   \space{}u    u   \thinspace{}u   ~u   »u   aldu   ›u   alsu   «u   ardu   ‹u   arsu   &ldquo;u   eldu   &lsquo;u   elsu   &rdquo;u   erdu   &rsquo;u   ersu   fldu   flsu   frdu   frsu   „u   gldu   ‚u   glsu   “u   grdu   ‘u   grsu   pldu   plsu   ”u   prdu   ’u   prsu   sldu   srdu   (@↕)u   eqrefu   ¶↕u	   formattedu   $↕u   namerefu   #↕u   pagerefu   @↕u   refu   on-page#↕u   vpagerefu   @on-page#↕u   vrefu   colu   textu   lineu   pageu   theightu   pheightu   ignoredtextsu   <div class="bigskip"> </div>u   bigskipu   <div class="defskip"> </div>u   defskipu   <div class="medskip"> </div>u   medskipu   <div class="smallskip"> </div>u	   smallskipu   <div class="vfill"> </div>u   vfill(   R   R   R   t   hspacest   quotest   referenceformatst   sizet   vspaces(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRZ   	  s.   ###t	   TOCConfigc           B   s   e  Z d  Z i d d d d d d d d d	 d
 d d g d 6d g d 6d g d 6Z i d d d g d 6d d d d d	 d
 d d g d 6d d d d d d g d 6Z RS(   s+   Configuration class from elyxer.config fileu   StringContaineru   Constantu
   TaggedTextu   Alignu
   TextFamilyu   EmphaticTextu   VersalitasTextu
   BarredTextu   SizeTextu	   ColorTextu   LangLineu   Formulau   allowedu    u   clonedu	   extractedu   Spaceu   PlainLayoutu   Captionu   StandardLayoutu	   FlexInset(   R   R   R   t   extractplaint   extracttitle(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR`   ,  s   +t	   TagConfigc           B   s  e  Z d  Z i d d 6Z i d d 6d d 6Z i d d 6d	 d
 6d d 6d	 d 6d d 6d d 6Z i d d g d 6Z i
 d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6Z i d! d" 6d# d$ 6Z i d% d& 6d' d( 6d% d) 6Z	 i d* d+ 6d* d, 6d- d. 6Z
 RS(/   s+   Configuration class from elyxer.config fileu   uu   underu   span class="sans"u   sansu   ttu
   typewriteru   span class="code"u   CharStyle:Codeu   span class="menuitem"u   CharStyle:MenuItemu   Codeu   MenuItemu   span class="noun"u   Nounu   span class="strong"u   Strongu	   Quotationu   Quoteu   layoutsu   divu   Centeru   h?u   Chapteru   h2u   Dateu	   Paragraphu   h1u   Partu
   blockquoteu   Sectionu
   Subsectionu   Subsubsectionu   olu	   Enumerateu   ulu   Itemizeu    u   Commentu   span class="greyedout"u	   Greyedoutu   Noteu   iu   italicu   slantedu   span class="versalitas"u	   smallcaps(   R   R   R   t   barredt   familyt   flext   groupRX   t	   listitemst   notest   shaped(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRc   ;  s,   
t   TranslationConfigc           B   sN  e  Z d  Z i$ d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d  d! 6d" d# 6d$ d% 6d& d' 6d( d) 6d* d+ 6d, d- 6d. d/ 6d0 d1 6d2 d3 6d4 d5 6d6 d7 6d8 d9 6d: d; 6d< d= 6d> d? 6Z i d@ dA 6d@ dB 6dC dD 6dE dF 6d@ dG 6dH dI 6dC dJ 6dK dL 6Z RS(M   s+   Configuration class from elyxer.config fileu   Appendixu   Booku   Chapteru	   Paragraphu   Partu   Sectionu
   Subsectionu   Subsubsectionu   Abstractu   abstractu   Bibliographyu   bibliographyu   figureu
   Algorithm u   float-algorithmu   Figure u   float-figureu   Listing u   float-listingu   Table u   float-tableu   Tableau u   float-tableauu	   Footnotesu	   footnotesu   Document generated by u   generated-byu    on u   generated-onu   Indexu   indexu)   Please enable JavaScript on your browser.u   jsmath-enableuH    requires JavaScript to correctly process the mathematics on this page. u   jsmath-requiresu	   Warning: u   jsmath-warningu   List of Algorithmsu   list-algorithmu   List of Figuresu   list-figureu   List of Tablesu
   list-tableu   List of Tableauxu   list-tableauu	   Main pageu	   main-pageu   Nextu   nextu   Nomenclatureu   nomenclatureu	    on page u   on-pageu   Prevu   prevu
   Referencesu
   referencesu   Table of Contentsu   tocu   Contents for u   toc-foru   Upu   upu   enu   americanu   britishu   deu   deutschu   nlu   dutchu   englishu   fru   frenchu   ngermanu   esu   spanish(   R   R   R   RV   t	   languages(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRk   c  s,   t   CommandLineParserc           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s   A parser for runtime optionsc         C   s   | |  _  d  S(   N(   t   options(   t   selfRn   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   __init__  s    c         C   s   t  |  d k r d Sxu t  |  d k r | d j d  r |  j |  \ } } | se d | d S| sw d | d St |  j | |  q Wd S(   s   Parse command line optionsi    s   --s   Option s    not recognizeds    needs a valueN(   t   lenR   t
   startswitht
   readoptiont   setattrRn   (   Ro   t   argsRA   t   value(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseoptions  s    (c         C   s&  | d d } | d =d | k r6 |  j  | |  } n | j d d  } t |  j |  sd d | f St |  j |  } t | t  r | t f St	 |  d k r | d f S| d j
 d  r | d } | d =| |  j | |  f S| d } | d =t | t  r| j |  | | f S| | f S(   s$   Read the key and value for an optioni    i   t   =t   -t    t   "N(   t   readequalskeyt   replacet   hasattrRn   R   t   getattrt
   isinstancet   boolt   TrueRq   Rr   t
   readquotedt   listt   append(   Ro   Ru   t   argRA   t   currentt   initialRv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRs     s,    





c         C   s   | d } xW t  |  d k rc | d j d  rc | d j d  rc | d | d 7} | d =q Wt  |  d k s | d j d  r d S| d | d d !7} | S(   s   Read a value between quotesi   i    R{   s   --t    iN(   Rq   t   endswithRr   R   (   Ro   Ru   R   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    
=%c         C   s:   | j  d d  } | d } | d } | j d |  | S(   s   Read a key using equalsRx   i   i    (   t   splitt   insert(   Ro   R   Ru   R   RA   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR|     s
    

(   R   R   R   Rp   Rw   Rs   R   R|   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRm     s   				t   Optionsc           B   s  e  Z d  Z d Z d Z e Z e Z e Z	 e Z
 e Z e Z e Z e Z e Z e Z e Z e Z g  Z d Z d Z d Z e Z d Z d Z d Z e Z d Z d Z e Z e Z  e Z! d Z" e Z# d Z$ d Z% e Z& e Z' d Z( e Z) e Z* e Z+ e Z, e Z- e Z. e Z/ e Z0 e Z1 e Z2 d Z3 d Z4 e Z5 e Z6 g  Z7 e8   Z9 d   Z: d   Z; d   Z< d   Z= d   Z> d   Z? d	   Z@ d
   ZA d   ZB RS(   s   A set of runtime optionsRz   t   imagemagickc         C   s]   | d t  _ | d =t t   } | j |  } | rO t j |  |  j   n  |  j   d S(   s   Parse command line optionsi    N(   R   t   locationRm   Rw   R    R   t   usaget   processoptions(   Ro   Ru   t   parsert   result(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRw      s    c         C   s  t  j r |  j   n  t  j r, |  j   n  t  j rB |  j   n  t  j rX |  j   n  t  j	 rn |  j
   n  t  j r y? t t  j  t  _ t  j d k r t j d  |  j   n  Wq t j d t  j  |  j   q Xn  t  j s t  j s t  j rt t  _ n  |  j   t  j r4t  j r4t  j t  _ n  t  j d k rOt t  _ n  t  j g  k rmd g t  _ n  t  j rt t  _ n  t  j rt  j rt j d  t  j t  _ n  t  j rt j d  n  xC t t  D]5 } | j d  rt  t | t! |  | d	    qqWd
 S(   s   Process all options parsed.i    s.   --splitpart requires a number bigger than zeros*   --splitpart needs a numeric argument, not t   copys    http://elyxer.nongnu.org/lyx.csss7   Option --toc is deprecated; use --tocfor "page" insteads5   Option --nocopy is deprecated; it is no longer neededt   modeiN("   R   t   helpR   RK   t   showversiont   hardversiont   showhardversiont   versiondatet   showversiondatet	   lyxformatt   showlyxformatt	   splitpartt   intR    R   t   lowmemt   toct   tocforR   t   memoryt   parsefootnotest   forceformatt   imageformatR   t
   copyimagest   cssR/   t
   simplematht	   toctargett   nocopyt   dirR   Rt   R   (   Ro   t   param(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     sL    						
		c         C   sY   t  j d t j j t j  d  t  j d  t  j d  t  j d  |  j   d S(   s   Show correct usages   Usage: s    [options] [filein] [fileout]s7   Convert LyX input file "filein" to HTML file "fileout".sC   If filein (or fileout) is not given use standard input (or output).s?   Main program of the eLyXer package (http://elyxer.nongnu.org/).N(   R    R   t   ost   patht   basenameR   R   t   showoptions(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   5  s
    $c         C   s   t  j s d St t  _ t t  _ t  j j d  } xK | D]C } | d } t t  |  rj t t  | t  q8 t	 j
 d |  q8 Wt  j r t  j r t  j r t t  _ n  t  j r t  j r t t  _ n  d S(   s   Parse footnotes options.Nt   ,t   foots   Unknown footnotes option: (   R   t	   footnotesR   t
   marginfoott
   letterfootR   R~   Rt   R   R    R   t   endfoott	   hoverfoott
   numberfoott
   symbolfoot(   Ro   Rn   t   optiont
   footoption(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   =  s    			
c         C   s  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d	  t  j d
  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d  t  j d   t  j d!  t  j d"  t  j d#  t  j d$  t  j d%  t  j d&  t  j d'  t  j d(  t  j d)  t  j d*  t  j d+  t  j d,  t  j d-  t  j d.  t  j d/  t  j d0  t  j d1  t  j d2  t j   d3 S(4   s   Show all possible optionss     Common options:s1       --help:                 show this online helps9       --quiet:                disables all runtime messagesRz   s     Advanced options:sF       --debug:                enable debugging messages (for developers)s@       --version:              show version number and release datesD       --lyxformat:            return the highest LyX version supporteds     Options for HTML output:s8       --title "title":        set the generated page titles1       --css "file.css":       use a custom CSS filesO       --embedcss "file.css":  embed styles from elyxer.a CSS file into the outputsH       --html:                 output HTML 4.0 instead of the default XHTMLs/       --unicode:              full Unicode outputsG       --iso885915:            output a document with ISO-8859-15 encodingsC       --nofooter:             remove the footer "generated by eLyXer"sD       --simplemath:           do not generate fancy math constructionss     Options for image output:sF       --directory "img_dir":  look for images in the specified directorysD       --destdirectory "dest": put converted images into this directorysI       --imageformat ".ext":   image output format, or "copy" to copy imagessL       --noconvert:            do not convert images, use in original locationssH       --converter "inkscape": use an alternative program to convert imagess     Options for footnote display:sJ       --numberfoot:           mark footnotes with numbers instead of letterssB       --symbolfoot:           mark footnotes with symbols (*, **...)sE       --hoverfoot:            show footnotes as hovering text (default)s=       --marginfoot:           show footnotes on the page marginsA       --endfoot:              show footnotes at the end of the pagesJ       --supfoot:              use superscript for footnote markers (default)sA       --alignfoot:            use aligned text for footnote markerssM       --footnotes "options":  specify several comma-separated footnotes optionssJ         Available options are: "number", "symbol", "hover", "margin", "end",s           "sup", "align"s     Advanced output options:sJ       --splitpart "depth":    split the resulting webpage at the given depthsH       --tocfor "page":        generate a TOC that points to the given pagesC       --target "frame":       make all links point to the given framesL       --notoclabels:          omit the part labels in the TOC, such as ChaptersJ       --lowmem:               do the conversion on the fly (conserve memory)sC       --raw:                  generate HTML without header or footer.sU       --jsmath "URL":         use jsMath from elyxer.the given URL to display equationssV       --mathjax "URL":        use MathJax from elyxer.the given URL to display equationssH       --googlecharts:         use Google Charts to generate formula imagessM       --template "file":      use a template, put everything in <!--$content-->s@       --copyright:            add a copyright notice at the bottoms     Deprecated options:sC       --toc:                  (deprecated) create a table of contentssJ       --toctarget "page":     (deprecated) generate a TOC for the given pagesO       --nocopy:               (deprecated) maintained for backwards compatibilityN(   R    R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   O  sf    c         C   sE   d t  j d } | d t  j d d 7} t j |  t j   d S(   s(   Return the current eLyXer version strings   eLyXer version t   numbers    (t   datet   )N(   RJ   RK   R    R   R   R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s"   t  j t j d  t j   d S(   s   Return just the version stringR   N(   R    R   RJ   RK   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s"   t  j t j d  t j   d S(   s   Return just the version dteR   N(   R    R   RJ   RK   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s"   t  j t j d  t j   d S(   s#   Return just the lyxformat parameterR   N(   R    R   RJ   RK   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    N(C   R   R   R   R   t   instanceR   R   R   t	   copyrightR   t   quietRK   R   R   R/   R   R   t	   showlinest   unicodeR0   R   t   titlet	   directoryt   destdirectoryR   R   R   R   R   t   targetR   R   R   t   nobibt	   convertert   rawt   jsmatht   mathjaxt   nofooterR   t   templatet	   noconvertt   notoclabelsR   R   R   R   R   R   t   supfoott	   alignfootR   R   R   t   googlechartst   embedcsst   dictt   branchesRw   R   R   R   R   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     sz   			*			6			t   BranchOptionsc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   A set of options for a branchc         C   s   | |  _  i d d 6|  _ d  S(   Ns   #fffffft   color(   t   nameRn   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   sU   | j  t j d  s+ t j d |  d S| j t j d d  } | |  j | <d S(   s   Set a branch optiont   startcommands   Invalid branch option NRz   (   Rr   R$   R)   R    R   R}   Rn   (   Ro   RA   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   set  s
    c         C   s$   d |  j  k r t S|  j  d d k S(   s    Return if the branch is selectedt   selectedt   1(   Rn   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   isselected  s    c         C   s   d |  j  d t |  j  S(   s   String representations   options for s   : (   R   R   Rn   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   __unicode__  s    (   R   R   R   Rp   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
   			t   Clonerc           B   s8   e  Z d  Z d   Z d   Z e e  Z e e  Z RS(   s&   An object used to clone other objects.c         C   s   |  j  | j  S(   s"   Return an exact copy of an object.(   t   createt	   __class__(   R   t   original(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   clone  s    c         C   s   | j  |  } | j   | S(   s"   Create an object of a given class.(   t   __new__Rp   (   R   t   typeR   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    
(   R   R   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
   		t   ContainerExtractorc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s&   A class to extract certain containers.c         C   s+   | d |  _  | d |  _ | d |  _ d S(   sT   The config parameter is a map containing three lists: allowed, copied and extracted.t   allowedt   clonedt	   extractedN(   R   R   R   (   Ro   t   config(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c            sM   g     f d   }  f d   }    f d   } | j  | | |    S(   s?   Extract a group of selected containers from elyxer.a container.c            s   |  j  j   j   j k S(   N(   R   R   R   R   (   t   c(   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   <lambda>  s    c            s   |  j  j   j k S(   N(   R   R   R   (   R   (   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c            s    j  |     S(   N(   t   process(   R   (   R   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   t   recursivesearch(   Ro   t	   containert   locatet	   recursiveR   (    (   R   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   extract  s    c         C   sh   | j  j } | |  j k r+ | j |  n9 | |  j k rS | j |  j |   n t j d |  d S(   sB   Add allowed containers, clone cloned containers and add the clone.s   Unknown container class N(   R   R   R   R   R   t	   safecloneR    R   (   Ro   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s1   t  j |  } | j | _ |  j |  | _ | S(   sF   Return a new container with contents only in a safe list, recursively.(   R   R   t   outputR   t   contents(   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
   				
t   Parserc           B   sM   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   s   A generic parserc         C   s   d |  _  t   |  _ d  S(   Ni    (   t   beginR   RM   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   s,   | j    j   } | j   | j |  _ | S(   s   Parse the header(   t   currentlineR   t   nextlinet
   linenumberR   (   Ro   t   readert   header(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseheader  s    
c         C   s   | j    j   j d  rA |  j |  \ } } | |  j | <d S| j    j   j d d  } | j   t |  d k r d S| d } t |  d k r t |  j | <d Sd | d k r | d j   |  j | <d S| d j d  } | d |  j | <d S(   s   Parse a parametert   <NR   i   i    R{   (	   R   t   stripRr   t   parsexmlRM   R   R   Rq   R   (   Ro   R   RA   Rv   R   t   doublesplit(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseparameter  s"    

c   
      C   s9  | j    j   } | j   | j d  sC t j d | d  n  | d d !j   } t |  d k ry t j d  d S| d } | d =t |  d k r | t	   f St	   } xz | D]r } d | k r t j d	 | d
 |  | d 7} n  | j d  } | d } | d j d  d }	 |	 | | <q W| | f S(   s5   Parse a parameter in xml form: <param attr1=value...>t   >s   XML parameter s    should be <...>i   ii    s   Empty XML parameter <>Rx   s   Erroneous attribute for s   : s   ="0"R{   N(   NN(
   R   R  R   R   R    R   R   Rq   R   R   (
   Ro   R   R  R   RA   t   attrst   attrt   partst   attrkeyRv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s,    

	
c         C   sN   |  j  s$ t j d t |    d Sx# | j   j |  j   sI |   q' Wd S(   s'   Parse until the current ending is founds   No ending for N(   t   endingR    R   R   R   Rr   (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseending9  s
    	c         C   s8   |  j  j |  } | r4 |  j | _ | j |  n  d  S(   N(   t   factoryt   createcontainert   parentR   (   Ro   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parsecontainerA  s    c         C   s   |  j  j d t |  j  d S(   s   Return a descriptions    (R   (   R   R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   G  s    (
   R   R   R   Rp   R   R  R  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s   						t   LoneCommandc           B   s   e  Z d  Z d   Z RS(   s"   A parser for just one command linec         C   s   g  S(   s   Read nothing(    (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseN  s    (   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  K  s   t
   TextParserc           B   s/   e  Z d  Z g  Z d   Z d   Z d   Z RS(   s(   A parser for a command and a bit of textc         C   sQ   t  j |   d  |  _ | j j t j k rD t j | j j |  _ n  g  |  _ d  S(   N(   R   Rp   R   R
  R   R   R$   R%   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   W  s
    	c         C   sm   t  j j |  j  t  j t j d t j d |  j g |  _ g  } x# |  j |  sh |  j | |  qF W| S(   s$   Parse lines as long as they are textt   Layoutt   Inset(   R  t   stackR   R
  R$   R%   t   isendingR  (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ^  s    c         C   sv   | j    j   } t |  d k r( t S| d |  j k rr | d t j k re t j j | d  n	 g  t _ t St S(   s   Check if text is endingi    (	   R   R   Rq   R   R%   R  R  t   removeR   (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  h  s    	(   R   R   R   R  Rp   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  R  s
   		
t   ExcludingParserc           B   s   e  Z d  Z d   Z RS(   s%   A parser that excludes the final linec            s)   g     j       f d      S(   s5   Parse everything up to (and excluding) the final linec              s    j      S(   N(   R  (    (   R   R   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   {  s    (   R  (   Ro   R   (    (   R   R   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  x  s    (   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  u  s   t   BoundedParserc           B   s   e  Z d  Z d   Z RS(   s   A parser bound by a final linec         C   s    t  j |  |  } | j   | S(   s*   Parse everything, including the final line(   R  R  R   (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    
(   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ~  s   t   BoundedDummyc           B   s   e  Z d  Z d   Z RS(   s&   A bound parser that ignores everythingc            s'   |  j      f d      j   g  S(   s#   Parse the contents of the containerc              s
     j    S(   N(   R   (    (   R   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R  R   (   Ro   R   (    (   R   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    
(   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   StringParserc           B   s    e  Z d  Z d   Z d   Z RS(   s   Parses just a stringc         C   s   | j  d |  _ g  S(   s   Do nothing, just take notei   (   R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s   | j    } | j   | S(   s   Parse a single line(   R   R   (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    
(   R   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   InsetParserc           B   s   e  Z d  Z d   Z RS(   s   Parses a LyX insetc         C   sY   t  j d } x9 | j   d k rH | j   j |  rH |  j |  q Wt j |  |  S(   s(   Parse inset parameters into a dictionaryR   Rz   (   R$   R)   R   Rr   R  R  R  (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    +(   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   ContainerOutputc           B   s    e  Z d  Z d   Z d   Z RS(   s(   The generic HTML output for a container.c         C   s   t  j d t |    d S(   s   Show an error.s   gethtml() not implemented for N(   R    R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   gethtml  s    c         C   s   t  S(   s5   Decide if the output is empty: by default, not empty.(   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isempty  s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   EmptyOutputc           B   s   e  Z d    Z d   Z RS(   c         C   s   g  S(   s   Return empty HTML code.(    (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   t  S(   s"   This output is particularly empty.(   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s   	t   FixedOutputc           B   s   e  Z d  Z d   Z RS(   s   Fixed outputc         C   s   | j  S(   s   Return constant HTML code(   R/   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR!    s   t   ContentsOutputc           B   s   e  Z d  Z d   Z RS(   s&   Outputs the contents converted to HTMLc         C   sy   g  } | j  d k r | SxY | j  D]N } t | d  sa t j d | j j d t |   | S| | j   7} q# W| S(   s   Return the HTML codeR  s   No html in s   : N(	   R   R   R~   R    R   R   R   R   R  (   Ro   R   R/   t   element(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    %(   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR"    s   t   TaggedOutputc           B   se   e  Z d  Z d Z e Z e Z e e d  Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z RS(	   s-   Outputs an HTML tag surrounding the contents.c         C   s1   | |  _  | r | |  _ n  | r- | |  _ n  |  S(   s/   Set the value for the tag and other attributes.(   t   tagt
   breaklinest   empty(   Ro   R%  R&  R'  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   settag  s    	c         C   s   | |  _  |  S(   s   Set the value for breaklines.(   R&  (   Ro   R&  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setbreaklines  s    	c         C   s[   |  j  r |  j |  g S|  j |  g } | t j |  |  7} | j |  j |   | S(   s   Return the HTML code.(   R'  t   selfclosingt   openR"  R  R   t   close(   Ro   R   R/   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    	c         C   s6   |  j    s d Sd |  j d } |  j r2 | d S| S(   s   Get opening line.Rz   R   R  s   
(   t   checktagR%  R&  (   Ro   R   R+  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR+    s    	c         C   sD   |  j    s d Sd |  j j   d d } |  j r@ d | d S| S(   s   Get closing line.Rz   s   </i    R  s   
(   R-  R%  R   R&  (   Ro   R   R,  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR,    s    	c         C   s6   |  j    s d Sd |  j d } |  j r2 | d S| S(   s   Get self-closing line.Rz   R   s   />s   
(   R-  R%  R&  (   Ro   R   R*  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR*  
  s    	c         C   s;   |  j  s$ t j d t t   t S|  j  d k r7 t St S(   s   Check that the tag is valid.s
   No tag in Rz   (   R%  R    R   R   R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR-    s    	N(   R   R   R   R   R%  R   R&  R'  R(  R)  R  R+  R,  R*  R-  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR$    s   										t   FilteredOutputc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s1   Returns the output in the contents, but filtered:c         C   s   g  |  _  d S(   s   Initialize the filters.N(   t   filters(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp      s    c         C   s   |  j  j | | f  d S(   s:   Add a new filter: replace the original by the replacement.N(   R/  R   (   Ro   R   t   replacement(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   addfilter$  s    c         C   sC   g  } t  j |  |  } x$ | D] } | j |  j |   q W| S(   s   Return the HTML code(   R"  R  R   t   filter(   Ro   R   R   R/   t   line(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  (  s
    c         C   s?   x8 |  j  D]- \ } } | | k r
 | j | |  } q
 q
 W| S(   s0   Filter a single line with all available filters.(   R/  R}   (   Ro   R3  R   R0  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR2  0  s    (   R   R   R   Rp   R1  R  R2  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR.    s
   			t   StringOutputc           B   s   e  Z d  Z d   Z RS(   s   Returns a bare string as outputc         C   s
   | j  g S(   s   Return a bare string(   R)   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  :  s    (   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR4  7  s   t
   LineReaderc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s   Reads a file line by linec         C   s   t  | t  r | |  _ n t j | d d  |  _ d |  _ d  |  _ d  |  _ t |  _	 t
 |  _ y |  j   Wn< t k
 r d d  l } | j | d  |  _ |  j   n Xd  S(   Nt   rUs   utf-8i   it   rb(   R   t   filet   codecsR+  R   R   t   lastlineR   R   t   mustreadR   t   depletedt   readlinet   UnicodeDecodeErrort   gzip(   Ro   t   filenameR?  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   K  s    					c         C   s1   x! t  |  D] } |  j j   q W| |  _ d S(   s   Set the first line to read.N(   t   rangeR8  R=  R   (   Ro   t	   firstlinet   i(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setstart]  s    c         C   s   | |  _  d S(   s   Set the last line to read.N(   R:  (   Ro   R:  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setendc  s    c         C   s   |  j  r |  j   n  |  j S(   s   Get the current line(   R;  R=  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   g  s    	c         C   s&   |  j  r t j d  n  t |  _ d S(   s   Go to next lines   Read beyond file endN(   R<  R    R   R   R;  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   m  s    	c         C   s   |  j  j   |  _ t |  j  t j  s? |  j j d  |  _ n  t |  j  d k r` t |  _	 n  |  j j
 d  |  _ |  j d 7_ t |  _ d t |  j  d t _ |  j d d k r t j d  n  d	 S(
   s   Read a line from elyxer.files   utf-8i    s   
i   s   Line s   : i  t   ParsingN(   R8  R=  R   R   R9  t   StreamReaderWritert   decodeRq   R   R<  t   rstripR   R   R;  R   R    R	   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR=  s  s    	c         C   s<   |  j  r |  j |  j  k r t S|  j r5 |  j   n  |  j S(   s    Find out if the file is finished(   R:  R   R   R;  R=  R<  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   finished  s
    	c         C   s   |  j  j   d  S(   N(   R8  R,  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR,    s    (   R   R   R   Rp   RD  RE  R   R   R=  RJ  R,  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR5  H  s   							t
   LineWriterc           B   sA   e  Z d  Z e Z d   Z d   Z d   Z d   Z d   Z	 RS(   s"   Writes a file as a series of listsc         C   s1   t  | t  r$ | |  _ d  |  _ n	 | |  _ d  S(   N(   R   R8  R   R@  (   Ro   R@  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   sZ   xS | D]K } t  | t  sE t j d t |  d t |   d S|  j |  q Wd S(   s   Write a list of stringss   Not a string: s    in N(   R   t
   basestringR    R   R   t   writestring(   Ro   t   stringsR)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
    %c         C   sn   |  j  s' t j |  j d d  |  _  n  |  j  t j k rZ t j d k  rZ | j d  } n  |  j  j |  d S(   s   Write a stringt   ws   utf-8i   i    N(   i   i    (	   R8  R9  R+  R@  R   R   R   R   R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRM    s
    	!c         C   s   |  j  | d  d S(   s   Write a line to files   
N(   RM  (   Ro   R3  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   writeline  s    c         C   s   |  j  j   d  S(   N(   R8  R,  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR,    s    (
   R   R   R   R   R8  Rp   R   RM  RP  R,  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRK    s   				t   Globablec           B   s   e  Z d  Z e Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e d  Z d d  Z d   Z RS(   s   A bit of text which can be globbed (lumped together in bits).
  Methods current(), skipcurrent(), checkfor() and isout() have to be
  implemented by subclasses.c         C   s   t    |  _ d  S(   N(   t
   EndingListt
   endinglist(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s9   |  j    r d St |  j    d k r5 |  j   n  d S(   s*   Check for a Unicode byte mark and skip it.Ni  (   RJ  t   ordR   t   skipcurrent(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   checkbytemark  s    c         C   s   t  j d  t S(   s+   Find out if we are out of the position yet.s   Unimplemented isout()(   R    R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isout  s    c         C   s   t  j d  d S(   s   Return the current character.s   Unimplemented current()Rz   (   R    R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s   t  j d  t S(   s3   Check for the given string in the current position.s   Unimplemented checkfor()(   R    R   R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   checkfor  s    c         C   s9   |  j    r) |  j s% |  j j   n  t S|  j j |   S(   s*   Find out if the current text has finished.(   RW  t   leavependingRS  t   checkpendingR   t   checkin(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRJ    s
    	c         C   s   t  j d  d S(   s)   Return the current character and skip it.s   Unimplemented skipcurrent()Rz   (   R    R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRU    s    c         C   s7   d } x* |  j    r2 |   r2 | |  j   7} q	 W| S(   s>   Glob a bit of text that satisfies a check on the current char.Rz   (   RJ  RU  (   Ro   t   currentcheckt   glob(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR]    s    c            s     j    f d    S(   s   Glob a bit of alpha textc              s     j    j   S(   N(   R   t   isalpha(    (   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R]  (   Ro   (    (   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   globalpha  s    c            s     j    f d    S(   s   Glob a row of digits.c              s     j    j   S(   N(   R   t   isdigit(    (   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R]  (   Ro   (    (   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   globnumber  s    c         C   s,   |  j    j   s$ |  j    d k r( t St S(   s5   Return if the current character is alphanumeric or _.t   _(   R   t   isalnumR   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isidentifier  s    $c         C   s   |  j  |  j  S(   s    Glob alphanumeric and _ symbols.(   R]  Rd  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   globidentifier  s    c         C   s0   |  j    j   r t S|  j    d k r, t St S(   s5   Return if the current character is a value character:s   {}()(   R   t   isspaceR   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isvalue  s
    c         C   s   |  j  |  j  S(   s'   Glob a value: any symbols but brackets.(   R]  Rg  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   globvalue  s    c            s     j    f d    S(   s(   Skip all whitespace at current position.c              s     j    j   S(   N(   R   Rf  (    (   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s    (   R]  (   Ro   (    (   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   skipspace  s    c            s0    j     f d      }  j    | S(   s4   Glob a bit of text up to (including) the magic char.c              s    j      k S(   N(   R   (    (   t	   magiccharRo   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R]  t   skip(   Ro   Rj  R]  (    (   Rj  Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   globincluding  s    c            s    j     f d    S(   s?   Glob a bit of text up until (excluding) any excluded character.c              s    j      k S(   N(   R   (    (   t   excludedRo   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R]  (   Ro   Rm  (    (   Rm  Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   globexcluding  s    c         C   s   |  j  j | |  d S(   s   Push a new ending to the bottomN(   RS  t   add(   Ro   R
  t   optional(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   pushending  s    c         C   sj   |  j    r |  j r | S|  j j |   } | rY | | k rY t j d | d |  n  |  j |  | S(   s,   Pop the ending found at the current positions   Expected ending s   , got (   RW  RY  RS  t   popR    R   Rk  (   Ro   t   expectedR
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   popending  s    c         C   s#   |  j  j |   } | s d S| j S(   s$   Return the next ending in the queue.N(   RS  t
   findendingR   R
  (   Ro   t
   nextending(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRv  #  s    N(   R   R   R   R   RY  Rp   RV  RW  R   RX  RJ  RU  R]  R_  Ra  Rd  Re  Rg  Rh  Ri  Rl  Rn  Rq  R   Rt  Rv  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRQ    s,   																		
RR  c           B   sY   e  Z d  Z d   Z e d  Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z RS(	   s   A list of position endingsc         C   s   g  |  _  d  S(   N(   R%   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   -  s    c         C   s   |  j  j t | |   d S(   s   Add a new ending to the listN(   R%   R   t   PositionEnding(   Ro   R
  Rp  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRo  0  s    c         C   s   |  j  | j j  7_  d S(   s/   Pick any pending endings from a parse position.N(   R%   RS  (   Ro   t   pos(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   pickpending4  s    c         C   s   |  j  |  r t St S(   s   Search for an ending(   Ru  R   R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR[  8  s    c         C   s   | j    r t j d  d S|  j |  } | sM t j d | j    d SxW t |  j  D]F } |  j j |  | | k r | j S| j	 s] t j d |  q] q] Wt j d  d S(   s)   Remove the ending at the current positions   No ending out of boundsRz   s   No ending at s   Removed non-optional ending s   No endings left(
   RW  R    R   Ru  R   t   reversedR%   R  R
  Rp  (   Ro   Rx  R
  t   each(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRr  >  s    	c         C   sc   t  |  j  d k r d SxC t t |  j   D], \ } } | j |  rN | S| j s/ d Sq/ Wd S(   s'   Find the ending at the current positioni    N(   Rq   R%   R   t	   enumerateRz  R[  Rp  (   Ro   Rx  t   indexR
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRu  P  s    "	c         C   s7   t  |  j  d k r3 t j d t |   d  n  d S(   s&   Check if there are any pending endingsi    s   Pending s
    left openN(   Rq   R%   R    R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRZ  [  s    c         C   sX   d } x% |  j  D] } | t |  d 7} q Wt |  j   d k rP | d  } n  | d S(   s   Printable representations	   endings [R   i    it   ](   R%   R   Rq   (   Ro   R)   R
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   `  s    (   R   R   R   Rp   R   Ro  Ry  R[  Rr  Ru  RZ  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRR  *  s   						Rw  c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s    An ending for a parsing positionc         C   s   | |  _  | |  _ d  S(   N(   R
  Rp  (   Ro   R
  Rp  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   l  s    	c         C   s   | j  |  j  S(   s   Check for the ending(   RX  R
  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR[  p  s    c         C   s'   d |  j  } |  j r# | d 7} n  | S(   s   Printable representations   Ending s    (optional)(   R
  Rp  (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   t  s    	(   R   R   R   Rp   R[  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRw  i  s   		t   Positionc           B   sh   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s   A position in a text to parse.
  Including those in Globable, functions to implement by subclasses are:
  skip(), identifier(), extract(), isout() and current().c         C   s   t  j |   d  S(   N(   RQ  Rp   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   t  j d  d S(   s   Skip a strings   Unimplemented skip()N(   R    R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRk    s    c         C   s   t  j d  d S(   s.   Return an identifier for the current position.s   Unimplemented identifier()t   Error(   R    R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   identifier  s    c         C   s   t  j d  d S(   sH   Extract the next string of the given length, or None if not enough text,s   Unimplemented extract()N(   R    R   R   (   Ro   t   length(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s   | |  j  t |   k S(   s)   Check for a string at the given position.(   R   Rq   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRX    s    c         C   sD   |  j  t |   } | s t S| j   |  j  t |   j   k S(   s!   Check for a string in lower case.(   R   Rq   R   t   lower(   Ro   R)   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   checkforlower  s    c         C   s   |  j    } |  j |  | S(   s)   Return the current character and skip it.(   R   Rk  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRU    s    c         C   s   |  j    |  j   S(   s3   Advance the position and return the next character.(   RU  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   next  s    
c         C   s$   |  j  |  s t S|  j |  t S(   s;   Check for a string at the given position; if there, skip it(   RX  R   Rk  R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   checkskip  s    c         C   s   t  j | d |  j    d S(   s2   Show an error message and the position identifier.s   : N(   R    R   R  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   Rk  R  R   RX  R  RU  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  }  s   									t   TextPositionc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s%   A parse position based on a raw text.c         C   s-   t  j |   d |  _ | |  _ |  j   d S(   s*   Create the position from elyxer.some text.i    N(   R  Rp   Rx  t   textRV  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    		c         C   s   |  j  t |  7_  d S(   s   Skip a string of characters.N(   Rx  Rq   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRk    s    c         C   s[   d } |  j  | t |  j  k r; t |  j  |  j  } n  d |  j |  j  |  j  | !d S(   s&   Return a sample of the remaining text.i   t   *(   Rx  Rq   R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   |  j  t |  j  k S(   s'   Find out if we are out of the text yet.(   Rx  Rq   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRW    s    c         C   s   |  j  |  j S(   s6   Return the current character, assuming we are not out.(   R  Rx  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s8   |  j  | t |  j  k r  d S|  j |  j  |  j  | !S(   sH   Extract the next string of the given length, or None if not enough text.N(   Rx  Rq   R  R   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (	   R   R   R   Rp   Rk  R  RW  R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   					t   FilePositionc           B   s_   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   s-   A parse position based on an underlying file.c         C   s3   t  j |   t |  |  _ d |  _ |  j   d S(   s    Create the position from a file.i    N(   R  Rp   R5  R   Rx  RV  (   Ro   R@  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   sv   t  |  } xT |  j | t  |  j j    k rb | t  |  j j    |  j d 8} |  j   q W|  j | 7_ d S(   s   Skip a string of characters.i   N(   Rq   Rx  R   R   R   (   Ro   R)   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRk    s
    %$c         C   s   |  j  j   S(   s,   Get the current line of the underlying file.(   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s   |  j  j   d |  _ d S(   s   Go to the next line.i    N(   R   R   Rx  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s   |  j  j d S(   s#   Return the line number of the file.i   (   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   sT   |  j  j   |  j d  } |  j  j   |  j } d t |  j    d | d | S(   s4   Return the current line and line number in the file.i   s   line s   : R  (   R   R   Rx  R   t   getlinenumber(   Ro   t   beforet   after(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   |  j  t |  j j    k r{ |  j  t |  j j    d k rn t j d |  j j   d t |  j    n  |  j   n  |  j j   S(   s'   Find out if we are out of the text yet.i   s   Out of the line s   : (	   Rx  Rq   R   R   R    R   R   R   RJ  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRW    s
    ".c         C   s   |  j  t |  j j    k r" d S|  j  t |  j j    k ro t j d |  j j   d t |  j    d S|  j j   |  j  S(   s6   Return the current character, assuming we are not out.s   
s   Out of the line s   : R  (   Rx  Rq   R   R   R    R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    +c         C   sD   |  j  | t |  j j    k r& d S|  j j   |  j  |  j  | !S(   sH   Extract the next string of the given length, or None if not enough text.N(   Rx  Rq   R   R   R   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    "(   R   R   R   Rp   Rk  R   R   R   R  RW  R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   									t	   Containerc           B   s   e  Z d  Z d Z d Z d Z d   Z d   Z d   Z	 d   Z
 e j d  Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z d   Z RS(   s.   A container for text and objects in a lyx filec         C   s   t    |  _ d  S(   N(   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   d S(   s   Process contentsN(    (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR      s    c         C   sK   |  j  j |   } t | t  r> t j d |  | g } n  |  j |  S(   s   Get the resulting HTMLs   Raw string (   R   R  R   RL  R    R   t	   escapeall(   Ro   R/   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  $  s
    c         C   s   g  } x | D] } t  j r4 |  j | t j  } n  t  j rd |  j | t j  } |  j |  } n! t  j s |  j | t j  } n  | j |  q W| S(   s=   Escape all lines in an array according to the output options.(	   R   R/   t   escapeR+   R0   t   escapeentitiesR   R1   R   (   Ro   t   linesR   R3  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ,  s    			c         C   sP   | j    } | j   x3 | D]+ } | | k r | j | | |  } q q W| S(   s1   Escape a line with replacements from elyxer.a map(   t   keyst   sortR}   (   Ro   R3  t   replacementst   piecest   piece(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  :  s    
c         C   s   d } t  |  } x | j   s t | j    d k r t t | j     } | d k r| t t | j    d  } n  | d | d d 7} n | | j   7} | j   q W| S(   s/   Escape all Unicode characters to HTML entities.Rz   i   t   0xd835i   s   &#i   t   ;(   R  RJ  RT  R   t   hexR  RU  (   Ro   R3  R   Rx  t	   codepoint(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  D  s    c            s#   g    |  j  |   f d      S(   s2   Search for all embedded containers of a given typec            s     j  |   S(   N(   R   (   R   (   R   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   V  s    (   t   searchprocess(   Ro   R   (    (   R   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   searchallS  s    c         C   s7   |  j  |  } x! | D] } | j j j |  q W| S(   s3   Search for all containers of a type and remove them(   R  R  R   R  (   Ro   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   searchremoveY  s    c            s   |  j    f d   |  d S(   s4   Search for elements of a given type and process themc            s   t  |     S(   N(   R   (   R   (   R   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   b  s    N(   t   locateprocess(   Ro   R   R   (    (   R   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  `  s    c         C   sA   x: |  j  D]/ } | j | |  | |  r
 | |  q
 q
 Wd S(   s3   Search for all embedded containers and process themN(   R   R  (   Ro   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  d  s    c         C   sS   xL |  j  D]A } | |  r2 | j | | |  n  | |  r
 | |  q
 q
 Wd S(   s,   Perform a recursive search in the container.N(   R   R   (   Ro   R   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   k  s
    c         C   s@   d } t  t j  j |   } x | D] } | | j 7} q% W| S(   s0   Extract all text from elyxer.allowed containers.Rz   (   R   R$   R&   R   R)   (   Ro   R   RV   t   constant(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR&   s  s
    c         C   s   | t  |  j  k r d St |  j | d  r3 d Sxc | t  |  j  k  r | |  j |  r t |  j | _ | j j |  j |  |  j j |  q6 W|  j j | |  d S(   s*   Group some adjoining elements into a groupNt   grouped(   Rq   R   R~   R   R  R   Rr  R   (   Ro   R}  Rg   t	   isingroup(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRg   {  s    +c         C   sY   |  j  | } |  j  j |  x5 t | j   d k rT |  j  j | | j  j    q  Wd S(   s)   Remove a container but leave its contentsi    N(   R   Rr  Rq   R   (   Ro   R}  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    i    c         C   sD   t  j d | t |    x" |  j D] } | j | d  q% Wd S(   s   Show in a trees     i   N(   R    R   R   R   t   tree(   Ro   t   levelR   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   | |  j  k r d S|  j  | S(   s)   Get the value of a parameter, if present.N(   RM   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getparameter  s    c         C   s&   |  j  |  } | s g  S| j d  S(   s7   Get the value of a comma-separated parameter as a list.R   (   R  R   (   Ro   R   t	   paramtext(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getparameterlist  s    c         C   s6   |  j  } x& | r1 | j j   r% t S| j  } q Wt S(   s&   Check if the parent's output is empty.(   R  R   R  R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   hasemptyoutput  s    		c         C   s.   |  j  s |  j j S|  j j d t |  j   S(   s   Get a descriptiont   @(   R   R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    	
N(   R   R   R   R   t   partkeyR  R   Rp   R   R  R  R+   R.   R  R  R  R  R  R  R   R&   Rg   R  R  R  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s.   				
													t   BlackBoxc           B   s   e  Z d  Z d   Z RS(   s)   A container that does not output anythingc         C   s%   t    |  _ t   |  _ g  |  _ d  S(   N(   R  R   R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    (   R   R   R   Rp   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t	   LyXFormatc           B   s   e  Z d  Z d   Z RS(   s   Read the lyxformat commandc         C   sp   t  |  j d  } | d k  r9 t j d t |   n  | t  t j d  k rl t j d t |   n  d S(   s   Show warning if version < 276i   i  s(   Warning: unsupported old format version R   s(   Warning: unsupported new format version N(   R   R   R    R   t   strRJ   RK   (   Ro   RK   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   StringContainerc           B   sJ   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s   A container for a single stringc         C   s%   t    |  _ t   |  _ d |  _ d  S(   NRz   (   R  R   R4  R   R)   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s.   |  j  r* |  j |  j   |  _ d |  _  n  d S(   s/   Replace special chars from elyxer.the contents.N(   t   parsedt   replacespecialR)   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    	c         C   s   |  j  | t j  } |  j |  } t j d | k r t |  d k r |  j rl d t |  j  d } n d } t	 j
 | | j    n  | S(   s,   Replace all special chars from elyxer.a lineR   i   s   Unknown command at s   : s   Unknown command: (   R  R+   R.   t
   changelineR$   R)   Rq   R   R   R    R   R  (   Ro   R3  R#   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    %	c         C   sE   |  j  | t j  } t j d | k r, | S|  j  | t j  } | S(   NR   (   R  R+   R,   R$   R)   R-   (   Ro   R3  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
    c         C   s   |  j  S(   s   Return all text.(   R)   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR&     s    c         C   st   d } |  j  r) | d t |  j   7} n  d } t |  j j    d k rS d } n  | d |  j j   d  | d S(   s"   Return a printable representation.R  R  s   ...i   Rz   s    (R   (   R   R   Rq   R)   R  (   Ro   R   t   ellipsis(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    		N(   R   R   R   R   R  Rp   R   R  R  R&   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   					t   Constantc           B   s    e  Z d  Z d   Z d   Z RS(   s   A constant stringc         C   s"   g  |  _  | |  _ t   |  _ d  S(   N(   R   R)   R4  R   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    		c         C   s   d |  j  S(   Ns
   Constant: (   R)   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t
   TaggedTextc           B   s>   e  Z d  Z d Z d   Z e d  Z e d  Z d   Z	 RS(   s   Text inside a tagc         C   s   t  |   |  _ t   |  _ d  S(   N(   R  R   R$  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   	  s    c         C   s%   | |  _  | |  j _ | |  j _ |  S(   s&   Complete the tagged text and return it(   R   R   R%  R&  (   Ro   R   R%  R&  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   complete		  s    	c         C   s"   t  |  } |  j | g | |  S(   s(   Complete the tagged text with a constant(   R  R  (   Ro   R  R%  R&  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    c         C   s8   t  |  j d  s d S|  j j s& d Sd |  j j d S(   s"   Return a printable representation.R%  s   Emtpy tagged texts   Tagged <unknown tag>s   Tagged <R  (   R~   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s
    N(
   R   R   R   R   R   Rp   R   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s   	t   DocumentParametersc           B   sD   e  Z d  Z d Z e Z d Z d Z d Z	 d Z
 d Z e Z e Z RS(   s#   Global parameters for the document.i
   i    N(   R   R   R   R   t   pdftitleR   t   indentstandardt   tocdeptht   startinglevelt   maxdeptht   languaget   bibliographyt   outputchangest   displaymode(    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  "	  s   t   FormulaParserc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   Parses a formulac         C   sr   | j  d |  _ |  j |  } | sk | j   |  j |  } | sk t j d | j   j    d g Sn  | g S(   s   See if the formula is inlinedi   s   Unknown formula type in t   unknown(   R   R   t	   parsetypeR   R    R   R   R  (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   7	  s    

c         C   s   | j    j t j d  d k r& d S| j    j t j d  d k rL d S| j    j t j d  d k rr d S| j    j t j d  d k r d Sd	 S(
   s)   Get the formula type from the first line.t   simplei    t   inlinet   complext   blockt
   unnumberedt   beginbeforet   numberedN(   R   t   findR2   R(   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  C	  s    """"c         C   s~   |  j  |  } x^ | j   j |  j  so | j   j   } t |  d k rb t j d |  n  | j   q W| j   | S(   s   Parse the formula until the endi    s   Unparsed formula line (	   t   parseformulaR   Rr   R
  R  Rq   R    R   R   (   Ro   R   t   formulat   stripped(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  O	  s    
c         C   s  t  j d } | | j   k rm | j   j | d  d } | | k rZ |  j | | |  S|  j | | |  St  j d | j   k r |  j | t  j d t  j d  St  j d } t  j d } | | j   k r| j   j   j |  ru| j   j   } | j |  d j |  } | | d | } t  j d }	 t  j d }
 |	 | d |
 } | |  j | | |  | St	 j
 d	 | d
 | j    d St  j d } t  j d } | | j   k r| | j   k rt  j d } |  j | | |  St	 j
 d | j   d  d S(   s   Parse the formula contentsR  i   R  R  t
   beginafteri    t	   endbeforet   endafters   Missing s    in Rz   t   commandt   brackets   Formula beginning s    is unknown(   R2   R(   R   R   t   parsesinglelinert   parsemultilinerR%   R  R   R    R   (   Ro   R   R  t   restR  R  R   t   endsplitt
   startpieceR  R  t   endpiecet   begincommandt   beginbrackett
   endbracket(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  Z	  s:    $c         C   s   | j    j   } | | k r; t j d | d |  d S| j |  sg t j d | d |  d S| j |  } | | t |  t |  !} | j   | S(   s   Parse a formula in one lines   Line s     does not contain formula start Rz   s   Formula s    does not end with (   R   R  R    R   R   R}  Rq   R   (   Ro   R   t   startR
  R3  R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  }	  s    
c         C   s   d } | j    } | | k rA t j d | j   d |  d S| j |  } | | t |  j   } x7 | j |  s | | d 7} | j   | j    } qm W| | t |   7} | j   | S(   s!   Parse a formula in multiple linesRz   s   Line s     does not contain formula start s   
(   R   R    R   R  R}  Rq   R   R   (   Ro   R   R  R
  R  R3  R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    

(	   R   R   R   R   R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  4	  s   				#	t   MacroParserc           B   s    e  Z d  Z d   Z d   Z RS(   s   A parser for a formula macro.c         C   s   | j  d |  _ d g S(   s   See if the formula is inlinedi   R  (   R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s    c         C   s,   |  j  | |  j j |  j  } | j   | S(   s   Parse the formula until the end(   R  R  R  R
  R   (   Ro   R   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    
(   R   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s   	t
   FormulaBitc           B   s_   e  Z d  Z d
 Z d Z d Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d	   Z RS(   s   A bit of a formulai   Rz   c         C   s   g  |  _  t   |  _ d S(   s6   The formula bit type can be 'alpha', 'number', 'font'.N(   R   R"  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   	  s    	c         C   s   | |  _  |  S(   s!   Set the internal formula factory.(   R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   setfactory	  s    	c         C   s/   |  j  j |  |  j | j 7_ |  | _ d S(   s-   Add any kind of formula bit already processedN(   R   R   R   R  (   Ro   t   bit(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRo  	  s    c         C   sD   |  j  | 7_  | j |  s@ t j d | d | j    n  d S(   s0   Skip a string and add it to the original formulas   String s    not at N(   R   R  R    R   R  (   Ro   R)   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   skiporiginal	  s    c         C   sH   t  |  j  d k r d St g  |  j D] } | j ^ q&  |  _ |  j S(   sD   Compute the size of the bit as the max of the sizes of all contents.i    i   (   Rq   R   t   maxR^   (   Ro   R#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   computesize	  s    (c         C   s   |  j  j |  j  S(   s   Return a copy of itself.(   R  R  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s    c         C   s   |  j  j d |  j S(   s   Get a string representations	    read in (   R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s    N(   R   R   R   R   R   R^   R   Rp   R  Ro  R  R  R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s   						t	   TaggedBitc           B   s,   e  Z d  Z d   Z e d  Z d   Z RS(   s   A tagged string in a formulac         C   s,   t    j |  |  _ |  j t |   |  S(   s   Set the constant and the tag(   R$  R(  R   Ro  t   FormulaConstant(   Ro   R  R%  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    c         C   s%   | |  _  t   j | |  |  _ |  S(   s   Set the constant and the tag(   R   R$  R(  R   (   Ro   R   R%  R&  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    	c         C   s   t    j | d t |  _ |  S(   s4   Set the self-closing tag, no contents (as in <hr/>).R'  (   R$  R(  R   R   (   Ro   R%  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   selfcomplete	  s    (   R   R   R   R  R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s   	R  c           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   A constant string in a formulac         C   s/   t  j |  |  | |  _ d |  _ d |  _ d S(   s   Set the constant stringi   N(   R  Rp   R   R^   R   R   (   Ro   R)   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   	  s    		c         C   s   |  j  S(   s+   Compute the size of the constant: always 1.(   R^   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s    c         C   s   t  |  j  S(   s   Return a copy of itself.(   R  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    
  s    c         C   s   d |  j  S(   s"   Return a printable representation.s   Formula constant: (   R)   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    (   R   R   R   Rp   R  R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  	  s
   			t   RawTextc           B   s    e  Z d  Z d   Z d   Z RS(   s   A bit of text inside a formulac         C   s   | j    j   S(   s   Detect a bit of raw text(   R   R^  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   detect
  s    c         C   s,   | j    } |  j t |   d |  _ d S(   s   Parse alphabetic textR   N(   R_  Ro  R  R   (   Ro   Rx  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parsebit
  s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   	t   FormulaSymbolc           B   s?   e  Z d  Z e j Z e j d Z d   Z d   Z d   Z RS(   s   A symbol inside a formulat
   charactersc         C   s6   | j    t j k r t S| j    t j k r2 t St S(   s   Detect a symbol(   R   R  RH   R   RC   R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s
    c         C   s   | j    t j k r/ |  j | j    |  d S| j    t j k re |  j t j | j    |  d St j d | j    d  d S(   s   Parse the symbolNs   Symbol s
    not found(   R   R  RH   t	   addsymbolRC   R    R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  #
  s    c         C   s0   |  j  | j   |  |  j j t |   d S(   s   Add a symbolN(   R  R   R   R   R  (   Ro   t   symbolRx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  -
  s    (	   R   R   R   R2   RC   RH   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   			
t   FormulaNumberc           B   s    e  Z d  Z d   Z d   Z RS(   s   A string of digits in a formulac         C   s   | j    j   S(   s   Detect a digit(   R   R`  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  5
  s    c            s8     j    f d    } |  j t |   d |  _ d S(   s   Parse a bunch of digitsc              s     j    j   S(   N(   R   R`  (    (   Rx  (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   ;
  s    R   N(   R]  Ro  R  R   (   Ro   Rx  t   digits(    (   Rx  sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  9
  s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  2
  s   	t   Commentc           B   s-   e  Z d  Z e j d Z d   Z d   Z RS(   s*   A LaTeX comment: % to the end of the line.t   commentc         C   s   | j    |  j k S(   s   Detect the %.(   R   R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  D
  s    c         C   s   |  j  | j d  7_  d S(   s   Parse to the end of the line.s   
N(   R   Rl  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  H
  s    (   R   R   R   R2   R(   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ?
  s   	t
   WhiteSpacec           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s"   Some white space inside a formula.c         C   s   | j    j   S(   s   Detect the white space.(   R   Rf  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  O
  s    c         C   s   |  j  | j   7_  d S(   s   Parse all whitespace.N(   R   Ri  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  S
  s    c         C   s   d |  j  d S(   s"   Return a printable representation.s   Whitespace: *R  (   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   W
  s    (   R   R   R   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  L
  s   		t   Bracketc           B   sy   e  Z d  Z e j d Z e j d Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d	   Z d
   Z RS(   s   A {} bracket inside a formulaR  c         C   s   t  j |   d |  _ d S(   s'   Create a (possibly literal) new bracketN(   R  Rp   R   t   inner(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   a
  s    c         C   s   | j  |  j  S(   s   Detect the start of a bracket(   RX  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  f
  s    c         C   s   |  j  | |  j  |  S(   s   Parse the bracket(   t   parsecompletet   innerformula(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  j
  s    c         C   s   |  j  | |  j  |  S(   s   Parse a text bracket(   R  t	   innertext(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   parsetexto
  s    c         C   s   |  j  | |  j  |  S(   s   Parse a literal bracket(   R  t   innerliteral(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parseliteralt
  s    c         C   s   | j  |  j  s8 t j d |  j d | j    d S|  j |  j |  | j |  j  | |  |  j	 | j
 |  j  7_	 |  j   d S(   s   Parse the start and end markss   Bracket should start with s    at N(   RX  R  R    R   R  R   R  Rq  R
  R   Rt  R  (   Ro   Rx  t   innerparser(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  y
  s    "
c         C   s0   x) | j    s+ |  j |  j j |   q Wd S(   s(   Parse a whole formula inside the bracketN(   RJ  Ro  R  t   parseany(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s    c         C   s   t  j j   } | j t  j d  | j t  j d  | j t j  xx | j   s | j   | k r |  j	 |  j
 j |   | j d  r |  j d 7_ q qJ |  j	 t | j     qJ Wd S(   s<   Parse some text inside the bracket, following textual rules.R  R  R   N(   R2   RF   R  R   R(   R  R  RJ  R   Ro  R  R  R  R   R  RU  (   Ro   Rx  t   specialchars(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s    c         C   s   d |  _  xa | j   rl | j   |  j k rl | j   |  j k rT |  j |  q |  j  | j   7_  q W|  j |  j  7_ d S(   sA   Parse a literal inside the bracket, which does not generate HTML.Rz   N(   t   literalRJ  R   R
  R  R  RU  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s    	&(   R   R   R   R2   R(   R  R%   R
  Rp   R  R  R  R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  [
  s   								t   SquareBracketc           B   s1   e  Z d  Z e j d Z e j d Z d   Z RS(   s   A [] bracket inside a formulat   squarebracketc         C   s   t    } |  j | _ | S(   s3   Return a new square bracket with the same contents.(   R  R   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    	(	   R   R   R   R2   R(   R  R%   R
  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   t   MathsProcessorc           B   s    e  Z d  Z d   Z d   Z RS(   sA   A processor for a maths construction inside the FormulaProcessor.c         C   s   t  j d t |    d S(   s$   Process an element inside a formula.s   Unimplemented process() in N(   R    R   R   (   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    c         C   s   d |  j  j S(   s   Return a printable description.s   Maths processor (   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    (   R   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   	t   FormulaProcessorc           B   sJ   e  Z d  Z g  Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   s&   A processor specifically for formulas.c         C   s+   |  j  |  |  j |  |  j |  d S(   s7   Process the contents of every formula bit, recursively.N(   t   processcontentst   processinsidest   traversewhole(   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    c         C   sB   t  | t  s d S| j   x | j D] } |  j |  q' Wd S(   s&   Process the contents of a formula bit.N(   R   R  R   R   R  (   Ro   R  R#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s
    
c         C   sk   t  | t  s d SxQ t | j  D]@ \ } } x$ |  j D] } | j | j |  q9 W|  j |  q# Wd S(   s8   Process the insides (limits, brackets) in a formula bit.N(   R   R  R|  R   t
   processorsR   R  (   Ro   R  R}  R#  t	   processor(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s    c         C   s   d } x |  j |  D]t \ } } | j d k rD |  j | |  n@ | j d k r | r | j d k r | j j d t d   n  | } q Wd S(   s>   Traverse over the contents to alter variables and space units.R   t   fontR   i    u    N(   R   t   traverseR   t	   italicizeR   R   R  (   Ro   R  t   lastR  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s    $c         c   sr   xk | j  D]` } t | d  r9 | j r9 | | j  f Vq
 t | t  r
 x |  j |  D] } | VqX Wq
 q
 Wd S(   sH   Traverse a formula and yield a flattened structure of (bit, list) pairs.R   N(   R   R~   R   R   R  R	  (   Ro   R  R#  t   pair(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR	  
  s    c         C   s/   | j  |  } t   j | g d  | | <d S(   s    Italicize the given bit of text.RC  N(   R}  R  R  (   Ro   R  R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR
  
  s    (
   R   R   R   R  R   R  R  R  R	  R
  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   			
	
		t   Formulac           B   s   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z RS(   s   A LaTeX formulac         C   s%   t    |  _ t   j d  |  _ d  S(   Ns   span class="formula"(   R  R   R$  R(  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   
  s    c         C   s   |  j  d d k r t t _ n t t _ |  j j d t  t j rQ |  j   n6 t j	 rg |  j	   n  t j
 r} |  j
   n
 |  j   d S(   s   Convert the formula to tagsi    R  s   div class="formula"N(   R   R   R  R  R   R   R(  R   R   R   R   t   classic(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   
  s    				c         C   sY   |  j  d d k r+ t   j d  |  _ n t   j d  |  _ t |  j  g |  _ d S(   s   Make the contents for jsMath.i    R  s   div class="math"s   span class="math"N(   R   R$  R(  R   R  R  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   	  s    c         C   s[   d |  j  _ d } |  j d d k r2 | d 7} n  t   j |  j | d t  g |  _ d S(   s   Make the contents for MathJax.s   span class="MathJax_Preview"s   script type="math/texi    R  s   ;mode=displayR{   N(   R   R%  R   R  R  R  R   R   (   Ro   R%  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
    c         C   sL   t  j d t j |  j  } d | d |  j d } t |  g |  _ d S(   sI   Make the contents using Google Charts http://code.google.com/apis/chart/.R   s   <img class="chart" src="s   " alt="s   "/>N(   R2   RI   t   urllibt
   quote_plusR  R  R   (   Ro   t   urlt   img(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s>   t    j |  j  } t   j |  |  | _ | g |  _ d S(   sE   Make the contents using classic output generation with XHTML and CSS.N(   t   FormulaFactoryR  R  R  R   R  R   (   Ro   t   whole(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    	c         C   s   | j  d  r |  j |  np | j  d  r> |  j |  nQ | j  d  r` |  j | d  n/ | j  d  r |  j | d  n | j d  |  j   |  S(   s4   Parse using a parse position instead of self.parser.s   $$t   $s   \(s   \)s   \[s   \]s   Unparseable formula(   R  t   parsedollarblockt   parsedollarinlinet   parseinlinetot   parseblocktoR   R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  &  s    
c         C   s   d g |  _  |  j |  d S(   s   Parse a $...$ formula.R  N(   R   t   parsedollar(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  5  s    c         C   s<   d g |  _  |  j |  | j d  s8 | j d  n  d S(   s   Parse a $$...$$ formula.R  R  s1   Formula should be $$...$$, but last $ is missing.N(   R   R  R  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  :  s    c         C   s0   | j  d  | j d  |  _ | j d  d S(   s   Parse to the next $.R  N(   Rq  Rn  R  Rt  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  A  s    c         C   s    d g |  _  |  j | |  d S(   s   Parse a \(...\) formula.R  N(   R   t	   parseupto(   Ro   Rx  t   limit(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  G  s    c         C   s    d g |  _  |  j | |  d S(   s   Parse a \[...\] formula.R  N(   R   R  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  L  s    c         C   s3   | j  |  | j d    |  _ | j |  d S(   s1   Parse a formula that ends with the given command.c           S   s   t  S(   N(   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   T  s    N(   Rq  R]  R  Rt  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  Q  s    c         C   s+   |  j  r' |  j  j r' d |  j  j d Sd S(   s"   Return a printable representation.s	   Formula (R   s   Unnumbered formula(   R  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   W  s    (   R   R   R   Rp   R   R   R   R   R  R  R  R  R  R  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  
  s   													t   WholeFormulac           B   s    e  Z d  Z d   Z d   Z RS(   s   Parse a whole formulac         C   s   | j    S(   s"   Not outside the formula is enough.(   RJ  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  `  s    c         C   s0   x) | j    s+ |  j |  j j |   q Wd S(   s   Parse with any formula bitN(   RJ  Ro  R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  d  s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ]  s   	R  c           B   s   e  Z d  Z e e e e e e g Z	 e e g Z
 e Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z RS(
   s   Construct bits of formulac         C   s   t    |  _ d S(   s    Initialize the map of instances.N(   R   t	   instances(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   q  s    c         C   s&   | j    r t S|  j |  j |  S(   s   Detect a bit of a given type.(   RJ  R   R   R  (   Ro   R   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   detecttypeu  s    c         C   sA   | |  j  k s |  j  | r6 |  j |  |  j  | <n  |  j  | S(   s"   Get an instance of the given type.(   R  R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   {  s    c         C   s   t  j |  j |   S(   s+   Create a new formula bit of the given type.(   R   R   R  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s*   x# | j    s% |  j |  s d Sq Wd S(   s   Clear any skipped types.N(   RJ  t   skipany(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   clearskipped  s    c         C   s@   x9 |  j  D]. } |  j |  j |  r
 |  j | |  Sq
 Wd S(   s   Skip any skipped types.N(   t   skippedtypesR   R  R  R   (   Ro   Rx  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   sd   x: |  j  |  j D]( } |  j | |  r |  j | |  Sq Wt j d | j    t | j    S(   s.   Parse any formula bit at the current location.s   Unrecognized formula at (	   t   typesR"  R  R  R    R   R  R  RU  (   Ro   Rx  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
    c         C   sB   |  j  |  } d |  j | <| j |  } | r> | j |   S| S(   s#   Parse the given type and return it.N(   R   R   R  R  R  (   Ro   R   Rx  R  t   returnedbit(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   t  |  } |  j t  } | j |  r; | j |  | S| j   s} t j d | j    | j	 t
   j | d   n  | S(   s5   Parse a string of text that contains a whole formula.s   Unknown formula at: s   span class="unknown"(   R  R   R  R  R  RJ  R    R   R  Ro  R  R  (   Ro   R  Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  R  R  R  R  R  R#  R"  R   t   definingRp   R  R   R   R!  R   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  i  s   									t
   Translatorc           B   sM   e  Z d  Z d Z d   Z e e  Z d   Z d   Z d   Z	 d   Z
 RS(   s=   Reads the configuration file and tries to find a translation.c         C   s   |  j  j |  S(   s%   Get the translated message for a key.(   R   t
   getmessage(   R   RA   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   translate  s    c         C   s   d  |  _ t |  _ d  S(   N(   R   t   translationR   t   first(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   s   d |  _ t j s# t j d  d St j t j k rM t j d t j  d St j t j d k rg d St j t j g } y t j	 d d |  |  _	 Wn( t
 k
 r t j d t |   n Xd S(   s/   Find the translation for the document language.s   No language in documentNs   Unknown language t   ent   elyxers   No translation for (   R   t	   langcodesR  R  R    R   Rk   Rl   t   gettextR)  t   IOErrorR   (   Ro   R-  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   findtranslation  s    		c         C   si   |  j  r |  j   t |  _  n  |  j |  } |  j s; | Sy |  j j |  } Wn t k
 rd n X| S(   s-   Get the translated message for the given key.(   R*  R0  R   t   getuntranslatedR)  t   ugettextR/  (   Ro   RA   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR'    s    	
	c         C   s/   | t  j k r$ t j d |  | St  j | S(   s   Get the untranslated message.s   Cannot translate (   Rk   RV   R    R   (   Ro   RA   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR1    s    N(   R   R   R   R   R   R(  R   Rp   R0  R'  R1  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR&    s   				t   NumberCounterc           B   s   e  Z d  Z d) Z d) Z d) Z d) Z d Z e	 j
 d Z d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 d6 g Z d   Z d   Z d   Z d    Z d!   Z d"   Z d#   Z d$   Z d%   Z d&   Z d'   Z d(   Z RS(7   s#   A counter for numbers (by default).t   ABCDEFGHIJKLMNOPQRSTUVWXYZt   symbolst   Mi  t   CMi  t   Di  t   CDi  t   Cid   t   XCiZ   t   Li2   t   XLi(   t   Xi
   t   IXi	   t   Vi   t   IVi   t   Ii   c         C   s   | |  _  d S(   s   Give a name to the counter.N(   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   | |  _  |  S(   s0   Set the counter mode. Can be changed at runtime.(   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setmode  s    	c         C   s   | |  _  d S(   s   Set an initial value.N(   Rv   (   Ro   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   init  s    c         C   s   t  |  j  S(   s$   Get the next value as a text string.(   R   Rv   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR.    s    c         C   s   |  j  |  j  S(   s   Get the next value as a letter.(   t   getsequencet   letters(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getletter   s    c         C   s   |  j  |  j  S(   s   Get the next value as a symbol.(   RE  R5  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getsymbol$  s    c         C   s   | |  j  d t |  S(   s*   Get the next value from elyxer.a sequence.i   (   Rv   Rq   (   Ro   RY   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRE  (  s    c         C   sX   d } |  j  } xB |  j D]7 \ } } | | k r | | | | 7} | | } q q W| S(   s%   Get the next value as a roman number.Rz   (   Rv   t   romannumerals(   Ro   R   R   t   numeralRv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getroman,  s    	c         C   s   |  j  s |  j  d k r# |  j   S|  j  d k r< |  j   S|  j  d k r[ |  j   j   S|  j  d k rt |  j   S|  j  d k r |  j   St j d |  j   |  j   S(	   s8   Get the current value as configured in the current mode.R  R   t   At   aRB  R  s   Unknown counter mode (   s   textR   (   R   R.  RG  R  RK  RH  R    R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getvalue6  s    



c         C   s.   |  j  s d |  _  n  |  j  d 7_  |  j   S(   s@   Increase the current value and get the next value as configured.i    i   (   Rv   RN  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getnextE  s    	c         C   s   d |  _  d S(   s   Reset the counter.i    N(   Rv   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   resetL  s    c         C   s.   d |  j  } |  j r* | d |  j 7} n  | S(   s"   Return a printable representation.s   Counter s	    in mode (   R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   P  s    	N(   R6  i  (   R7  i  (   R8  i  (   R9  i  (   R:  id   (   R;  iZ   (   R<  i2   (   R=  i(   (   R>  i
   (   R?  i	   (   R@  i   (   RA  i   (   RB  i   (   R   R   R   R   R   Rv   R   t   masterRF  RW   RY   R5  RI  Rp   RC  RD  R.  RG  RH  RE  RK  RN  RO  RP  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR3    s,   								
			t   DependentCounterc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s4   A counter which depends on another one (the master).c         C   s   | |  _  |  j  j   |  _ |  S(   s   Set the master counter.(   RQ  RN  R  (   Ro   RQ  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   setmasterZ  s    	c         C   sJ   |  j  |  j j   k r% |  j   n  t j |   } |  j j   |  _  | S(   s8   Increase or, if the master counter has changed, restart.(   R  RQ  RN  RP  R3  RO  (   Ro   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRO  `  s
    c         C   s   |  j  j   d t j |   S(   s8   Get the value of the combined counter: master.dependent.t   .(   RQ  RN  R3  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRN  h  s    (   R   R   R   RS  RO  RN  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRR  W  s   		t   NumberGeneratorc           B   s   e  Z d  Z d Z d Z g  e j d D] Z e j	   ^ q& Z
 g  e j d D] Z e j	   ^ qL Z e   Z d Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sM   A number generator for unique sequences and hierarchical structures. Used in:t   romant   orderedc         C   s   | j  d d  S(   s.   Remove the possible asterisk in a layout type.R  Rz   (   R}   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   deasterisk|  s    c         C   s   |  j  |  S(   s9   Find out if the layout type corresponds to a unique part.(   t   isroman(   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isunique  s    c         C   s   |  j  |  j   |  j k S(   s9   Find out if the layout type should have roman numeration.(   RX  R  t   romanlayouts(   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRY    s    c         C   s   |  j  |  j   |  j k S(   s?   Find out if the layout type corresponds to an (un)ordered part.(   RX  R  t   orderedlayouts(   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isinordered  s    c         C   sV   d | k r t  S|  j |  r# t S|  j |  s6 t  S|  j |  t j k rR t  St S(   sC   Find out if the type for a layout corresponds to a numbered layout.R  (   R   RY  R   R]  t   getlevelR  R  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   isnumbered  s    c         C   s
   d | k S(   s5   Find out if the type contains an asterisk, basically.R  (    (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   isunordered  s    c         C   sm   |  j  |  r d S|  j |  s7 t j d |  d S|  j |  j   } |  j j |  d } | t j	 S(   s0   Get the level that corresponds to a layout type.i    s   Unknown layout type i   (
   RZ  R]  R    R   RX  R  R\  R}  R  R  (   Ro   R   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR^    s    c         C   s/   t  j r" |  j |  d k r" d S|  j |  S(   s4   Obtain the type for the part: without the asterisk, i   t   Appendix(   RU  t   appendixR^  RX  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getparttype  s    c         C   s   |  j  |  j   S(   s$   Generate a number for a layout type.(   t
   getcounterRO  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   generate  s    c         C   s?   | j    } | |  j k r4 |  j |  |  j | <n  |  j | S(   s#   Get the counter for the given type.(   R  t   countersR   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRd    s    c         C   s   |  j  |  rf |  j |  d k rf |  j j |  } |  j | d } |  j |  } |  j | |  St |  } |  j |  r | j d  n  | S(   s$   Create a counter for the given type.i   RB  (	   R_  R^  R\  R}  Rd  t   createdependentR3  RY  RC  (   Ro   R   R}  t   aboveRQ  t   counter(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    $c         C   sG   | |  j  k s  |  j  | j r< |  j | |  |  j  | <n  |  j  | S(   sD   Get (or create) a counter of the given type that depends on another.(   Rf  RQ  Rg  (   Ro   R   RQ  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getdependentcounter  s     c         C   s   t  |  j |  S(   s,   Create a dependent counter given the master.(   RR  RS  (   Ro   R   RQ  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRg    s    c         C   s?   |  j  t j } |  j |  } | j d  j   t t _ d S(   s   Start appendices here.RL  N(	   R\  R  R  Rd  RC  RP  R   RU  Rb  (   Ro   t	   firsttypeRi  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   startappendix  s    N(   R   R   R   R   t	   chapteredt	   generatorRW   RX   t   xR  R[  R\  R   Rf  Rb  RX  RZ  RY  R]  R_  R`  R^  Rc  Re  Rd  R   Rj  Rg  Rl  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRU  l  s*   &&														t   ChapteredGeneratorc           B   s   e  Z d  Z d   Z RS(   s1   Generate chaptered numbers, as in Chapter.Number.c         C   sD   t  j d k r t j j |  S|  j d  } |  j | |  j   S(   sB   Generate a number which goes with first-level numbers (chapters). i    t   Chapter(   R  R  RU  Rn  Re  Rd  Rj  RO  (   Ro   R   t   chapter(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRe    s    (   R   R   R   Re  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp    s   t   ContainerSizec           B   s   e  Z d  Z d Z d Z d Z d Z d Z d d d  Z	 d d d  Z
 d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z RS(   s   The size of a container.c         C   s$   |  j  d |  |  j  d |  |  S(   s*   Set the proper size with width and height.t   widtht   height(   t   setvalue(   Ro   Rt  Ru  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s$   |  j  d |  |  j  d |  |  S(   s   Set max width and/or height.t   maxwidtht	   maxheight(   Rv  (   Ro   Rw  Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setmax  s    c         C   sA   |  j  | d  |  j  | d  |  j  | d  |  j |  |  S(   s*   Read some size parameters off a container.Rt  Ru  t   scale(   t   setparametert   checkvalidheight(   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   readparameters  s
    c         C   s#   | j  |  } |  j | |  d S(   s=   Read a size parameter off a container, and set it if present.N(   R  Rv  (   Ro   R   R   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR{    s    c         C   s,   |  j  |  } | r( t |  | |  n  d S(   s6   Set the value of a parameter name, only if it's valid.N(   t   processparameterRt   (   Ro   R   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRv    s    c         C   sL   | j  d  } |  j rH |  j |  j  d k rH | d k rH d |  _ n  d S(   s;   Check if the height parameter is valid; otherwise erase it.t   height_specialR   t   totalheightN(   R  Ru  t   extractnumberR   (   Ro   R   t   heightspecial(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR|    s    -c         C   s`   | s
 d S|  j |  d k r# d Sx6 t j d D]' } | | k r1 | j | d  } q1 q1 W| S(   s&   Do the full processing on a parameter.t   0t   ignoredtextsRz   N(   R   R  RZ   R^   R}   (   Ro   Rv   t   ignored(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR~    s    c         C   sd   d } t  } xQ | D]I } | j   r2 | | 7} q | d k rX | rX | | 7} t } q | Sq W| S(   s+   Extract the first number in the given text.Rz   RT  (   R   R`  R   (   Ro   R  R   t   decimalt   char(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  (  s    
	c         C   s   | rD t  |  d |  _ |  j rD |  j rD |  j |  |  _ qD n  | r t  |  d |  _ |  j r |  j r |  j |  |  _ q n  |  j r |  j r d |  _ n  |  j r |  j r d |  _ n  d S(   s-   Check image dimensions, set them if possible.t   pxt   autoN(   R   Rw  Rz  Rt  t
   scalevalueRx  Ru  (   Ro   Rt  Ru  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   checkimage6  s    c         C   s+   | t  |  j  d } t t  |   d S(   sF   Scale the value according to the image scale and return it as unicode.id   R  (   R   Rz  R   (   Ro   Rv   t   scaled(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  E  s    c         C   sQ   |  j  s d Sd |  j  k r  d S|  j  } d |  _  |  j d k rM d |  _ n  | S(   s?   Remove percent width if present, to set it at the figure level.t   %R  N(   Rt  R   Ru  (   Ro   Rt  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   removepercentwidthJ  s    			c         C   s   t  | j t  s, t j d t |   n  |  j rX |  j rX |  j rX |  j	 rX d Sd } | |  j
 d  7} | |  j
 d  7} | |  j
 d  7} | |  j
 d  7} | d d	 k r | d  } n  | d
 7} | j j | 7_ d S(   s1   Add the proper style attribute to the output tag.s   No tag to add style, in Ns    style="Rt  Rw  Ru  Rx  iR   R{   (   R   R   R$  R    R   R   Rt  Ru  Rw  Rx  t   styleparameterR%  (   Ro   R   R%  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   addstyleV  s    (
c         C   s5   t  |  |  } | r1 | j d d  d | d Sd S(   s%   Get the style for a single parameter.R  s   max-s   : s   ; Rz   (   R   R}   (   Ro   R   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  g  s    N(   R   R   R   R   Rt  Ru  Rw  Rx  Rz  R   Ry  R}  R{  Rv  R|  R~  R  R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRs    s&   										t   QuoteContainerc           B   s    e  Z d  Z d   Z d   Z RS(   s   A container for a pretty quotec         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R!  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   s  s    c         C   sd   |  j  d |  _ |  j t j k rJ t j d |  j d  d g |  _ d St j |  j g |  _ d S(   s   Process contentsi   s   Quote type s
    not foundR{   N(   R   R   RZ   R\   R    R   R/   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   w  s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  p  s   	t   LyXLinec           B   s    e  Z d  Z d   Z d   Z RS(   s
   A Lyx linec         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R!  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   d g |  _  d  S(   Ns   <hr class="line" />(   R/   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   EmphaticTextc           B   s   e  Z d  Z d   Z RS(   s   Text with emphatic modec         C   s   d |  j  _ d  S(   NRC  (   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t
   ShapedTextc           B   s   e  Z d  Z d   Z RS(   s   Text shaped (italic, slanted)c         C   sd   |  j  d |  _ |  j t j k rJ t j d |  j  d  d |  j _ d  St j |  j |  j _ d  S(   Ni   s   Unrecognized shape t   span(   R   R   Rc   Rj   R    R   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   VersalitasTextc           B   s   e  Z d  Z d   Z RS(   s   Text in versalitasc         C   s   d |  j  _ d  S(   Ns   span class="versalitas"(   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t	   ColorTextc           B   s   e  Z d  Z d   Z RS(   s   Colored textc         C   s+   |  j  d |  _ d |  j d |  j _ d  S(   Ni   s   span class="R{   (   R   R   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   SizeTextc           B   s   e  Z d  Z d   Z RS(   s
   Sized textc         C   s+   |  j  d |  _ d |  j d |  j _ d  S(   Ni   s   span class="R{   (   R   R^   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   BoldTextc           B   s   e  Z d  Z d   Z RS(   s	   Bold textc         C   s   d |  j  _ d  S(   Nt   b(   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t
   TextFamilyc           B   s   e  Z d  Z d   Z RS(   s,   A bit of text from elyxer.a different familyc         C   s]   |  j  d |  _ |  j t j k rC t j d t  d |  j _ d St j |  j |  j _ d S(   s   Parse the type of familyi   s   Unrecognized family R  N(   R   R   Rc   Re   R    R   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   Hfillc           B   s   e  Z d  Z d   Z RS(   s   Horizontall fillc         C   s   d |  j  _ d  S(   Ns   span class="hfill"(   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t
   BarredTextc           B   s   e  Z d  Z d   Z RS(   s   Text with a bar somewherec         C   s`   |  j  d |  _ |  j t j k rF t j d |  j  d |  j _ d St j |  j |  j _ d S(   s   Parse the type of bari   s   Unknown bar type R  N(   R   R   Rc   Rd   R    R   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   LangLinec           B   s   e  Z d  Z d   Z RS(   s    A line with language informationc         C   s   |  j  d |  _ d  S(   Ni   (   R   t   lang(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   InsetLengthc           B   s   e  Z d  Z d   Z RS(   s!   A length measure inside an inset.c         C   s   |  j  d |  _ d  S(   Ni   (   R   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   Spacec           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s   A space of several typesc         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R!  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   |  j  d |  _ |  j t j k rF t j d |  j  d g |  _ d  St j |  j g |  _ |  j   } | sr d  St   j	 d t
  |  _ t   j |  j |   d  S(   Ni   s   Unknown space type R   s   span class="hspace"(   R   R   RZ   R[   R    R   R/   t	   getlengthR$  R(  R   R   Rs  R   R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    c         C   s>   t  |  j  d k s, t |  j d t  r0 d S|  j d j S(   s<   Get the space length from elyxer.the contents or parameters.i    N(   Rq   R   R   R  R   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    ,(   R   R   R   Rp   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   		t   VerticalSpacec           B   s    e  Z d  Z d   Z d   Z RS(   s(   An inset that contains a vertical space.c         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R!  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   sc   |  j  d |  _ |  j t j k rI t   j d |  j d t  |  _ d St j |  j g |  _ d S(   s   Set the correct tagi   s"   div class="vspace" style="height: s   ;"N(	   R   R   RZ   R_   R$  R(  R   R   R/   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR      s
    #(   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   Alignc           B   s    e  Z d  Z d   Z d   Z RS(   s   Bit of aligned textc         C   s%   t    |  _ t   j t  |  _ d  S(   N(   R  R   R$  R)  R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   d |  j  d d |  j _ d  S(   Ns   div class="i   R{   (   R   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   Newlinec           B   s    e  Z d  Z d   Z d   Z RS(   s	   A newlinec         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R!  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s   d g |  _  d S(   s   Process contentss   <br/>
N(   R/   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   NewPagec           B   s   e  Z d  Z d   Z RS(   s
   A new pagec         C   s   d g |  _  d S(   s   Process contentss   <p><br/>
</p>
N(   R/   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR      s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t	   Separatorc           B   s   e  Z d  Z d   Z RS(   s;   A separator string which is not extracted by extracttext().c         C   s%   t    |  _ g  |  _ | g |  _ d  S(   N(   R!  R   R   R/   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   '  s    	(   R   R   R   Rp   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  $  s   t	   StrikeOutc           B   s   e  Z d  Z d   Z RS(   s   Striken out text.c         C   s   d |  j  _ d S(   s   Set the output tag to strike.t   strikeN(   R   R%  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   /  s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ,  s   t   StartAppendixc           B   s   e  Z d  Z d   Z RS(   s   Mark to start an appendix here.c         C   s   t  j j   d S(   sD   Activate the special numbering scheme for appendices, using letters.N(   RU  Rn  Rl  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   7  s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  3  s   t   Linkc           B   sq   e  Z d  Z d Z d Z d Z d Z d Z d Z	 d Z
 d   Z d d d d d  Z d   Z d   Z d   Z RS(   s&   A link to another part of the documentc         C   s=   g  |  _  t   |  _ t   |  _ t j r9 t j |  _ n  d S(   s.   Initialize the link, add target if configured.N(   R   R  R   t
   LinkOutputR   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   K  s
    		c         C   s^   t  |  g |  _ | r$ | |  _ n  | r6 | |  _ n  | rH | |  _ n  | rZ | |  _ n  |  S(   s   Complete the link.(   R  R   t   anchorR  R   R   (   Ro   R  R  R  R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  S  s    c         C   sa   |  j  s d Sd |  _ |  j  j r8 d |  j  j |  _ n  |  j  j r] |  j  j |  j |  _ n  d S(   s8   Use the destination link to fill in the destination URL.NRz   t   #(   t   destinationR  R  t   page(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   computedestination`  s    		c         C   s   | |  _  |  | _  d S(   sE   Set another link as destination, and set its destination to this one.N(   R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setmutualdestinationj  s    	c         C   sD   d } |  j  r# | d |  j  7} n  |  j r@ | d |  j 7} n  | S(   s"   Return a printable representation.R  s    #s    to (   R  R  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   o  s    		N(   R   R   R   R   R  R  R   R  R   R  R   Rp   R  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  @  s   		
	t   URLc           B   s   e  Z d  Z d   Z RS(   s   A clickable URLc         C   s   |  j  |  j d   } | |  _ |  j d  } | rO |  j  |  | |  _ n  |  j d  } | sm | } n  t |  g |  _ d S(   s   Read URL from elyxer.parametersR   R   R   N(   R  R  R  R  R   (   Ro   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   {  s    		(   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  x  s   t   FlexURLc           B   s   e  Z d  Z d   Z RS(   s   A flexible URLc         C   s   |  j    |  _ d S(   s   Read URL from elyxer.contentsN(   R&   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   R  c           B   s   e  Z d  Z d   Z RS(   s#   A link pointing to some destinationc         C   s   | j  j } | j r! | j } n  d | d } | j rP | d | j d 7} n  | j rf | j   n  | j r | d | j d 7} n  | j r | d | j d 7} n  | j r | d | j d 7} n  t	   j
 |  j |  S(   s   Get the HTML code for the links	   a class="R{   s    name="s    href="s	    target="s    title="(   R   R   R   R  R  R  R  R   R   R$  R(  R  (   Ro   t   linkR   R%  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    						(   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   Postprocessorc           B   s8   e  Z d  Z g  Z d   Z d   Z d   Z d   Z RS(   s,   Postprocess a container keeping some contextc         C   s+   t  t j |   |  _ d  |  _ d  |  _ d  S(   N(   t	   StageDictR  t   stagesR   R   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    	c         C   s8   |  j  |  j  |  j |  } |  j |  _ | |  _ | S(   s)   Postprocess a container and its contents.(   t   postrecursiveR   t   postcurrentR  (   Ro   R  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   postprocess  s
    	c         C   s   t  | d  s d St | j  d k r, d St  | d  rK | j sK d Sn  t   } g  } x6 | j D]+ } | j |  } | rd | j |  qd qd Wx9 t d  D]+ } | j d  } | r | j |  q q W| | _ d S(   s.   Postprocess the container contents recursivelyR   Ni    R  i   (   R~   Rq   R   R  R  R   RA  R   (   Ro   R   t   postprocessorR   R#  t   postRC  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s$    		c         C   s;   |  j  j |  j  } | s" |  j S| j |  j |  j |  S(   sB   Postprocess the current element taking into account next and last.(   R  t   getstageR   R  R  (   Ro   R  t   stage(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  Rp   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   			R  c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s/   A dictionary of stages corresponding to classesc         C   sA   |  j  | |  } t g  | D] } | j | f ^ q  |  _ d S(   sG   Instantiate an element from elyxer.each class and store as a dictionaryN(   t   instantiateR   t   processedclasst	   stagedict(   Ro   t   classesR  R  Ro  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   sJ   g  | D] } | j  |  ^ q } x! | D] } | j   | | _ q) W| S(   s-   Instantiate an element from elyxer.each class(   R   Rp   R  (   Ro   R  R  Ro  R  R#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
    "
c         C   s$   | j  |  j k r d S|  j | j  S(   s=   Get the stage for a given element, if the type is in the dictN(   R   R  R   (   Ro   R#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   Rp   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   		t   Labelc           B   sV   e  Z d  Z e   Z d Z d   Z d   Z d d  Z	 d   Z
 d   Z d   Z RS(	   s   A label to be referencedc         C   s   t  j |   d  |  _ d  S(   N(   R  Rp   R   t   lastnumbered(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    c         C   s/   |  j  d  } |  j d |  t j |  _ d S(   s   Process a label container.R   R   N(   R  R   R  t
   lastlayoutR  (   Ro   RA   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    R  c         C   sf   | |  _  |  j | d | d | |  t j | <| t j k rb x! t j | D] } |  | _ qL Wn  |  S(   s!   Create the label for a given key.R  R   (   RA   R  R  t   namest	   Referencet
   referencesR  (   Ro   R  RA   R   t	   reference(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    	c         C   s)   |  j  |   } | r% | j r% | j Sd S(   s8   Get the part key for the latest numbered container seen.Rz   (   R  R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   findpartkey	  s    c         C   s:   | j  r | S| j s* |  j r& |  j Sd S|  j | j  S(   s)   Get the numbered container for the label.N(   R  R  R  R   R  (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    			c         C   s   t  |  d  s d Sd |  j S(   s"   Return a printable representation.RA   s   Unnamed labels   Label (   R~   RA   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    N(   R   R   R   R   R  R   R  Rp   R   R   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   			
		
R  c           B   sA   e  Z d  Z e   Z d Z d   Z d   Z d   Z d   Z	 RS(   s   A reference to a label.t   nonec         C   s   |  j  d  |  _ |  j t j k r@ d |  _ t j |  j } n$ d |  _ t   j d |  j d  } | |  _ |  j   |  j t j	 k r g  t j	 |  j <n  t j	 |  j j
 |   d S(   s%   Read the reference and set the arrow.R  u   ↑u   ↓R   t   prerefN(   R  RA   R  R  t	   directionR  R  t   formatcontentsR  R  R   (   Ro   t   label(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   &  s    			
c         C   s  |  j  d  } | s d } n  d |  _ | t j k rI t j | |  _ n t j d |  |  j d |  j  |  j d d  |  j d t j	 d   |  j
 j   } |  j d | o | j  |  j d	 | o | j  d
 |  j k s | s | j r9d
 |  j k r t j d t |   n  t |  j  g |  _ d S|  j j d
  } t | d  g |  _ x: | d D]. } |  j | j 7_ |  j j t |   qlWd S(   s   Format the reference contents.t   LatexCommandt   refu   ↕s   Unknown reference format R  R   s   on-pageR  u   ¶R  s   No title in Ni    i   (   R  t	   formattedRZ   R]   R    R   R}   R  R&  R(  R  R  R   t   tocentryt   titlecontentsR   R  R   R   R   (   Ro   t	   formatkeyR  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  5  s.    		 c         C   s>   | |  j  k r d S| s" d } n  |  j  j | |  |  _  d S(   s2   Replace a key in the format template with a value.NRz   (   R  R}   (   Ro   RA   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR}   Q  s
    	c         C   s   d |  j  S(   s"   Return a printable representation.s
   Reference (   RA   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   Y  s    (
   R   R   R   R   R  RA   R   R  R}   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s   				t   FormulaCommandc           B   sf   e  Z d  Z g  Z e j d Z d	 Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z RS(
   s    A LaTeX command inside a formulaR  c         C   s   | j  t j  S(   s   Find the current command.(   RX  R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  f  s    c         C   s   |  j  |  } |  j | |  } | r+ | S| j d  sI | j d  rh |  j | |  } | rh | Sn  |  j j s t j d |  n  t   j	 d  |  _
 |  j t |   d S(   s   Parse the command.s   \ups   \Ups   Unknown command s   span class="unknown"N(   t   extractcommandt   parsewithcommandRr   t   parseupgreekR  R%  R    R   R$  R(  R   Ro  R  R   (   Ro   Rx  R  R  t   upgreek(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  j  s    c         C   s:   x3 t  j D]( } | | j k r
 |  j | | |  Sq
 Wd S(   s0   Parse the command type once we have the command.N(   R  R#  t
   commandmapt   parsecommandtypeR   (   Ro   R  Rx  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  z  s    c         C   s<   |  j  j |  } | j |  | j |  } | r8 | S| S(   s   Parse a given command type.(   R  R   t
   setcommandR  (   Ro   R  R   Rx  R  t   returned(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   | j  t j  s* | j d t j  d S| j   rC |  j |  S| j   j   ry t j | j   } | j  d  | St j | j	   S(   s5   Extract the command from elyxer.the current position.s   Missing command start NR  (
   R  R  R  R   RJ  t   emptycommandR   R^  R_  RU  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   sJ   d } | j    s? | j   } | r? | j |  r? | } q? n  t j | S(   sq   Check for an empty command: look for command disguised as ending.
    Special case against '{ \{ \} }' situation.Rz   (   RW  Rv  R  R  R  (   Ro   Rx  R  R
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   t  |  d k  r d S| j d  r6 d | d } nF | j d  rg d | d d !j   | d } n t j d |  d S|  j | |  } | r d | _ n  | S(	   s   Parse the Greek \up command..i   s   \ups   \i   s   \Ups   Impossible upgreek command: NR  (	   Rq   R   Rr   R  t   upperR    R   R  R   (   Ro   R  Rx  t	   upcommandR  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    "N(   R   R   R   R#  R2   R(   R  R   R  R  R  R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  _  s   							
t
   CommandBitc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s%   A formula bit that includes a commandc         C   s;   | |  _  |  j r7 |  j | 7_ |  j |  j  |  _ n  d S(   s   Set the command in the bitN(   R  R  R   t
   translated(   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    		c         C   sC   |  j  j |  | j   r  d S|  j  j |  } |  j |  | S(   s)   Parse a parameter at the current positionN(   R  R!  RJ  R   R  Ro  (   Ro   Rx  t	   parameter(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   sO   |  j  j |  |  j  j t |  s) d S|  j  j t |  } |  j |  | S(   s   Parse a square bracketN(   R  R!  R  R  R   R  Ro  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parsesquare  s    c         C   s   |  j  j |  |  j  j t |  sV | j   sL t j d | j    d S| j	   St   j
 |  j   } |  j | j |   | j S(   s   Parse a literal bracket.s   No literal parameter found at: N(   R  R!  R  R  Rg  R    R   R  R   Rh  R  Ro  R  R  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    
c         C   s[   |  j  j |  |  j  j t |  s) d St   j |  j   } |  j | j |   | j S(   s!   Parse a square bracket literally.N(	   R  R!  R  R  R   R  Ro  R  R  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   parsesquareliteral  s    c         C   sl   |  j  j |  |  j  j t |  s= t j d |  j  d St   j |  j   j	 |  } |  j
 |  | S(   s   Parse a text parameter.s   No text parameter for N(   R  R!  R  R  R    R   R  R   R  R  Ro  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (	   R   R   R   R  R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   								t   EmptyCommandc           B   s    e  Z d  Z e j Z d   Z RS(   s%   An empty command (without parameters)c         C   s   t  |  j  g |  _ d S(   s"   Parse a command without parametersN(   R  R  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R2   R-   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   SpacedCommandc           B   s    e  Z d  Z e j Z d   Z RS(   s<   An empty command which should have math spacing in formulas.c         C   s!   t  d |  j d  g |  _ d S(   s4   Place as contents the command translated and spaced.u    N(   R  R  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R2   RE   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   AlphaCommandc           B   s    e  Z d  Z e j Z d   Z RS(   s8   A command without paramters whose result is alphabeticalc         C   s   t  j |  |  d |  _ d S(   s'   Parse the command and set type to alphaR   N(   R  R  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R2   R3   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   OneParamFunctionc           B   s/   e  Z d  Z e j Z e Z d   Z d   Z	 RS(   s   A function of one parameterc         C   s3   t    j |  j  |  _ |  j |  |  j   d S(   s#   Parse a function with one parameterN(   R$  R(  R  R   R  t   simplifyifpossible(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   sD   |  j  |  j k r@ t   |  _ |  j |  j  g |  _ t |  _ n  d S(   s&   Try to simplify to a single character.N(   R   R  R!  R   R/   R   t
   simplified(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (
   R   R   R   R2   RD   R  R   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
   		t   SymbolFunctionc           B   s)   e  Z d  Z e j Z d   Z d   Z RS(   s>   Find a function which is represented by a symbol (like _ or ^)c         C   s   | j    t j k S(   s   Find the symbol(   R   R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  #  s    c         C   sL   |  j  | j    | j |  j  t   j |  j  |  _ |  j |  d S(   s   Parse the symbolN(	   R  R   Rk  R  R$  R(  R  R   R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  '  s    (   R   R   R   R2   RF   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   		t   TextFunctionc           B   s)   e  Z d  Z e j Z d   Z d   Z RS(   s-   A function where parameters are read as text.c         C   s)   t    j |  j  |  _ |  j |  d S(   s   Parse a text parameterN(   R$  R(  R  R   R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  3  s    c         C   s   d |  _  d S(   s   Set the type to fontR  N(   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   8  s    (   R   R   R   R2   RG   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  .  s   		t   LabelFunctionc           B   s)   e  Z d  Z e j Z d   Z d   Z RS(   s   A function that acts as a labelc         C   s   |  j  |  |  _ d S(   s   Parse a literal parameterN(   R  RA   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  A  s    c         C   sP   d |  _  t   j d |  j d d |  _ |  j g |  _ |  j t j |  j <d S(   s&   Add an anchor with the label contents.R  R   R   t   eqnumberN(   R   R  R   RA   R  R   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   E  s    	!(   R   R   R   R2   R?   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  <  s   		t   FontFunctionc           B   s    e  Z d  Z e j Z d   Z RS(   s1   A function of one parameter that changes the fontc         C   s   d |  _  |  j   d S(   s.   Simplify if possible using a single character.R  N(   R   R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   R  s    	(   R   R   R   R2   R<   R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  M  s   	t	   BigSymbolc           B   s2   e  Z d  Z e j Z d   Z d   Z d   Z RS(   s   A big symbol generator.c         C   s   | |  _  d S(   s   Create the big symbol.N(   R  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   m  s    c         C   s@   |  j  |  j k r |  j  g S|  j   r2 |  j  g S|  j |  j  S(   s   Get an array with all pieces.(   R  R5  t
   smalllimit(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getpiecesq  s
    

c         C   s4   t  j s t St |  j |  j  d k r- t St j S(   s7   Decide if the limit should be a small, one-line symbol.i   (   R  R  R   Rq   R5  R  R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  y  s
    	(	   R   R   R   R2   R6   R5  Rp   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  h  s
   			t
   BigBracketc           B   sY   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z	 d	   Z
 RS(
   s   A big bracket generator.t   lc         C   sJ   | |  _  | |  _ | |  _ d |  _ | t j k rF t j | |  _ n  d S(   s(   Set the size and symbol for the bracket.N(   R^   R   t	   alignmentR   R  R2   R5   (   Ro   R^   R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp     s    				c         C   s,   t  |  d t t |  j    } | |  S(   s%   Return the nth piece for the bracket.t   getpiece(   R   R   Rq   R  (   Ro   R}  t   function(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    "c         C   s   |  j  d S(   s1   Return the only piece for a single-piece bracket.i    (   R  (   Ro   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getpiece1  s    c         C   s@   | d k r |  j  d S| |  j d k r5 |  j  d S|  j  d S(   sG   Get the nth piece for a 3-piece bracket: parenthesis or square bracket.i    i   i(   R  R^   (   Ro   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getpiece3  s
    c         C   sb   | d k r |  j  d S| |  j d k r5 |  j  d S| |  j d d k rW |  j  d S|  j  d S(   s7   Get the nth piece for a 4-piece bracket: curly bracket.i    i   i   i   (   R  R^   (   Ro   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   getpiece4  s    c         C   s3   |  j  |  } d |  j d } t   j | |  S(   s'   Get the bracket piece as an array cell.s   span class="bracket align-R{   (   R  R  R  R  (   Ro   R}  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getcell  s    c         C   s   |  j  d k s |  j r# |  j   Sg  } xE t |  j   D]4 } |  j |  } | j t   j | g d   q9 Wt   j | d  g S(   s3   Get the bracket as an array or as a single bracket.i   s   span class="arrayrow"s   span class="array"(   R^   R  t   getsinglebracketRA  R  R   R  R  (   Ro   t   rowsR}  t   cell(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getcontents  s    
#c         C   s>   |  j  d k r% t   j d d  g St   j |  j  d  g S(   s$   Return the bracket as a single sign.RT  Rz   s   span class="emptydot"s   span class="symbol"(   R   R  R  (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   Rp   R  R  R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   					
		
t   FormulaEquationc           B   s   e  Z d  Z d Z d   Z RS(   s   A simple numbered equation.t   equationc         C   s,   t    |  _ |  j |  j j t |   d S(   s   Parse the arrayN(   R"  R   Ro  R  R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   t   FormulaCellc           B   s    e  Z d  Z d   Z d   Z RS(   s   An array cell inside a rowc         C   s-   | |  _  t   j d | d t  |  _ |  S(   Ns   span class="arraycell align-R{   (   R  R$  R(  R   R   (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setalignment  s    	 c         C   s@   |  j  j |  | j   r  d  S|  j |  j  j t |   d  S(   N(   R  R!  RJ  Ro  R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t
   FormulaRowc           B   s6   e  Z d  Z e j d Z d   Z d   Z d   Z RS(   s   An array row inside an arrayt   cellseparatorc         C   s%   | |  _  t   j d t  |  _ |  S(   Ns   span class="arrayrow"(   t
   alignmentsR$  R(  R   R   (   Ro   R	  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   setalignments  s    	c         C   s   d } | j  |  j d t xS | j   sq |  j |  } | j |  |  j |  | d 7} | j |  j  q Wt |  j	  d k r t
   |  _ n  d S(   s   Parse a whole rowi    Rp  i   N(   Rq  R  R   RJ  t
   createcellR  Ro  R  Rq   R   R   R   (   Ro   Rx  R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    
c         C   s3   |  j  | t |  j   } |  j j t  j |  S(   s4   Create the cell that corresponds to the given index.(   R	  Rq   R  R   R  R  (   Ro   R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (	   R   R   R   R2   R4   R  R
  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
   		t   MultiRowFormulac           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   A formula with multiple rows.c         C   sr   g  |  _  t } xJ |  j |  D]9 } | r4 t } n
 |  j   | j |  |  j |  q Wt |  j   |  _ d S(   s,   Parse all rows, finish when no more row endsN(	   R   R   t   iteraterowsR   t   addemptyR  t   addrowRq   R^   (   Ro   Rx  R*  t   row(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   parserows  s    		
c         c   s   t  j d } xk t rz | j | t  |  j j t  } | j |  j  V| j	 |  rs |  j
 | j |  7_
 q d Sq Wd S(   s0   Iterate over all rows, end when no more row endst   rowseparatorN(   R2   R4   R   Rq  R  R   R  R
  R	  RX  R   Rt  (   Ro   Rx  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    	c         C   s   |  j  j t  j |  j  } xS t |  j d j  D]; \ } } | j |  } | j	 t
 d   | j	 |  q5 W|  j |  d S(   s   Add an empty row.iu    N(   R  R   R  R
  R	  R|  R   R   R  Ro  R  R  (   Ro   R  R}  t   originalcellR  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    #c         C   s!   |  j  j |  |  j |  d S(   s2   Add a row to the contents and to the list of rows.N(   R   R   Ro  (   Ro   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
   				t   FormulaArrayc           B   s&   e  Z d  Z d Z d   Z d   Z RS(   s   An array within a formulaR4   c         C   s6   t    j d t  |  _ |  j |  |  j |  d S(   s   Parse the arrays   span class="array"N(   R$  R(  R   R   t   parsealignmentsR  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  '  s    c         C   sg   d |  _  |  j |  } | r* | |  _  n  |  j |  } g  |  _ x | D] } |  j j |  qI Wd S(   s   Parse the different alignmentsR   N(   t   valignR  R  R	  R   (   Ro   Rx  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  -  s    		(   R   R   R   R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  "  s   	t   FormulaMatrixc           B   s   e  Z d  Z d Z d   Z RS(   s'   A matrix (array with center alignment).t   matrixc         C   s>   t    j d t  |  _ d |  _ d g |  _ |  j |  d S(   s(   Parse the matrix, set alignments to 'c'.s   span class="array"R   N(   R$  R(  R   R   R  R	  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ?  s    	(   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  :  s   t   FormulaCasesc           B   s   e  Z d  Z d Z d   Z RS(   s   A cases statementt   casesc         C   s   t    |  _ d d g |  _ |  j |  xN |  j D]C } x: | j D]/ } | j j d t  | j j t d   qB Wq2 Wt	   j
 |  j d t  } t t |  j  d d  } | j   | g |  _ d S(   s   Parse the casesR  s   span class="case align-l"u    s   span class="bracketcases"t   {N(   R"  R   R	  R  R   R(  R   R   R  R  R  R  Rq   R  (   Ro   Rx  R  R  R4   t   brace(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  K  s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  F  s   t   EquationEnvironmentc           B   s   e  Z d  Z d   Z RS(   s;   A \begin{}...\end equation environment with rows and cells.c         C   s   t    j d t  |  _ |  j j d d  } | t j k rO t j | |  _ n  t	 j
 d |  j  d g |  _ |  j |  d S(   s   Parse the whole environment.s   span class="environment"R  Rz   s   Unknown equation environment R  N(   R$  R(  R   R   R  R}   R2   R;   R	  R    R   R  (   Ro   Rx  t   environment(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  [  s    (   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  X  s   t   BeginCommandc           B   sF   e  Z d  Z i d e j d 6Z e e e e	 g Z
 d   Z d   Z RS(   sE   A \begin{}...\end command and what it entails (array, cases, aligned)Rz   R   c         C   s   |  j  |  } |  j |  } t j d d | d } | j |  | j |  |  j |  |  j | j |  7_ | j	 |  _	 d S(   s   Parse the begin commandt   endR  t   }N(
   R  t   findbitR2   R4   Rq  R  Ro  R   Rt  R^   (   Ro   Rx  R  R  R
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  m  s    c         C   s^   x< t  j D]1 } | j d d  | j k r
 |  j j |  Sq
 W|  j j t  } | | _ | S(   s7   Find the command bit corresponding to the \begin{piece}R  Rz   (   R  R#  R}   R  R  R   R  (   Ro   R  R   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR"  x  s    	(   R   R   R   R2   R4   R  R  R  R  R  R#  R  R"  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  f  s
   	t   CombiningFunctionc           B   s#   e  Z e j Z d    Z d   Z RS(   c         C   s   d |  _  |  j } |  j |  } | s> t j d |  j  nA t | j    d k r t j d |  j d | j   d  n  |  j j	 t
 |   d S(   s   Parse a combining function.R   s'   Empty parameter for combining function i   s   Applying combining function s    to invalid string "R{   N(   R   R  t   parsesingleparameterR    R   R  Rq   R&   R   R   R  (   Ro   Rx  t	   combiningR  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    		)c         C   s   |  j  j |  | j   r7 t j d | j    d S|  j  j t |  sa |  j  j t	 |  rn |  j
 |  St | j    } |  j |  | S(   s&   Parse a parameter, or a single letter.s(   Error while parsing single parameter at N(   R  R!  RJ  R    R   R  R   R  R  R  R  R  RU  Ro  (   Ro   Rx  t   letter(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR$    s    (   R   R   R2   R8   R  R  R$  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR#    s   		t   DecoratingFunctionc           B   s    e  Z d  Z e j Z d   Z RS(   s*   A function that decorates some bit of textc         C   s   d |  _  |  j } t   j | d  |  _ |  j |  |  _ t   j d  |  _	 |  j
 j d |  j  t   j d  |  j _	 |  j   d S(   s   Parse a decorating functionR   s   span class="symbolover"s   span class="withsymbol"i    s   span class="undersymbol"N(   R   R  R  R  R  R  R  R$  R(  R   R   R   R  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    		(   R   R   R   R2   R:   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR'    s   	t   LimitCommandc           B   s    e  Z d  Z e j Z d   Z RS(   s@   A command which accepts limits above and below, in display mode.c         C   s^   t  |  j  j   } t   j d  |  _ x- | D]% } |  j j t   j	 | d   q1 Wd S(   s   Parse a limit command.s   span class="limits"s   span class="limit"N(
   R  R  R  R$  R(  R   R   R   R  R  (   Ro   Rx  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R2   R@   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR(    s   	t   LimitPreviousCommandc           B   s&   e  Z d  Z d Z d   Z d   Z RS(   s(   A command to limit the previous command.c         C   s)   t    j d  |  _ |  j j |  d S(   s   Do nothing.s   span class="limits"N(   R$  R(  R   R  R!  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   d S(   s"   Return a printable representation.s   Limit previous command(    (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    N(   R   R   R   R   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR)    s   	t   LimitsProcessorc           B   s_   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   s)   A processor for limits inside an element.c         C   sq   t  j r d S|  j | |  r2 |  j | |  n  |  j | |  rm |  j | | d  rm |  j | |  n  d S(   s"   Process the limits for an element.Ni   (   R   R   t   checklimitst   modifylimitst   checkscriptt   modifyscripts(   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    	(c         C   se   t  j s t S|  j | | d t  r: |  j | |  t St | | t  sQ t S|  j | | d  S(   s3   Check if the current position has a limits command.i   (	   R  R  R   t   checkcommandR)  t   limitsaheadR   R(  R-  (   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR+    s    	c         C   s3   | | d j  | | j    t   | | _ d S(   s,   Limit the current element based on the next.i   N(   Ro  R   R   R   (   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR0    s    c         C   s   | | } |  j  | | d  } | j j |  |  j | | d  r_ |  j  | | d  } n t   j d d  } | j j d |  d S(   sC   Modify a limits commands so that the limits appear above and below.i   u    s   sup class="limit"i    N(   t   getlimitR   R   R-  R  R  R   (   Ro   R   R}  t   limitedt	   subscriptt   superscript(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR,    s    
c         C   s4   |  j  | |  } | j j j d d  | j _ | S(   s#   Get the limit for a limits command.t   scriptR  (   t	   getscriptR   R%  R}   (   Ro   R   R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR1    s    c         C   sS   |  j  | |  } |  j  | |  } t   j | | g d  } | j | |  d S(   s=   Modify the super- and subscript to appear vertically aligned.s   span class="scripts"N(   R6  R  R  R   (   Ro   R   R}  R3  R4  t   scripts(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR.    s    c         C   s   |  j  | | t  S(   s6   Check if the current element is a sub- or superscript.(   R/  R  (   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR-     s    c         C   s'   t  |  | k r t St | | |  S(   s0   Check for the given type as the current element.(   Rq   R   R   (   Ro   R   R}  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR/    s    c         C   s'   | | } | j  j d 7_ | | =| S(   s   Get the sub- or superscript.s    class="script"(   R   R%  (   Ro   R   R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR6  
  s    
(   R   R   R   R   R+  R0  R,  R1  R.  R-  R/  R6  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR*    s   									t   BracketCommandc           B   s)   e  Z d  Z e j Z d   Z d   Z RS(   s"   A command which defines a bracket.c         C   s   t  j |  |  d S(   s   Parse the bracket.N(   R  R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s,   | |  _  d | |  _ t |  g |  _ |  S(   s+   Create the bracket for the given character.s   \(   R   R  R  R   (   Ro   R  t	   character(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    	(   R   R   R   R2   R7   R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR8    s   		t   BracketProcessorc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s!   A processor for bracket commands.c         C   s3   t  j r d S|  j | |  r/ |  j | |  Sd S(   s6   Convert the bracket using Unicode pieces, if possible.N(   R   R   t	   checkleftt   processleft(   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   $  s    	c         C   sa   |  j  | | d  } | s  d S|  j | | |  } |  j | | |  |  j | | |  d S(   s   Process a left bracket.i   N(   t	   findrightt   findmaxt   resize(   Ro   R   R}  t
   rightindexR^   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR<  +  s    c         C   s   |  j  | | d  S(   s0   Check if the command at the given index is left.s   \left(   t   checkdirection(   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR;  4  s    c         C   s   |  j  | | d  S(   s1   Check if the command at the given index is right.s   \right(   RA  (   Ro   R   R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   checkright8  s    c         C   s    t  | t  s t S| j | k S(   s6   Check if the given bit is the desired bracket command.(   R   R8  R   R  (   Ro   R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRA  <  s    c         C   s{   d } xn | t  |  k  rv |  j | |  r: | d 7} n  |  j | |  rY | d 8} n  | d k ri | S| d 7} q	 Wd S(   s9   Find the right bracket starting at the given index, or 0.i   i    N(   Rq   R;  RB  R   (   Ro   R   R}  t   depth(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR=  B  s    c         C   s-   | | | !} t  g  | D] } | j ^ q  S(   s@   Find the max size of the contents between the two given indices.(   R  R^   (   Ro   R   t	   leftindexR@  t   slicedR#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR>  O  s    c         C   sR   | j    } | j j d d  } t | | |  } t   | _ | j   | _ d S(   s+   Resize a bracket command to the given size.s   \Rz   N(   R&   R  R}   R  R"  R   R  R   (   Ro   R  R^   R9  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR?  T  s
    (   R   R   R   R   R<  R;  RB  RA  R=  R>  R?  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR:  !  s   								t   ParameterDefinitionc           B   s>   e  Z d  Z d	 d
 g Z d   Z d   Z d   Z d   Z RS(   s3   The definition of a parameter in a hybrid function.t   [R~  R  R!  c         C   s1   d  |  _ t |  _ t |  _ d  |  _ d  |  _ d  S(   N(   R   R   R   R  Rp  Rv   t   literalvalue(   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   p  s
    				c         C   s   x t  j D] \ } } | j |  r
 | d k r= t |  _ n  | j d  sk t j d | j   d  d S| j	   |  _
 | j d  r t |  _ n  | j |  s t j d | j	    d S|  Sq
 Wt j d | j	    d S(	   s2   Parse a parameter definition: [$0], {$x}, {$1!}...RG  R  s$   Wrong parameter name, did you mean $t   ?t   !s   Wrong parameter closing s'   Wrong character in parameter template: N(   RF  t   parambracketsR  R   Rp  R    R   R   R   RU  R   R  (   Ro   Rx  t   openingt   closing(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  w  s     c         C   s   |  j  rZ |  j r' | j |  |  _ n | j |  |  _ |  j r t |  j  |  _ q n0 |  j rx | j |  |  _ n | j |  |  _ d S(   s/   Read the parameter itself using the definition.N(	   R  Rp  R  RH  R  R  Rv   R  R  (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   read  s    				c         C   s>   d |  j  } |  j r0 | d t |  j  7} n
 | d 7} | S(   s"   Return a printable representation.s   param s   : s    (empty)(   R   Rv   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s
    	
(   RG  R~  (   R  R!  (   R   R   R   RK  Rp   R  RN  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRF  g  s   			t   ParameterFunctionc           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   sF   A function with a variable number of parameters defined in a template.c         C   sN   t    |  _ x; |  j |  D]* } | j | |   | |  j d | j <q Wd S(   s*   Read the params according to the template.R  N(   R   t   paramst	   paramdefsRN  R   (   Ro   t   readtemplateRx  t   paramdef(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt
   readparams  s    c         c   sC   t  |  } x0 | j   s> t   j |  } | r | Vq q Wd S(   s*   Read each param definition in the templateN(   R  RJ  RF  R  (   Ro   RR  Rx  RS  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRQ    s
    c         C   s   | |  j  k r d S|  j  | S(   s   Get a parameter as parsed.N(   RP  R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getparam  s    c         C   s   |  j  |  j S(   s   Get the value of a parameter.(   RU  Rv   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRN    s    c         C   s+   |  j  |  } | s  | j r$ d S| j S(   s%   Get the literal value of a parameter.N(   RU  RH  R   (   Ro   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   getliteralvalue  s    (   R   R   R   RT  RQ  RU  RN  RV  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRO    s   				t   HybridFunctionc           B   s_   e  Z d  Z e j Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z RS(	   s   
  A parameter function where the output is also defined using a template.
  The template can use a number of functions; each function has an associated
  tag.
  Example: [f0{$1},span class="fbox"] defines a function f0 which corresponds
  to a span of class fbox, yielding <span class="fbox">$1</span>.
  Literal parameters can be used in tags definitions:
    [f0{$1},span style="color: $p;"]
  yields <span style="color: $p;">$1</span>, where $p is a literal parameter.
  Sizes can be specified in hybridsizes, e.g. adding parameter sizes. By
  default the resulting size is the max of all arguments. Sizes are used
  to generate the right parameters.
  A function followed by a single / is output as a self-closing XHTML tag:
    [f0/,hr]
  will generate <hr/>.
  c         C   sJ   |  j  d } |  j  d } |  j | |  |  j |  |  _ |  j   d S(   s*   Parse a function with [] and {} parametersi    i   N(   R  RT  t   writeparamsR   t   computehybridsize(   Ro   Rx  RR  t   writetemplate(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
    c         C   s   |  j  t |   S(   s*   Write all params according to the template(   t   writeposR  (   Ro   RZ  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRX    s    c         C   s  g  } x | j    s | j d  rL |  j |  } | r | j |  q q	 | j d  r |  j |  } | r d | _ | j |  q q	 | j d  r | j |  j d d   q	 | j d  r | j |  j d d   q	 | j t | j	     q	 W| S(   s/   Write all params as read in the parse position.R  t   ft   (t   leftR   t   rightN(
   RJ  R  t
   writeparamR   t   writefunctionR   R   t   writebracketR  RU  (   Ro   Rx  R   R   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR[    s"    	c         C   s~   d | j    } | |  j k r4 t j d |  d S|  j | sE d S| j d  rp | j   |  j | j _ n  |  j | j S(   s*   Write a single param of the form $0, $x...R  s   Unknown parameter RT  N(	   RU  RP  R    R   R   R  R_  Rv   R   (   Ro   Rx  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR`    s    c         C   s   |  j  |  } | s d S| j d  r8 t   j |  S| j d  sX t j d  d S| j d  |  j |  } | j	   t
 |  d k r d St   j | |  S(   s"   Write a single function f0,...,fn.t   /R  s    Function should be defined in {}R!  i    N(   t   readtagR   R  R  R  R    R   Rq  R[  Rt  Rq   R  (   Ro   Rx  R%  R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRa    s    
c         C   s%  | j    j   s- t j d | j     d
 St | j    } d | t |  j  k rw t j d t	 |  d  d
 S|  j d | } d | k r | Sx |  j
 D]{ } | | k r |  j
 | } | j s t j d | d | d  q n  | j r| j } n d	 } | j | |  } q q W| S(   sJ   Get the tag corresponding to the given index. Does parameter substitution.s   Function should be f0,...,f9: fi   s
   Function fs    is not definedR  s   Parameters in tag s    should be literal: {s   !}Rz   N(   R   R`  R    R   R   R   RU  Rq   R  R   RP  R  RH  R}   (   Ro   Rx  R}  R%  t   variableR   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRd    s*    		c         C   s   |  j  j t  j | |  S(   s4   Return a new bracket looking at the given direction.(   R  R   R8  (   Ro   R  R9  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRb  1  s    c         C   sY   |  j  t j k r  |  j   d St   j |   |  _ x |  j D] } |  j | _ q? Wd S(   s(   Compute the size of the hybrid function.N(   R  t
   HybridSizet   configsizesR  t   getsizeR^   R   (   Ro   R#  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRY  5  s    
(   R   R   R   R2   R=   R  R  RX  R[  R`  Ra  Rd  Rb  RY  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRW    s   								Rf  c           B   s    e  Z d  Z e j Z d   Z RS(   s+   The size associated with a hybrid function.c         C   s   |  j  | j } xN | j D]C } | | k r | j | j j   } | j | t |   } q q Wd | k r t j d |  d St	 |  S(   s*   Read the size for a function and parse it.R  s%   Unconverted variable in hybrid size: i   (
   Rg  R  RP  Rv   R  R}   R   R    R   t   eval(   Ro   R  t
   sizestringR   R^   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRh  D  s    (   R   R   R   R2   R>   Rg  Rh  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRf  ?  s   	t   HeaderParserc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   Parses the LyX headerc            s3   g     j       f d     j     S(   s?   Parse header parameters into a dictionary, return the preamble.c              s    j      S(   N(   t	   parseline(    (   R   R   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   a  s    (   R  R   (   Ro   R   (    (   R   R   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  ^  s    
c         C   s   | j    } | j t j d  r3 |  j |  d S| j t j d  r] t   j |  d S| j t j d  r | j |  j j	 |   d S|  j
 |  d S(   s0   Parse a single line as a parameter or as a startt   branchNt   lstsett   beginpreamble(   R   Rr   RL   RM   t   parsebrancht	   LstParsert   parselstsetR   R  R  R  (   Ro   R   R   R3  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRl  f  s    c         C   s   | j    j   d } | j   t   j t j d  } | j |  t |  } x( | j D] } | j	 | | j |  q\ W| t
 j | <d S(   s   Parse all branch definitions.i   t	   endbranchN(   R   R   R   Rk  R  RL   RM   R  R   R   R   R   (   Ro   R   Rm  t	   subparserRn   RA   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp  u  s    
c         C   s   | |  _  |  S(   s*   Complete the parser with the given ending.(   R
  (   Ro   R
  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    	(   R   R   R   R  Rl  Rp  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRk  [  s
   			t   PreambleParserc           B   s&   e  Z d  Z g  Z d   Z d   Z RS(   s   A parser for the LyX preamble.c            s0   t  j d  _  j      f d    g  S(   s,   Parse the full preamble with all statements.t   endpreamblec              s    j     S(   N(   t   parsepreambleline(    (   R   Ro   (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR     s    (   RL   RM   R
  R  (   Ro   R   (    (   R   Ro   sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s$   t  j j | j    | j   d S(   s   Parse a single preamble line.N(   Ru  t   preambleR   R   R   (   Ro   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRw    s    (   R   R   R   Rx  R  Rw  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRu    s   	Rq  c           B   s;   e  Z d  Z e   Z d   Z d   Z d   Z d   Z RS(   s!   Parse global and local lstparams.c         C   sc   |  j  |  } d | k r0 t j d |  d S| j d  d } | d  } |  j |  t _ d S(   s+   Parse a declaration of lstparams in lstset.R  s#   Missing opening bracket in lstset: Ni   i(   t   extractlstsetR    R   R   t   parselstparamsRq  t   globalparams(   Ro   R   R  t   lefttextt   croppedtext(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRr    s    
c         C   sW   d } x= | j    sE | | j   7} | j   | j d  r	 | Sq	 Wt j d  d S(   s%   Extract the global lstset parameters.Rz   R!  s0   Could not find end of \lstset settings; abortingN(   RJ  R   R   R   R    R   (   Ro   R   R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRy    s    
c         C   s>   t  j j   | _ | j d  } | j j |  j |   d S(   s-   Parse some lstparams from elyxer.a container.t	   lstparamsN(   Rq  R{  R   R~  R  t   updateRz  (   Ro   R   t	   paramlist(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s{   t    } xk | D]c } d | k rQ t | j    d k rs t j d |  qs q | j d d  \ } } | | | <q W| S(   s1   Process a number of lstparams from elyxer.a list.Rx   i    s   Invalid listing parameter i   (   R   Rq   R  R    R   R   (   Ro   R  t	   paramdictR   RA   Rv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRz    s    	(	   R   R   R   R   R{  Rr  Ry  R  Rz  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRq    s   		
	
	t   MacroDefinitionc           B   s;   e  Z d  Z e   Z d   Z d   Z d   Z d   Z RS(   s0   A function that defines a new command (a macro).c         C   s   t    |  _ d |  _ g  |  _ t |  j _ |  j |  t |  j _ t	 j
 d |  j d t |  j  d  |  |  j |  j <d S(   s*   Parse the function that defines the macro.i    s   New command s    (s    parameters)N(   R   R   t   parameternumbert   defaultsR   R  R%  t   parseparametersR   R    R   t
   newcommandR   t   macros(   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    		#c         C   s   |  j  |  |  _ |  j |  } | r9 t |  |  _ n  |  j |  } x) | rs |  j j |  |  j |  } qK W|  j |  |  _	 d S(   sD   Parse all optional parameters (number of parameters, default values)N(
   t   parsenewcommandR  R  R   R  R  R  R   R  t
   definition(   Ro   Rx  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    	c         C   s{   |  j  j |  |  j  j t |  r2 |  j |  S|  j  j t |  r` |  j  j t  j |  St j	 d | j
    d S(   s"   Parse the name of the new command.s,   Unknown formula bit in defining function at R  (   R  R!  R  R  R  R  R   R  R    R   R  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   s   |  j  j   S(   s    Return an instance of the macro.(   R  R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (	   R   R   R   R   R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   				
t   MacroParameterc           B   s    e  Z d  Z d   Z d   Z RS(   s    A parameter from elyxer.a macro.c         C   s   | j  d  S(   s   Find a macro parameter: #n.R  (   RX  (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   sw   | j  d  s  t j d  d St | j    |  _ d t |  j  |  _ t   j	 d t |  j  d  g |  _
 d S(   s   Parse the parameter: #n.R  s   Missing parameter start #.Ns   span class="unknown"(   R  R    R   R   RU  R   R   R   R  R  R   (   Ro   Rx  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    (   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   	t   MacroFunctionc           B   s_   e  Z d  Z e j Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z RS(	   s*   A function that was defined using a macro.c         C   s?   t    |  _ g  |  _ |  j } |  j | |  |  j |  d S(   s#   Parse a number of input parameters.N(   R.  R   t   valuesR  R  t   completemacro(   Ro   Rx  t   macro(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s
    		c         C   so   |  j  | t | j   |  j | | j t | j   t |  j  | j k  rk t j d t	 |    n  d S(   s'   Parse as many parameters as are needed.s   Missing parameters in macro N(
   t   parseoptionalR   R  t   parsemandatoryR  Rq   R  R    R   R   (   Ro   Rx  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s     c         C   s   g  } xK |  j  j t |  rS | j |  j |   t |  t |  k r	 Pq	 q	 WxR | D]J } | j   } t | j  d k r |  j j |  q[ |  j j |  q[ W|  j | 7_ d S(   s   Parse optional parameters.i    N(	   R  R  R  R   R  Rq   Rr  R   R  (   Ro   Rx  R  Rp  Rv   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s    c         C   sK   xD t  |  D]6 } |  j | | |  } | s3 d S|  j j |  q Wd S(   s'   Parse a number of mandatory parameters.N(   RA  t   parsemacroparameterR  R   (   Ro   Rx  R   R}  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  %  s
    c         C   sR   |  j  j |  | j   r  d S|  j  j t |  rE |  j | |  S|  j |  S(   s?   Parse a macro parameter. Could be a bracket or a single letter.N(   R  R!  RJ  R   R  R  t   parsenumbersR  (   Ro   Rx  t	   remaining(    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  -  s    c         C   s   |  j  j t |  } t | j  | k s. | SxO | j D]D } |  j  j t  } | j t |   | | _ |  j	 j
 |  q8 Wd S(   s3   Parse the remaining parameters as a running number.N(   R  R  R  Rq   R   R   Ro  R  R   R  R   R   (   Ro   Rx  R  R   t   digitRv   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  8  s    	c         C   s   | j    g |  _ t g t |  j  } xw |  j t  D]f } | j d } | t |  j  k r{ t j	 d t
 |   d St | | <|  j | j   g | _ q8 WxA t t |  j   D]* } | | s |  j | |  j |  q q Wd S(   s,   Complete the macro with the parameters read.i   s%   Macro parameter index out of bounds: N(   R  R   R   Rq   R  R  R  R   R    R   R   R   R   RA  R1  (   Ro   R  R#   R  R}  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  E  s    

c         C   sG   d t  | d  } d j |  j d j    } |  j j | |  d S(   s@   Add a filter for the given parameter number and parameter value.R  i   Rz   i    N(   R   t   joinR  R  R   R1  (   Ro   R}  Rv   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR1  T  s    (   R   R   R   R  R  R  R  R  R  R  R  R  R  R1  (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR    s   								t   FormulaMacroc           B   s    e  Z d  Z d   Z d   Z RS(   s!   A math macro defined in an inset.c         C   s   t    |  _ t   |  _ d  S(   N(   R  R   R   R   (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyRp   ]  s    c         C   s   d S(   s"   Return a printable representation.s
   Math macro(    (   Ro   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR   a  s    (   R   R   R   Rp   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyR  Z  s   	c         C   sE   t    } | j |   } t   j |  | j   d j | j    S(   s   Convert some TeX math to HTML.Rz   (   R  R  R  R   R  R  (   R  R  R  (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt	   math2htmlm  s
    	
c          C   sc   t  j }  t   j |   t |   d k rB t j d  t   n  t |  d  } t j	 |  d S(   s=   Main function, called if invoked from elyxer.the command linei   s"   Usage: math2html.py escaped_stringi    N(
   R   t   argvR   Rw   Rq   R    R   R   R  R   (   Ru   R   (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   mainu  s    	
t   __main__(   R   t   objectR    t   os.pathR   R   R"   R$   R+   R2   RJ   RL   RO   RS   RU   RW   RZ   R`   Rc   Rk   Rm   R   R   R  R   R   R   R  R  R  R  R  R  R  R  R   R!  R"  R$  R.  R4  R9  R5  RK  RQ  RR  Rw  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  t   unicodedataR.  R&  R   R3  RR  RU  Rp  Rm  Rn  Rs  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  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(  R)  R*  R8  R:  R  RF  RO  RW  Rf  Rk  Ru  Rq  R  R  R  R  R  R  R   (    (    (    sA   /usr/lib/python2.7/dist-packages/docutils/utils/math/math2html.pyt   <module>   sR  2K~  #(!C	-M#	


BD(v?8#>2"h,F8kK6Yn

8/1?U;		

B
+F<:$z
*./X		
