mò sõOc@s¢ dkZeiddfjo d„Zndefd„ƒYZdkZdkZdefd„ƒYZdefd „ƒYZd efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd!„ƒYZd"efd#„ƒYZd$efd%„ƒYZd&efd'„ƒYZd(efd)„ƒYZdkZd*efd+„ƒYZd,efd-„ƒYZd.efd/„ƒYZd0efd1„ƒYZd2efd3„ƒYZd4efd5„ƒYZd6efd7„ƒYZ d8efd9„ƒYZ!d:efd;„ƒYZ"d<e fd=„ƒYZ#d>efd?„ƒYZ$d@e$fdA„ƒYZ%dBe$fdC„ƒYZ&dDe$fdE„ƒYZ'dFe'fdG„ƒYZ(dHe'fdI„ƒYZ)dJe$fdK„ƒYZ*dkZdk+Z+dLefdM„ƒYZ,dNefdO„ƒYZ-dPefdQ„ƒYZ.dRefdS„ƒYZ/dTefdU„ƒYZ0dVe.fdW„ƒYZ1dXe1fdY„ƒYZ2dZe1fd[„ƒYZ3d\efd]„ƒYZ4d^e4fd_„ƒYZ5d`e5fda„ƒYZ6dbe4fdc„ƒYZ7dde7fde„ƒYZ8dfe4fdg„ƒYZ9dhefdi„ƒYZ:djefdk„ƒYZ;dle;fdm„ƒYZ<dne4fdo„ƒYZ=dpe=fdq„ƒYZ>dre8fds„ƒYZ?dte=fdu„ƒYZ@dve=fdw„ƒYZAdxe=fdy„ƒYZBdze=fd{„ƒYZCd|e=fd}„ƒYZDd~e=fd„ƒYZEd€eEfd�„ƒYZFd‚efdƒ„ƒYZGd„efd…„ƒYZHd†e4fd‡„ƒYZIdˆe=fd‰„ƒYZJdŠefd‹„ƒYZKdkLZLdkMZMdŒefd�„ƒYZNeNƒeN_OdŽefd�„ƒYZPd�ePfd‘„ƒYZQd’efd“„ƒYZRd”eRfd•„ƒYZSeSƒeR_TeRƒeR_Ud–efd—„ƒYZVd˜e4fd™„ƒYZWdše4fd›„ƒYZXdœe9fd�„ƒYZYdže9fdŸ„ƒYZZd e9fd¡„ƒYZ[d¢e9fd£„ƒYZ\d¤e9fd¥„ƒYZ]d¦e9fd§„ƒYZ^d¨e9fd©„ƒYZ_dªe9fd«„ƒYZ`d¬e9fd­„ƒYZad®e5fd¯„ƒYZbd°e5fd±„ƒYZcd²e4fd³„ƒYZdd´e4fdµ„ƒYZed¶e4fd·„ƒYZfd¸e4fd¹„ƒYZgdºegfd»„ƒYZhd¼e4fd½„ƒYZid¾e9fd¿„ƒYZjdÀe5fdÁ„ƒYZkdÂe4fdăYZldÄelfdÅ„ƒYZmdÆemfdÇ„ƒYZndÈe$fdÉ„ƒYZodÊefdË„ƒYZpdÌefdÍ„ƒYZqdÎelfdÏ„ƒYZrdÐelfdÑ„ƒYZsdÒe=fdÓ„ƒYZtdÔetfdÕ„ƒYZudÖeufdׄƒYZvdØeufdÙ„ƒYZwdÚevfdÛ„ƒYZxdÜeufdÝ„ƒYZydÞeufdß„ƒYZzdàeufdᄃYZ{dâeufd㄃YZ|däeyfd儃YZ}eKi~etezg7_~exeveye}e|e{ewget_~dæefd焃YZdèefd鄃YZ€dêeufd넃YZ�dìetfd턃YZ‚dîetfdYZƒdðeufdñ„ƒYZ„dòe„fdó„ƒYZ…dôe„fdõ„ƒYZ†döe„fd÷„ƒYZ‡døe„fdù„ƒYZˆdúeufdû„ƒYZ‰eti~e‰g7_~düeyfdý„ƒYZŠdþeyfdÿ„ƒYZ‹devfd„ƒYZŒdeŒfd„ƒYZ�deGfd„ƒYZŽdeyfd„ƒYZ�deGfd „ƒYZ�eti~e‹eŠeŒe�g7_~eHi‘eŽƒe�ƒg7_‘d efd „ƒYZ’d eufd „ƒYZ“de“fd„ƒYZ”defd„ƒYZ•eti~e”g7_~defd„ƒYZ–defd„ƒYZ—defd„ƒYZ˜deufd„ƒYZ™de=fd„ƒYZšdeufd„ƒYZ›deIfd„ƒYZœeKi~ešg7_~eti~e›g7_~d „Z�d!„ZžeŸd"jo ežƒndS(#Niiccs7t|ƒ}x$|djo|d}||VqWdS(Nii(tlentsequenceti(RR((tq/home/project-web/docutils/web-update/infrastructure/update-dir/aux/snapshots/docutils/docutils/math/math2html.pytreverseds    tTracecBs�tZdZeZeZeZeZd„Z d„Z d„Z d„Z d„Z ee ƒZ ee ƒZ ee ƒZ ee ƒZ ee ƒZ RS(sA tracing classcCs4ti p tiodSnti|tiƒdS(sShow a debug messageN(Rt debugmodet quietmodetshowtmessagetsyststdout(tclsR ((Rtdebug-scCsNtiodSntiotioti|}nti|tiƒdS(sShow a trace messageN(RRtprefixt showlinesmodeR RR R (R R ((RR 3s  cCsFd|}tiotioti|}nti|tiƒdS(sShow an error messages* N(R RRRRR tstderr(R R ((Rterror;s  cCstid|ƒtdƒdS(s#Show an error message and terminatesFATAL: iÿÿÿÿN(RRR texit(R R ((RtfatalBscCs$|idƒ}|i|dƒdS(sShow a message out of a channelsutf-8s N(R tencodetchanneltwrite(R R R((RRGs(t__name__t __module__t__doc__tFalseRRRtNoneRR R RRRt classmethod(((RR$s          tBibStylesConfigcBsÁtZdZhdd<dd<dd$journal,{ {$volume:}$pages,} $month $year.{ doi: $doi.}{ URL $url.}{ $note.}uciteu$surname($year)udefaultuS$authors. $title. $publisher, $year.{ URL $url.}{ $note.}u˜$authors. $title.{ $journal{, {$volume}{($number)}}{: $pages}{, $year}.}{ $url.}{ $filename.}{ $note.}u$Sur$YYut$authors. $title.{ $journal,} $year.{ $url.}{ $filename.}{ $note.}ur$authors. $year. $title. $journal, $volume($number), $pages.{ URL $url.}{ $note.}u@bookuS$authors. $year. $title. $publisher.{ URL $url.}{ $note.}u$surname, $yearue$authors: “$titleâ€�, $journal,{ pp. $pages,} $year.{ URL $url.}{ $note.}uj{$authors: }$title{ ($editor, ed.)}.{{ $publisher,} $year.}{ URL $url.}{ $note.}u@bookletuW$authors: $title.{{ $publisher,} $year.}{ URL $url.}{ $note.}u @conferenceu@inbooku @incollectionu$authors: $title{ in $booktitle{ ($editor, ed.)}}.{{ $publisher,} $year.}{ URL $url.}{ $note.}u@inproceedingsu@manualu@mastersthesisu@miscuh$authors: $title.{{ $publisher,}{ $howpublished,} $year.}{ URL $url.}{ $note.}u @phdthesisu @proceedingsu @techreportuG$authors: $title, $year.{ URL $url.}{ $note.}u @unpublisheduW$authors: “$titleâ€�, $journal, $year.{ URL $url.}{ $note.}u$indexuYYu??uauthorsuusurnameu~$authors, “$titleâ€�, $journal, vol. $volume, no. $number, pp. $pages, $year.{ URL $url.}{ $note.}uS$authors, $title. $publisher, $year.{ URL $url.}{ $note.}uF$authors, “$titleâ€�. $year.{ URL $url.}{ $note.}uv$authors. $title.{ $journal{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL $url.}{ $note.}u\$authors. $title. $publisher,{ $month} $year.{ URL $url.}{ $note.}u~$authors. $title.{ In $booktitle {($editor, ed.)}.} $publisher,{ $month} $year.{ URL $url.}{ $note.}uy$authors. $title. { $booktitle{, {$volume}{($number)}}{:$pages}{, $year}.}{ URL $url.}{ $note.}uR{$authors. }$title.{{ $publisher,} $year.}{ URL $url.}{ $note.}uy$authors. $title. $journal, $year{;{$volume}{($number)}{:$pages}}.{ URL: $url.}{ $note.}uO$authors. $title. {$publisher, }$year.{ URL: $url.}{ $note.}u`$authors. $title; {$publisher, }$year.{ $howpublished.}{ URL: $url.}{ $note.}( RRRtabbrvnattalphat authordate2tdefaultt defaulttagstieeetrtplaint vancouver(((RRYs !!*–!*< t BibTeXConfigcBs&tZdZhdd<ddd?gu>u/>u u u uâ�Ÿu u ( RRRtcharstcommandstentitiesthtmlt iso885915t nonunicode(((RR/)s 3i !!t FormulaConfigcBsûtZdZhdd<dd<dd<dd<d d <d d <d d<dd<dd<dd<dd<dd<dd<dd<dd<dd <d!d"<d#d$<d%d$<d&d'<d(d)<d*d)<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<d7d8<d9d:<d;d<<d=d><d?d@<dAdB<dCdD<dEdF<dGdH<dIdJ<dKdL<dMdN<dOdP<dQdR<dSdT<dUdV<dWdX<dYdZ<d[d\<d]d^<d_d`<dadb<dcdd<dedf<dgdh<didj<dkd<<dldm<dndo<dpdq<drds<dtdu<dvdwd?<d@dA<dBdd<dCdD<dEdš<dFdG<dHdI<dJdf<dKdL<ddM<dNdO<dPdQ<dRdS<dTdU<dVdW<dXdY<dZd[<d\d]<d^d_<d`da<dbdc<ddde<dfdg<dhdi<djdk<dldm<dndo<dpdq<drds<dtdu<dvdw<dxd÷<dydz<d{d|<d}d~<dd€<d�d‚<dƒd„<d…d†<d‡dˆ<d‰dŠ<d‹dŒ<d�dŽ<d�d�<d‘d’<d“d”<d•d–<d—d˜<d™dš<d›dœ<d�dž<dŸd <d¡d¢<d£d¤<d¥d¦<d§d¨<d©dw<dªd«<d¬d­<d®d¯<d°d±<d²d³<d´dµ<d¶d÷<d·d¸<d¹dº<d»d¼<d½d¾<d¿dÀ<dÁdÂ<dÃdÄ<dÅdÆ<dÇdÈ<dÉdS<dÊdË<dÌdÍ<dÎdÏ<dÐdÑ<dÒdÓ<dÔdÕ<dÖdz<d×dØ<dÙdÚ<dÛdÜ<dÝdÜ<dÞdß<dàdá<dâdã<dädå<dædå<dçdè<dédê<dëdì<dídî<dïdð<dñd<dòdó<dôdõ<död÷<dødù<dúdû<düdý<dþdÿ<dd<dd<dd<dd<dd <d d <d d <dd<dd<dd<dd<dd<dd<dd<dd<dd<dd <d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d0<d4d5<d6d7<d8d9<d:d;<d<d=<d>d?<d@dA<dBdC<dDdE<dFdG<dHdI<dJdK<dLdM<dNdO<dPdQ<dRdS<dTdU<dVdW<dXdY<dZdO<d[d\<d]d^<d_d`<d%d$<dadb<dcdd<dedf<d*d)<dgdh<didj<dkdŽ<dldm<dndo<dpd�<dqd�<drdˆ<dsdt<dud<dvdw<dxd5<dydz<d{d|<d}d~<dd€<d�d‚<dƒd„<d…d†<d‡dˆ<d‰dŠ<d‹dŒ<d�dŽ<d�d�<d‘d’<d“d”<d•d’<d–d—<d˜d™<dšd›<dœd�<dždŸ<d d¡<d¢d£<d¤d¥<d¦d§<d¨d©<dªd«<d¬d­<d®d¯<d°d±<d²d³<d´dµ<d¶d·<d¸d¹<dºd»<d¼d½<d¾d¿<dÀdÁ<dÂdÃ<dÄdÅ<dÆdÇ<dÈdŒ<dÉdÊ<dËdÌ<dÍdÖ<dÎdÏ<dÐdÑ<dÒdÓ<dÔdÕ<dÖd×<dØdÙ<dÚdÛ<dÜdÝ<dÞdß<dàdá<dâdã<dädå<dædç<dèdé<dêdë<dìdí<dîdï<dðdñ<dòdó<dôdõ<död÷<dødù<dúdû<düd·<dýd·<dþdÿ<dd<ddM<dd<dd<dd<d d <d d <d d <dd<dd<dd<dd<dd<dd<ddÖ<ddÖ<dd·<dd<dd<d d<d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<d7d8<d9d:<d;d<<d=d><d?d@<dAdB<dCdD<dEdF<dGdH<dIdJ<dKdL<dMd|<dNd<dOdP<dQdR<dSdT<dUdV<dWdX<dYdZ<d[d~<d\d]<d^d€<d_d <d`dš<dadb<dcdœ<ddde<dfdg<dhdi<djdk<dldm<dndo<dpdq<drds<dtds<dudv<dwdx<dydz<d{d|<d}dß<d~d<d€d�<d‚d–<dƒd–<d„dŒ<d…d†<d‡dˆ<d‰dŠ<d‹dŒ<d�dŽ<d�d�<d‘d’<d“d”<d•d’<d–d”<d—d˜<d™dš<d›dœ<d�dž<dŸd <d¡d¢<d£d¤<d¥d¦<d§d¨<d©dª<d«d¬<d­d®<d¯d°<d±d²<d³d´<dµd¶<d·d¸<d¹dº<d»d¼<d½d¾<d¿dÀ<dÁdÂ<dÃdÄ<dÅdÆ<dÇd‚<dÈdÉ<dÊdË<dÌdÍ<dÎdÏ<dÐdí<dÑdÒ<dÓdÔ<dÕdÖ<d×dØ<dÙdÚ<dÛdÚ<dÜdÝ<dÞdß<dàdá<dâdã<dädå<dædç<dèdé<dêdë<dìdí<dîdï<dðdñ<dòd×<dódô<dõdm<död÷<dødù<dúd<dûdü<dýdü<dþd<dÿd<dd<dd<dd<dd<d d <d d <d dº<ddŒ<dd5<dd<dd<ddß<dd<dd<ddˆ<dd¥<dd<dd<dd <d!d"<d#d$<d%d&<d'd(<d)d*<d+d<d,d"<d-d"<d.d/<d0d1<d2d3<d4d5<d6dŠ<d7d8<d9d:<d;då<d<d=<d>dó<d?dQ<d@d<dAdB<dCdD<dEdF<dGdŒ<dHdŒ<dIdJ<dKdá<dLdM<dNdŽ<dOdŽ<dPdQ<dRdS<dTdU<dVd�<dWdš<dXd–d?<d@dA<dBdž<dCd›AmSu\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ıu\imathu\iotauιu\juÈ·u\jmathu\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ϰu\varphiu\varpiuÏ–u\varrhouϱu \varsigmauÏ‚u \varthetauÏ‘u\xiuξu\zetauζubeginu\beginu cellseparatoru&uendu\endu 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⌡u\leftuspan class="symbol"u\left.uu\middleu\rightu\right.uu\"üu\'uÌ�u\^uÌ‚u\`uÌ€u\acuteu\baruÌ„u\breveŭu\cu̧u\checkuÌŒu\dddotu⃛u\ddotu\dotu̇u\graveu\hatu \mathringuÌŠu\overleftarrowu⃖u\overrightarrowu⃗u\ru\suÌ©u \textcircleduâƒ�u \textsubringuÌ¥u\tildeũu\vu\vecu\~u\ u u\!uu\#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â…�u\Gammau\Imuâ„‘u\Joinuâ¨�u \LEFTCIRCLEuâ—–u \LEFTcircleuâ—�u\Lambdau \Leftarrowuâ‡�u \Lleftarrowu⇚u\Longleftarrowu⟸u\Longleftrightarrowu⟺u\Longrightarrowu⟹u\Lshu↰u \Mapsfromuâ‡�|u\Mapstou|⇒u\Omegau\Pu¶u\Phiu\Piu\PruPru\Psiu \RIGHTCIRCLEuâ——u \RIGHTcircleuâ—‘u\Reuℜu \Rrightarrowu⇛u\Rshu↱u\Su§u\Sigmau\Squareuâ˜�u\Subsetuâ‹�u\Supsetuâ‹‘u\Thetau\Uparrowu⇑u \Updownarrowu⇕u\Upsilonu\Vdashu⊩u\Vertu\Vvdashu⊪u\XBoxu☒u\Xiu\Yupuâ…„u
u\_u_u\alephuℵu\amalguâˆ�u\angleu∠u \aquariusuâ™’u\arccosuarccosu\arcsinuarcsinu\arctanuarctanu\arguargu\ariesu♈u\astu∗u\asympuâ‰�u \backepsilonuâˆ�u \backprimeu‵u \backsimequâ‹�u \backslashu\u \barwedgeu⊼u\becauseu∵u\bethuâ„¶u\betweenu≬u\bigcapu∩u\bigcircu\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♋u\capu \capricornusu♑u\cdotuâ‹…u\cdotsu⋯u \centerdotu∙u \checkmarku✓u\chiuχu\circu\circequ≗u \circledRu®u \circledastu⊛u \circledcircu⊚u \circleddashuâŠ�u \clubsuitu♣u \coloneqqu≔u \complementuâˆ�u\congu≅u\coprodu \copyrightu©u\cosucosu\coshucoshu\cotucotu\cothucothu\cscucscu\cupu\curvearrowleftu↶u\curvearrowrightu↷u\dagu†u\daggeru\dalethuℸu\dashleftarrowu⇠u\dashvu⊣u\ddagu‡u\ddaggeru\ddotsu⋱u\degudegu\detudetu \diagdownu╲u\diagupu╱u\diamondu \diamondsuitu♦u\dimudimu\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≂u\eurou\existsu∃u\expuexpu\fallingdotsequ≒u\femaleu♀u\flatuâ™­u\forallu∀u\frownu⌢u\frownieu☹u\gcdugcdu\geminiu♊u\geq)u≥u\geqqu≧u \geqslantu\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♥u\hfillu u\homuhomu\hookleftarrowu↩u\hookrightarrowu↪u\hslashu \idotsintu(∫⋯∫u\iiintu"∭u\iintu"∬u\infuinfu\inftyu∞u\invneguâŒ�u\jupiteru♃u\kerukeru\landu \landupintu"∱u\langleu⟨u\lbraceu\lbrace)u\lbracku\lceilu⌈u\ldotsu\leadstouâ‡�u \leftarrow)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≦u \leqslantu\lessdotuâ‹–u \lesseqgtruâ‹›u \lesseqqgtru⪋u\lessgtru≶u\lesssimu≲u\lflooru⌊u\lgulgu\lhdu⊲u\librau♎u \lightningu↯u\liminfuliminfu\limsupulimsupu\llu≪u\lllu⋘u\lnulnu\lneqqu≨u\lnotu¬u\lnsimu⋦u\logulogu\longleftarrowu⟵u\longleftrightarrowu⟷u \longmapstou⟼u\longrightarrowu⟶u\looparrowleftu↫u\looparrowrightu↬u\loru\lozengeuâ—Šu\ltimesu⋉u\lyxlocku\maleu♂u\malteseu✠u \mapsfromu↤u\mapstou↦u\mathcircumflexu^u\maxumaxu\measuredangleu∡u\mercuryu☿u\mhouâ„§u\midu∣u\minuminu\modelsu⊨u\mpu∓u \multimapu⊸u \nLeftarrowuâ‡�u\nLeftrightarrowu⇎u \nRightarrowuâ‡�u\nVDashu⊯u\nablau∇u\napproxu≉u\naturaluâ™®u\ncongu≇u\nearrowu↗u\negu\neg)u\neptuneu♆u\nequivu≢u\newlineu\nexistsu∄u \ngeqslantu≱u\ngtru≯u \ngtrlessu≹u\niu∋u\ni)u \nleftarrowu↚u\nleftrightarrowu↮u \nleqslantu≰u\nlessu≮u \nlessgtru≸u\nmidu∤u \nolimitsu \nonumberu\notu\notu \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↖u\odotu \officialeurou\oiiintu"∰u\oiintu"∯u\ointu"∮u\ointclockwiseu"∲u\ointctrclockwiseu"∳u\ominusu⊖u\oplusu\oslashu⊘u\otimesu\ownsu \parallelu\partialu∂u\perpu\piscesu♓u \pitchforkuâ‹”u\plutou♇u\pmu±u\pointeru➪u\poundsu£u\precu≺u \preccurlyequ≼u\precequ\precsimu≾u\primeu′u\promptouâˆ�u\qquadu u\quadu \quarternoteu♩u\rangleu⟩u\rbraceu\rbrace)u\rbracku\rceilu⌉u\rflooru⌋u\rhdu⊳u \rightarrow)u→u\rightarrowtailu↣u\rightarrowtobaru⇥u\rightharpoondownuâ‡�u\rightharpoonupu⇀u\rightharpooondownu\rightharpooonupu\rightleftarrowsu⇄u\rightleftharpoonsu⇌u \rightmoonu☽u\rightrightarrowsu⇉u\rightrightharpoonsu⥤u\rightthreetimesu⋌u \risingdotsequ≓u\rtimesu⋊u \sagittariusuâ™�u\saturnu♄u\scorpiouâ™�u\searrowu↘u\secusecu \setminusu∖u\sharpu♯u\simequ≃u\sinusinu\sinhusinhu\slashu∕u\smileu⌣u\smileyu☺u \spadesuituâ™ u\sphericalangleu∢u\sqcapu⊓u\sqcupu \sqsubsetuâŠ�u \sqsubsetequ⊑u \sqsupsetuâŠ�u \sqsupsetequ⊒u\squareu\staru⋆u \subseteqquâ«…u \subsetneqquâ«‹u\succu≻u \succcurlyequ≽u\succequ \succnsimuâ‹©u\succsimu≿u\sunu☼u\supusupu \supseteqqu⫆u \supsetneqqu⫌u\surdu√u\swarrowu↙u\tanutanu\tanhutanhu\taurusu♉u\textasciicircumu\textasciitildeu~u\textbackslashu\textcopyrightu©'u \textdegreeu°u \textellipsisu \textemdashu—u \textendashu \texteurou \textgreateru>u \textlessud?d@dAdBdCdDdEdFdGdHg0<dIdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZg<d?d@<dAdB<dCdD u\hspace*{\fill}u u \hspace*{}uu \hspace{}u\negthinspace{}u\qquad{}u  u\quad{}u\space{}u u \thinspace{}u u~ualdu»ualsu›uardu«uarsu‹ueldu“uelsu‘uerdu”uersu’uflduflsufrdufrsugldu„uglsu‚ugrdu“ugrsu‘uplduplsuprduâ€�uprsu’usldusrdueqrefu(@↕)u formattedu¶↕unamerefu$↕upagerefu#↕urefu@↕uvpagerefu on-page#↕uvrefu @on-page#↕u ignoredtextsucolutextulineupageutheightupheightubigskipu
udefskipu
umedskipu
u smallskipu
uvfillu
(RRRthspacestquotestreferenceformatstsizetvspaces(((RR\ s iÌE!t TOCConfigcBs­tZdZhddddddddd d d d d g <ddg<ddgd?d„Z?d „Z@d „ZAd „ZBRS( sA set of runtime optionsR|t imagemagickcCs_|dt_|d=ttƒ}|i|ƒ}|oti|ƒ|i ƒn|i ƒdS(sParse command line optionsiN( RsR�tlocationRotparserRytresultRRRqtusagetprocessoptions(RqRsR’R“((RRys   cCs6tio|iƒntio|iƒntio|iƒntio|i ƒnti o|i ƒnti omyAt ti ƒt_ ti djotidƒ|iƒnWqïtidti ƒ|iƒqïXntiptip tio tt_n|iƒtioti otit_ntidjo tt_ntigjodgt_ntio tt_ntio(ti otidƒtit_ntiotidƒnxEttƒD]7}|i!dƒo!t"t|t#||d ƒƒq÷q÷Wd S( sProcess all options parsed.is.--splitpart requires a number bigger than zeros*--splitpart needs a numeric argument, not tcopys http://elyxer.nongnu.org/lyx.csss7Option --toc is deprecated; use --tocfor "page" insteads5Option --nocopy is deprecated; it is no longer neededtmodeiüÿÿÿN($R�thelpRqR”RNt showversiont hardversiontshowhardversiont versiondatetshowversiondatet lyxformatt showlyxformatt splitparttintRRtlowmemttocttocforRtmemorytparsefootnotest forceformatt imageformatR†t copyimagestcssR3t simplematht toctargettnocopytdirtparamRŒRxR‚(RqR¯((RR•sP               cCsYtidtiitiƒdƒtidƒtidƒtidƒ|iƒdS(sShow correct usagesUsage: s [options] [filein] [fileout]s7Convert LyX input file "filein" to HTML file "fileout".sCIf filein (or fileout) is not given use standard input (or output).s?Main program of the eLyXer package (http://elyxer.nongnu.org/).N( RRtostpathtbasenameR�R‘Rqt showoptions(Rq((RR”9s $   cCsÛtipdSntt_tt_tiidƒ}xM|D]E}|d}t t|ƒot t|t ƒq=t i d|ƒq=Wti o#ti oti o t t_nti oti o t t_ndS(sParse footnotes options.Nt,tfootsUnknown footnotes option: (R�t footnotesRt marginfoott letterfootR�Rptoptiont footoptionR�RxR†RRtendfoott hoverfoott numberfoott symbolfoot(RqRºRpR¹((RR¦As     ! cCs˜tidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtid ƒtid ƒtid ƒtid ƒtid ƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtidƒtid ƒtid!ƒtid"ƒtid#ƒtid$ƒtid%ƒtid&ƒtid'ƒtid(ƒtid)ƒtid*ƒtid+ƒtid,ƒtid-ƒtid.ƒtid/ƒtid0ƒtid1ƒtid2ƒtiƒd3S(4sShow all possible optionss Common options:s1 --help: show this online helps9 --quiet: disables all runtime messagesR|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 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(RRR R(Rq((RR³Ssh                                                  cCsEdtid}|dtidd7}ti|ƒtiƒdS(s(Return the current eLyXer version stringseLyXer version tnumbers (tdatet)N(RMRNR-RRR R(RqR-((RR™‰s  cCs"titidƒtiƒdS(sReturn just the version stringR¿N(RR RMRNR R(Rq((RR›�scCs"titidƒtiƒdS(sReturn just the version dteRÀN(RR RMRNR R(Rq((RR�•scCs"titidƒtiƒdS(s#Return just the lyxformat parameterRžN(RR RMRNR R(Rq((RRŸšs(CRRRRtinstanceR‘RR­t copyrightR tquietRNRšRœR3R˜R†t showlinestunicodeR4Rªttitlet directoryt destdirectoryR£R¬R¤R§RžttargetR R¥R¢tnobibt convertertrawtjsmathtmathjaxtnofooterR«ttemplatet noconvertt notoclabelsR¸R½R¾R¼R·R»tsupfoott alignfootR¶R¨R©t googlechartstembedcsstdicttbranchesRyR•R”R¦R³R™R›R�RŸ(((RR�Ësz   *   6   t BranchOptionscBs2tZdZd„Zd„Zd„Zd„ZRS(sA set of options for a branchcCs||_hdd<|_dS(Ntcolors#ffffff(tnameRqRp(RqRÜ((RRr¢s cCsZ|itidƒptid|ƒdSn|itiddƒ}||i |æscs|iiˆijS(N(RïRæRRqRí(Rï(Rq(RRðçscsˆi|ˆƒS(N(RqtprocessRïR‰(Rï(R‰Rq(RRðèsN(R‰tlocatet recursiveRñt containertrecursivesearch(RqRôRòRóRñR‰((RqR‰Rtextractãs  cCsl|ii}||ijo|i|ƒn<||ijo|i|i |ƒƒnt i d|ƒdS(sBAdd allowed containers, clone cloned containers and add the clone.sUnknown container class N( RôRæRRÜRqRëR‰RŠRìt safecloneRR(RqRôR‰RÜ((RRñìs cCs1ti|ƒ}|i|_|i|ƒ|_|S(sFReturn a new container with contents only in a safe list, recursively.N(RãRçRôtoutputRqRötcontents(RqRôRç((RR÷ös  (RRRRrRöRñR÷(((RRêÕs  tParsercBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sA generic parsercCsd|_tƒ|_dS(Ni(RqtbeginRØRP(Rq((RRrs cCs,|iƒiƒ}|iƒ|i|_|S(sParse the headerN(treadert currentlineR�theadertnextlinet linenumberRqRû(RqRüRþ((Rt parseheader s   cCs|iƒiƒidƒo*|i|ƒ\}}||i|t>sXML parameter s should be <...>iiÿÿÿÿisEmpty XML parameter <>RzsErroneous attribute for s: s="0"R}N(NN(RüRýRRÿRŒRRR�RRRvRØtattrstattrtpartstattrkeyRw( RqRüRwR R R R�RvRR((RR$s0      cCsU|iptidt|ƒƒdSnx%|iƒi|iƒp |ƒq,WdS(s'Parse until the current ending is foundsNo ending for N( RqtendingRRRÆRüRýRtRñ(RqRüRñ((Rt parseending=s cCs:|ii|ƒ}|o|i|_|i|ƒndS(N(RqtfactorytcreatecontainerRüRôtparentRùRŠ(RqRüRùRô((RtparsecontainerEs cCs|iidt|iƒdS(sReturn a descriptions (RÁN(RqRæRRÆRû(Rq((RRâKs( RRRRrRRRR RRâ(((RRús       t LoneCommandcBstZdZd„ZRS(s"A parser for just one command linecCsgS(s Read nothingN((RqRü((RtparseRs(RRRR(((RROs t TextParsercBs/tZdZgZd„Zd„Zd„ZRS(s(A parser for a command and a bit of textcCsSti|ƒd|_|iiti joti |ii|_ng|_ dS(N( RúRrRqRR RôRæRR(R)(RqRô((RRr[s   cCsotii|iƒtitidtid|ig|_g}x%|i|ƒp|i ||ƒqFW|S(s$Parse lines as long as they are texttLayouttInsetN( RtstackRŠRqR R(R)RùtisendingRüR(RqRüRù((RRbs*cCs‚|iƒiƒ}t|ƒdjotSn|d|ijo=|dti joti i |dƒn gt_ t SntS(sCheck if text is endingiN( RüRýR�RƒRRRqR)RRtremoveR†(RqRüRƒ((RRls (RRRRRrRR(((RRVs   tExcludingParsercBstZdZd„ZRS(s%A parser that excludes the final linecs&g‰ˆiˆ‡‡‡d†ƒˆS(s5Parse everything up to (and excluding) the final linecsˆiˆˆƒS(N(RqRRüRù((RqRùRü(RRðsN(RùRqR Rü(RqRüRù((RqRüRùRR|s(RRRR(((RRys t BoundedParsercBstZdZd„ZRS(sA parser bound by a final linecCs ti||ƒ}|iƒ|S(s*Parse everything, including the final lineN(RRRqRüRùRÿ(RqRüRù((RR…s (RRRR(((RR‚s t BoundedDummycBstZdZd„ZRS(s&A bound parser that ignores everythingcs$|iˆ‡d†ƒˆiƒgS(s#Parse the contents of the containercs ˆiƒS(N(RüRÿ((Rü(RRð‘sN(RqR RüRÿ(RqRü((RüRR�s (RRRR(((RRŒs t StringParsercBs tZdZd„Zd„ZRS(sParses just a stringcCs|id|_gS(sDo nothing, just take noteiN(RüRRqRû(RqRü((RR™scCs|iƒ}|iƒ|S(sParse a single lineN(RüRýRùRÿ(RqRüRù((RRžs  (RRRRR(((RR–s  t InsetParsercBstZdZd„ZRS(sParses a LyX insetcCs\tid}x<|iƒdjo(|iƒi|ƒ o|i|ƒqWti ||ƒS(s(Parse inset parameters into a dictionaryRÝR|N( R(R-RÝRüRýRtRqRRR(RqRüRÝ((RR§s  *(RRRR(((RR¤s tContainerOutputcBs tZdZd„Zd„ZRS(s(The generic HTML output for a container.cCstidt|ƒƒdS(sShow an error.sgethtml() not implemented for N(RRRÆRq(RqRô((Rtgethtml¶scCstS(s5Decide if the output is empty: by default, not empty.N(R(Rq((Rtisemptyºs(RRRR R!(((RR³s  t EmptyOutputcBstZd„Zd„ZRS(NcCsgS(sReturn empty HTML code.N((RqRô((RR ÀscCstS(s"This output is particularly empty.N(R†(Rq((RR!Äs(RRR R!(((RR"¾s t FixedOutputcBstZdZd„ZRS(s Fixed outputcCs|iS(sReturn constant HTML codeN(RôR3(RqRô((RR Ës(RRRR (((RR#Ès tContentsOutputcBstZdZd„ZRS(s&Outputs the contents converted to HTMLcCsƒg}|idjo|Snx^|iD]S}t|dƒp-tid|ii dt |ƒƒ|Sn||i ƒ7}q(W|S(sReturn the HTML codeR s No html in s: N( R3RôRùRtelementR�RRRæRRÆR (RqRôR%R3((RR Òs %(RRRR (((RR$Ïs t TaggedOutputcBsetZdZeZeZeZeed„Zd„Z d„Z d„Z d„Z d„Z d„ZRS(s-Outputs an HTML tag surrounding the contents.cCs5||_|o ||_n|o ||_n|S(s/Set the value for the tag and other attributes.N(ttagRqt breaklinestempty(RqR'R(R)((Rtsettagås   cCs ||_|S(sSet the value for breaklines.N(R(Rq(RqR(((Rt setbreaklinesîs cCs`|io|i|ƒgSn|i|ƒg}|ti||ƒ7}|i|i |ƒƒ|S(sReturn the HTML code.N( RqR)t selfclosingRôtopenR3R$R RŠtclose(RqRôR3((RR ós cCs@|iƒpdSnd|id}|io |dSn|S(sGet opening line.R|RRs N(RqtchecktagR'R-R((RqRôR-((RR-üs   cCsN|iƒpdSnd|iiƒdd}|iod|dSn|S(sGet closing line.R|ss N(RqR/R'R,R((RqRôR,((RR,s   cCsE|iptidttƒƒtSn|idjotSntS(sCheck that the tag is valid.s No tag in R|N(RqR'RRRÆRôRR†(Rq((RR/s (RRRRR'RR(R)R*R+R R-R.R,R/(((RR&Þs   tFilteredOutputcBs2tZdZd„Zd„Zd„Zd„ZRS(s1Returns the output in the contents, but filtered:cCs g|_dS(sInitialize the filters.N(Rqtfilters(Rq((RRr$scCs|ii||fƒdS(s:Add a new filter: replace the original by the replacement.N(RqR1RŠRåt replacement(RqRåR2((Rt addfilter(scCsCg}ti||ƒ}x$|D]}|i|i|ƒƒqW|S(sReturn the HTML codeN( R“R$R RqRôR3tlineRŠtfilter(RqRôR3R“R4((RR ,scCsAx:|iD]/\}}||jo|i||ƒ}q q W|S(s0Filter a single line with all available filters.N(RqR1RåR2R4R€(RqR4R2Rå((RR54s   (RRRRrR3R R5(((RR0 s    t StringOutputcBstZdZd„ZRS(sReturns a bare string as outputcCs |igS(sReturn a bare stringN(RôR-(RqRô((RR >s(RRRR (((RR6;s t LineReadercBsVtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( sReads a file line by linecCs²t|tƒo ||_nti|ddƒ|_d|_d|_d|_ t |_ t |_ y|iƒWn;tj o/dk}|i|dƒ|_|iƒnXdS(NtrUsutf-8itrb(R„tfilenametfileRqtcodecsR-RRtlastlineRƒR†tmustreadRtdepletedtreadlinetUnicodeDecodeErrortgzip(RqR:RB((RRrOs       cCs1x!t|ƒD]}|iiƒq W||_dS(sSet the first line to read.N(tranget firstlineRRqR;R@R(RqRDR((Rtsetstartas  cCs ||_dS(sSet the last line to read.N(R=Rq(RqR=((RtsetendgscCs|io|iƒn|iS(sGet the current lineN(RqR>R@Rƒ(Rq((RRýks cCs(|iotidƒnt|_dS(sGo to next linesRead beyond file endN(RqR?RRR†R>(Rq((RRÿqs cCsÔ|iiƒ|_t|itiƒp|iidƒ|_nt|iƒdjo t |_ n|ii dƒ|_|i d7_ t |_dt|i ƒdt_|i ddjotidƒnd S( sRead a line from elyxer.filesutf-8is isLine s: iètParsingN(RqR;R@RƒR„R<tStreamReaderWritertdecodeRR†R?trstripRRR>RÆRRR (Rq((RR@ws  cCsD|io|i|ijotSn|io|iƒn|iS(s Find out if the file is finishedN(RqR=RR†R>R@R?(Rq((Rtfinished…s  cCs|iiƒdS(N(RqR;R.(Rq((RR.�s( RRRRrRERFRýRÿR@RKR.(((RR7Ls        t LineWritercBsAtZdZeZd„Zd„Zd„Zd„Zd„Z RS(s"Writes a file as a series of listscCs3t|tƒo||_d|_n ||_dS(N(R„R:R;RqR(RqR:((RRr•s  cCs_xX|D]P}t|tƒp-tidt|ƒdt|ƒƒdSn|i|ƒqWdS(sWrite a list of stringssNot a string: s in N( tstringsR-R„t basestringRRRÆRqt writestring(RqRMR-((RRœs%cCsc|ipti|iddƒ|_n|itijo|idƒ}n|ii |ƒdS(sWrite a stringtwsutf-8N( RqR;R<R-R:R R R-RR(RqR-((RRO¤s  cCs|i|dƒdS(sWrite a line to files N(RqROR4(RqR4((Rt writeline¬scCs|iiƒdS(N(RqR;R.(Rq((RR.°s( RRRRR;RrRRORQR.(((RRL�s     tGlobablecBsÎtZdZeZd„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zed„Zed„Zd„ZRS(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.cCstƒ|_dS(N(t EndingListRqt endinglist(Rq((RRr¿scCs@|iƒodSnt|iƒƒdjo|iƒndS(s*Check for a Unicode byte mark and skip it.Niÿþ(RqRKtordRƒt skipcurrent(Rq((Rt checkbytemarkÂs  cCstidƒtS(s+Find out if we are out of the position yet.sUnimplemented isout()N(RRR†(Rq((RtisoutÉs cCstidƒdS(sReturn the current character.sUnimplemented current()R|N(RR(Rq((RRƒÎs cCstidƒtS(s3Check for the given string in the current position.sUnimplemented checkfor()N(RRR(RqR-((RtcheckforÓs cCs@|iƒo#|ip|iiƒntSn|ii|ƒS(s*Find out if the current text has finished.N(RqRXt leavependingRTt checkpendingR†tcheckin(Rq((RRKØs   cCstidƒdS(s)Return the current character and skip it.sUnimplemented skipcurrent()R|N(RR(Rq((RRVàs cCs:d}x-|iƒ o|ƒo||iƒ7}q W|S(s>Glob a bit of text that satisfies a check on the current char.R|N(tglobRqRKt currentcheckRV(RqR^R]((RR]ås csˆi‡d†ƒS(sGlob a bit of alpha textcsˆiƒiƒS(N(RqRƒtisalpha((Rq(RRðîsN(RqR](Rq((RqRt globalphaìscsˆi‡d†ƒS(sGlob a row of digits.csˆiƒiƒS(N(RqRƒtisdigit((Rq(RRðòsN(RqR](Rq((RqRt globnumberðscCs2|iƒiƒp|iƒdjotSntS(s5Return if the current character is alphanumeric or _.t_N(RqRƒtisalnumR†R(Rq((Rt isidentifierôs&cCs|i|iƒS(s Glob alphanumeric and _ symbols.N(RqR]Re(Rq((RtglobidentifierúscCs:|iƒiƒotSn|iƒdjotSntS(s5Return if the current character is a value character:s{}()N(RqRƒtisspaceRR†(Rq((RtisvalueþscCs|i|iƒS(s'Glob a value: any symbols but brackets.N(RqR]Rh(Rq((Rt globvaluescsˆi‡d†ƒS(s(Skip all whitespace at current position.csˆiƒiƒS(N(RqRƒRg((Rq(RRð sN(RqR](Rq((RqRt skipspace scs-ˆi‡‡d†ƒˆ}ˆiˆƒ|S(s4Glob a bit of text up to (including) the magic char.csˆiƒˆjS(N(RqRƒt magicchar((RkRq(RRðsN(RqR]Rktskip(RqRkR]((RqRkRt globincludings csˆi‡‡d†ƒS(s?Glob a bit of text up until (excluding) any excluded character.csˆiƒˆjS(N(RqRƒtexcluded((RqRn(RRðsN(RqR](RqRn((RqRnRt globexcludingscCs|ii||ƒdS(sPush a new ending to the bottomN(RqRTtaddR toptional(RqR Rq((Rt pushendingscCss|iƒo|io|Sn|ii|ƒ}|o*||jotid|d|ƒn|i |ƒ|S(s,Pop the ending found at the current positionsExpected ending s, got N( RqRXRZtexpectedRTtpopR RRRl(RqRsR ((Rt popendings cCs(|ii|ƒ}|pdSn|iS(s$Return the next ending in the queue.N(RqRTt findendingt nextendingRR (RqRw((RRw's (RRRRRZRrRWRXRƒRYRKRVR]R`RbReRfRhRiRjRmRoRrRRuRw(((RRR¸s,                   RScBsYtZdZd„Zed„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( sA list of position endingscCs g|_dS(N(RqR)(Rq((RRr1scCs|iit||ƒƒdS(sAdd a new ending to the listN(RqR)RŠtPositionEndingR Rq(RqR Rq((RRp4scCs|i|ii7_dS(s/Pick any pending endings from a parse position.N(RqR)tposRT(RqRy((Rt pickpending8scCs|i|ƒotSntS(sSearch for an endingN(RqRvRyR†R(RqRy((RR\<scCsÉ|iƒotidƒdSn|i|ƒ}|ptid|iƒƒdSnx^t|i ƒD]M}|i i |ƒ||jo |iSqg|i ptid|ƒqgqgWtidƒdS(s)Remove the ending at the current positionsNo ending out of boundsR|s No ending at sRemoved non-optional ending sNo endings leftN( RyRXRRRqRvR RƒRR)teachRRq(RqRyR R{((RRtBs"      cCsrt|iƒdjodSnxMtt|iƒƒD]6\}}|i|ƒo|Sn|i pdSq4q4WdS(s'Find the ending at the current positioniN( RRqR)Rt enumerateRtindexR R\RyRq(RqRyR}R ((RRvTs   cCs9t|iƒdjotidt|ƒdƒndS(s&Check if there are any pending endingsisPending s left openN(RRqR)RRRÆ(Rq((RR[_scCsZd}x%|iD]}|t|ƒd7}qWt|iƒdjo|d }n|dS(sPrintable representations endings [R´iiÿÿÿÿt]N(R-RqR)R RÆR(RqR-R ((RRâds ( RRRRrRRpRzR\RtRvR[Râ(((RRS.s       RxcBs)tZdZd„Zd„Zd„ZRS(s An ending for a parsing positioncCs||_||_dS(N(R RqRq(RqR Rq((RRrps cCs|i|iƒS(sCheck for the endingN(RyRYRqR (RqRy((RR\tscCs)d|i}|io|d7}n|S(sPrintable representationsEnding s (optional)N(RqR R-Rq(RqR-((RRâxs   (RRRRrR\Râ(((RRxms   tPositioncBshtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„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().cCsti|ƒdS(N(RRRrRq(Rq((RRr†scCstidƒdS(s Skip a stringsUnimplemented skip()N(RR(RqR-((RRl‰scCstidƒdS(s.Return an identifier for the current position.sUnimplemented identifier()tErrorN(RR(Rq((Rt identifier�s cCstidƒdS(sHExtract the next string of the given length, or None if not enough text,sUnimplemented extract()N(RRR(Rqtlength((RRö’s cCs||it|ƒƒjS(s)Check for a string at the given position.N(R-RqRöR(RqR-((RRY˜scCsI|it|ƒƒ}|ptSn|iƒ|it|ƒƒiƒjS(s!Check for a string in lower case.N(RqRöRR-RíRtlower(RqR-Rí((Rt checkforlowerœs cCs|iƒ}|i|ƒ|S(s)Return the current character and skip it.N(RqRƒRl(RqRƒ((RRV£s  cCs|iƒ|iƒS(s3Advance the position and return the next character.N(RqRVRƒ(Rq((Rtnext©s cCs)|i|ƒptSn|i|ƒtS(s;Check for a string at the given position; if there, skip itN(RqRYR-RRlR†(RqR-((Rt checkskip®s  cCsti|d|iƒƒdS(s2Show an error message and the position identifier.s: N(RRR RqR�(RqR ((RRµs( RRRRrRlR�RöRYR„RVR…R†R(((RR�s          t TextPositioncBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s%A parse position based on a raw text.cCs-ti|ƒd|_||_|iƒdS(s*Create the position from elyxer.some text.iN(RRrRqRyttextRW(RqRˆ((RRr¼s    cCs|it|ƒ7_dS(sSkip a string of characters.N(RqRyRR-(RqR-((RRlÃscCs]d}|i|t|iƒjot|iƒ|i}nd|i|i|i|!dS(s&Return a sample of the remaining text.it*N(R‚RqRyRRˆ(RqR‚((RR�Çs cCs|it|iƒjS(s'Find out if we are out of the text yet.N(RqRyRRˆ(Rq((RRXÎscCs|i|iS(s6Return the current character, assuming we are not out.N(RqRˆRy(Rq((RRƒÒscCs=|i|t|iƒjodSn|i|i|i|!S(sHExtract the next string of the given length, or None if not enough text.N(RqRyR‚RRˆR(RqR‚((RRöÖs( RRRRrRlR�RXRƒRö(((RR‡¹s      t FilePositioncBs_tZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( s-A parse position based on an underlying file.cCs3ti|ƒt|ƒ|_d|_|iƒdS(s Create the position from a file.iN(RRrRqR7R:RüRyRW(RqR:((RRrßs   cCsxt|ƒ}xV|i|t|iiƒƒjo2|t|iiƒƒ|id8}|iƒqW|i|7_dS(sSkip a string of characters.iN(RR-R‚RqRyRüRýRÿ(RqR-R‚((RRlæs #$cCs |iiƒS(s,Get the current line of the underlying file.N(RqRüRý(Rq((RRýîscCs|iiƒd|_dS(sGo to the next line.iN(RqRüRÿRy(Rq((RRÿòs cCs|iidS(s#Return the line number of the file.iN(RqRüR(Rq((RR÷scCsT|iiƒ|id }|iiƒ|i}dt|iƒƒd|d|S(s4Return the current line and line number in the file.isline s: R‰N(RqRüRýRytbeforetafterRÆt getlinenumber(RqRŒR‹((RR�ûscCsŒ|it|iiƒƒjo`|it|iiƒƒdjo/tid|iiƒdt|iƒƒn|iƒn|ii ƒS(s'Find out if we are out of the text yet.isOut of the line s: N( RqRyRRüRýRRRÆRÿRK(Rq((RRXs #/cCs�|it|iiƒƒjodSn|it|iiƒƒjo3tid|iiƒdt|iƒƒdSn|iiƒ|iS(s6Return the current character, assuming we are not out.s sOut of the line s: R‰N(RqRyRRüRýRRRÆ(Rq((RRƒ s+cCsI|i|t|iiƒƒjodSn|iiƒ|i|i|!S(sHExtract the next string of the given length, or None if not enough text.N(RqRyR‚RRüRýR(RqR‚((RRös#( RRRRrRlRýRÿRR�RXRƒRö(((RRŠÜs         t ContainercBsÔtZdZeZeZeZd„Zd„Zd„Z d„Z e i d„Z d„Zd„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zdd„Zd„Zd„Zd„Zd„ZRS(s.A container for text and objects in a lyx filecCstƒ|_dS(N(R‰RqRù(Rq((RRr!scCsdS(sProcess contentsN((Rq((RRñ$scCsM|ii|ƒ}t|tƒotid|ƒ|g}n|i|ƒS(sGet the resulting HTMLs Raw string N( RqRøR R3R„RNRRt escapeall(RqR3((RR (s  cCs g}x“|D]‹}tio|i|tiƒ}ntio(|i|tiƒ}|i |ƒ}n$ti p|i|ti ƒ}n|i |ƒq W|S(s=Escape all lines in an array according to the output options.N( R“tlinesR4R�R3RqtescapeR/R4tescapeentitiesRÆR5RŠ(RqR�R“R4((RR�0s   cCsR|iƒ}|iƒx5|D]-}||jo|i|||ƒ}qqW|S(s1Escape a line with replacements from elyxer.a mapN(t replacementstkeystpiecestsorttpieceR4R€(RqR4R“R—R•((RR‘>s   cCs½d}t|ƒ}x¤|iƒp–t|iƒƒdjo_tt|iƒƒƒ}|djo tt|i ƒƒdƒ}n|d|dd7}n||iƒ7}|i ƒqW|S( s/Escape all Unicode characters to HTML entities.R|i€t0xd835iøs&#it;N( R“R‡R4RyRKRURƒthext codepointR…RV(RqR4R›RyR“((RR’Hs    cs g‰|i|‡d†ƒˆS(s2Search for all embedded containers of a given typecs ˆi|ƒS(N(R‰RŠRô(Rô(R‰(RRðZsN(R‰Rqt searchprocessRè(RqRèR‰((R‰Rt searchallWscCs7|i|ƒ}x!|D]}|iii|ƒqW|S(s3Search for all containers of a type and remove themN(RqR�RèR‰RôRRùR(RqRèR‰Rô((Rt searchremove]s cs|i‡d†|ƒdS(s4Search for elements of a given type and process themcs t|ˆƒS(N(R„RôRè(Rô(Rè(RRðfsN(Rqt locateprocessRñ(RqRèRñ((RèRRœdscCsCx<|iD]1}|i||ƒ||ƒo||ƒq q WdS(s3Search for all embedded containers and process themN(RqRùRôRŸRòRñ(RqRòRñRô((RRŸhs   cCsWxP|iD]E}||ƒo|i|||ƒn||ƒo||ƒq q WdS(s,Perform a recursive search in the container.N(RqRùRôRóRõRòRñ(RqRòRóRñRô((RRõos   cCs@d}ttiƒi|ƒ}x|D]}||i7}q%W|S(s0Extract all text from elyxer.allowed containers.R|N( R“RêR(R*RöRqRYtconstantR-(RqR R“RY((RR*wscCs½|t|iƒjodSnt|i|dƒodSnxf|t|iƒjoO||i|ƒo;t|i|_|ii |i|ƒ|ii |ƒq@W|ii ||ƒdS(s*Group some adjoining elements into a groupNtgrouped( R}RRqRùR�t isingroupR†R¡RiRŠRtRŽ(RqR}RiR¢((RRis*cCs[|i|}|ii|ƒx7t|iƒdjo |ii||iiƒƒq WdS(s)Remove a container but leave its contentsiN(RqRùR}RôRtRRŽ(RqR}Rô((RR‹s  icCsDtid|t|ƒƒx"|iD]}|i|dƒq%WdS(sShow in a trees iN(RR tlevelRÆRqRùRôttree(RqR£Rô((RR¤’s  cCs#||ijodSn|i|S(s)Get the value of a parameter, if present.N(RÜRqRPR(RqRÜ((Rt getparameter˜scCs+|i|ƒ}|pgSn|idƒS(s7Get the value of a comma-separated parameter as a list.R´N(RqR¥RÜt paramtextR�(RqRÜR¦((Rtgetparameterlistžs cCs=|i}x-|o%|iiƒotSn|i}q WtS(s&Check if the parent's output is empty.N(RqRRƒRøR!R†R(RqRƒ((Rthasemptyoutput¥s cCs3|ip|iiSn|iidt|iƒS(sGet a descriptiont@N(RqRûRæRRÆ(Rq((RRâ®s (RRRRtpartkeyRRûRrRñR R�R/R2R‘R’R�RžRœRŸRõR*RiRR¤R¥R§R¨Râ(((RRŽs.                 tBlackBoxcBstZdZd„ZRS(s)A container that does not output anythingcCs%tƒ|_tƒ|_g|_dS(N(RRqR’R"RøRù(Rq((RRr·s  (RRRRr(((RR«´s t LyXFormatcBstZdZd„ZRS(sRead the lyxformat commandcCstt|idƒ}|djotidt|ƒƒn|ttidƒjotidt|ƒƒndS(sShow warning if version < 276iis(Warning: unsupported old format version Ržs(Warning: unsupported new format version N(R¡RqRþRNRRtstrRM(RqRN((RRñ¿s  (RRRRñ(((RR¬¼s tStringContainercBsJtZdZeZd„Zd„Zd„Zd„Zd„Z d„Z RS(sA container for a single stringcCs%tƒ|_tƒ|_d|_dS(NR|(RRqR’R6RøR-(Rq((RRrÌs  cCs0|io"|i|iƒ|_d|_ndS(s/Replace special chars from elyxer.the contents.N(RqtparsedtreplacespecialR-R(Rq((RRñÑs cCs•|i|tiƒ}|i|ƒ}tid|joYt |ƒdjoF|i odt |i ƒd}nd}t i||iƒƒn|S(s,Replace all special chars from elyxer.a lineRÝisUnknown command at s: sUnknown command: N(RqR‘R4R/R2R't changelineR(R-RRûRÆR RRR(RqR4R'R ((RR°×s' cCsJ|i|tiƒ}tid|jo|Sn|i|tiƒ}|S(NRÝ(RqR‘R4R/R0R(R-R1(RqR4((RR±äs cCs|iS(sReturn all text.N(RqR-(Rq((RR*ëscCsxd}|io|dt|iƒ7}nd}t|iiƒƒdjo d}n|d|iiƒd |dS( s"Return a printable representation.R®R©s...iR|s (RÁN(R“RqRûRÆtellipsisRR-R(RqR²R“((RRâïs  ( RRRRR¯RrRñR°R±R*Râ(((RR®Çs     tConstantcBs tZdZd„Zd„ZRS(sA constant stringcCs"g|_||_tƒ|_dS(N(RqRùRˆR-R6Rø(RqRˆ((RRrüs  cCs d|iS(Ns Constant: (RqR-(Rq((RRâ s(RRRRrRâ(((RR³ùs  t TaggedTextcBs>tZdZeZd„Zed„Zed„Zd„Z RS(sText inside a tagcCst|ƒ|_tƒ|_dS(N(RRqR’R&Rø(Rq((RRr scCs%||_||i_||i_|S(s&Complete the tagged text and return itN(RùRqR'RøR((RqRùR'R(((Rtcomplete s    cCs"t|ƒ}|i|g||ƒS(s(Complete the tagged text with a constantN(R³RˆR RqRµR'R((RqRˆR'R(R ((RR  s cCsBt|idƒpdSn|iipdSnd|iidS(s"Return a printable representation.R'sEmtpy tagged textsTagged sTagged ).R)N(R&R*R'R†RqRø(RqR'((Rt selfcompleteñ s(RRRR RRµRç(((RRåâ s   RæcBs2tZdZd„Zd„Zd„Zd„ZRS(sA constant string in a formulacCs/ti||ƒ||_d|_d|_dS(sSet the constant stringiN(R³RrRqR-RåR`RRè(RqR-((RRrù s   cCs|iS(s+Compute the size of the constant: always 1.N(RqR`(Rq((RRä scCs t|iƒS(sReturn a copy of itself.N(RæRqRå(Rq((RRç scCs d|iS(s"Return a printable representation.sFormula constant: N(RqR-(Rq((RRâ s(RRRRrRäRçRâ(((RRæö s    tRawTextcBs tZdZd„Zd„ZRS(sA bit of text inside a formulacCs|iƒiƒS(sDetect a bit of raw textN(RyRƒR_(RqRy((Rtdetect scCs,|iƒ}|it|ƒƒd|_dS(sParse alphabetic textRN(RyR`RRqRpRæRè(RqRyR((Rtparsebit s (RRRRéRê(((RRè s  t FormulaSymbolcBs?tZdZeiZeidZd„Zd„Zd„ZRS(sA symbol inside a formulat characterscCs@|iƒtijotSn|iƒtijotSntS(sDetect a symbolN(RyRƒRëRKR†RFR(RqRy((RRé s cCsŽ|iƒtijo|i|iƒ|ƒdSn|iƒtijo%|iti|iƒ|ƒdSntid|iƒdƒdS(sParse the symbolNsSymbol s not found( RyRƒRëRKRqt addsymbolRFRR(RqRy((RRê' scCs0|i|iƒ|ƒ|iit|ƒƒdS(s Add a symbolN(RqRáRyRƒRùRŠRætsymbol(RqRîRy((RRí1 s( RRRR6RFRKRéRêRí(((RRë s     t FormulaNumbercBs tZdZd„Zd„ZRS(sA string of digits in a formulacCs|iƒiƒS(sDetect a digitN(RyRƒRa(RqRy((RRé9 scs5ˆi‡d†ƒ}|it|ƒƒd|_dS(sParse a bunch of digitscsˆiƒiƒS(N(RyRƒRa((Ry(RRð? sR¿N(RyR]tdigitsRqRpRæRè(RqRyRð((RyRRê= s(RRRRéRê(((RRï6 s  tCommentcBs-tZdZeidZd„Zd„ZRS(s*A LaTeX comment: % to the end of the line.tcommentcCs|iƒ|ijS(s Detect the %.N(RyRƒRqRÜ(RqRy((RRéH scCs|i|idƒ7_dS(sParse to the end of the line.s N(RqRåRyRm(RqRy((RRêL s(RRRR6R,RÜRéRê(((RRñC s   t WhiteSpacecBs)tZdZd„Zd„Zd„ZRS(s"Some white space inside a formula.cCs|iƒiƒS(sDetect the white space.N(RyRƒRg(RqRy((RRéS scCs|i|iƒ7_dS(sParse all whitespace.N(RqRåRyRj(RqRy((RRêW scCsd|idS(s"Return a printable representation.s Whitespace: *R‰N(RqRå(Rq((RRâ[ s(RRRRéRêRâ(((RRóP s   tBracketcBsytZdZeidZeidZd„Zd„Z d„Z d„Z d„Z d„Z d„Zd „Zd „ZRS( sA {} bracket inside a formulaRÒcCsti|ƒd|_dS(s'Create a (possibly literal) new bracketN(RÞRrRqRtinner(Rq((RRre s cCs|i|iƒS(sDetect the start of a bracketN(RyRYRqRÜ(RqRy((RRéj scCs|i||iƒ|S(sParse the bracketN(Rqt parsecompleteRyt innerformula(RqRy((RRên scCs|i||iƒ|S(sParse a text bracketN(RqRöRyt innertext(RqRy((Rt parsetexts scCs|i||iƒ|S(sParse a literal bracketN(RqRöRyt innerliteral(RqRy((Rt parseliteralx scCs“|i|iƒp*tid|id|iƒƒdSn|i|i|ƒ|i |i ƒ||ƒ|i |i |i ƒ7_ |iƒdS(sParse the start and end markssBracket should start with s at N(RyRYRqRÜRRR�RRáRrR t innerparserRåRuRä(RqRyRü((RRö} s" cCs2x+|iƒp|i|ii|ƒƒqWdS(s(Parse a whole formula inside the bracketN(RyRKRqRpRtparseany(RqRy((RR÷ˆ s cCsÌtiiƒ}|itidƒ|itidƒ|itiƒx~|i ƒpp|i ƒ|jo@|i |i i|ƒƒ|idƒo|id7_qÃqJ|i t|iƒƒƒqJWdS(s<Parse some text inside the bracket, following textual rules.RÑRÒR‹N(R6RIR”t specialcharsRŠR,RñRÜRyRKRƒRqRpRRýR†RåRæRV(RqRyRþ((RRø� s cCsˆd|_xf|iƒ oW|iƒ|ij o@|iƒ|ijo|i|ƒq |i|iƒ7_q W|i |i7_ dS(sAParse a literal inside the bracket, which does not generate HTML.R|N( RqtliteralRyRKRƒR RÜRûRVRå(RqRy((RRú› s %(RRRR6R,RÜR)R RrRéRêRùRûRöR÷RøRú(((RRô_ s          t SquareBracketcBs1tZdZeidZeidZd„ZRS(sA [] bracket inside a formulat squarebracketcCstƒ}|i|_|S(s3Return a new square bracket with the same contents.N(RRÒRqRù(RqRÒ((RRç« s  ( RRRR6R,RÜR)R Rç(((RR¥ s   tMathsProcessorcBs tZdZd„Zd„ZRS(sAA processor for a maths construction inside the FormulaProcessor.cCstidt|ƒƒdS(s$Process an element inside a formula.sUnimplemented process() in N(RRRÆRq(RqRùR}((RRñ¶ scCsd|iiS(sReturn a printable description.sMaths processor N(RqRæR(Rq((RR⺠s(RRRRñRâ(((RR³ s  tFormulaProcessorcBsJtZdZgZd„Zd„Zd„Zd„Zd„Zd„Z RS(s&A processor specifically for formulas.cCs+|i|ƒ|i|ƒ|i|ƒdS(s7Process the contents of every formula bit, recursively.N(RqtprocesscontentsRàtprocessinsidest traversewhole(RqRà((RRñà s  cCsGt|tƒpdSn|iƒx|iD]}|i|ƒq,WdS(s&Process the contents of a formula bit.N(R„RàRÞRñRùR%RqR(RqRàR%((RRÉ s  cCspt|tƒpdSnxQt|iƒD]@\}}x$|iD]}|i |i|ƒq>W|i |ƒq(WdS(s8Process the insides (limits, brackets) in a formula bit.N( R„RàRÞR|RùR}R%Rqt processorst processorRñR(RqRàR}RR%((RRÑ s  cCs˜d}x‹|i|ƒD]z\}}|idjo|i||ƒnE|idjo4|o-|idjo|ii dt dƒƒn|}qWdS(s>Traverse over the contents to alter variables and space units.RtfontR¿iuâ�ŸN( RtlastRqttraverseRÌRàRùRèt italicizeRŽRæ(RqRÌR RàRù((RRÛ s 'ccsuxn|iD]c}t|dƒo|io||ifVq t|tƒo"x|i|ƒD] }|Vq[Wq q WdS(sHTraverse a formula and yield a flattened structure of (bit, list) pairs.RèN( RàRùR%R�RèR„RÞRqR tpair(RqRàR%R ((RR å s cCs/|i|ƒ}tƒi|gdƒ||N( R6RLturllibt quote_plusRqR¯turltimgR³Rù(RqRR((RRÖ scCs>tƒi|iƒ}tƒi|ƒ||_|g|_dS(sEMake the contents using classic output generation with XHTML and CSS.N( tFormulaFactoryRËRqR¯twholeRRñRRù(RqR((RR# s  cCs¥|idƒo|i|ƒnw|idƒo|i|ƒnV|idƒo|i|dƒn2|idƒo|i|dƒn|idƒ|iƒ|S( s4Parse using a parse position instead of self.parser.s$$t$s\(s\)s\[s\]sUnparseable formulaN( RyR†Rqtparsedollarblocktparsedollarinlinet parseinlinetot parseblocktoRRñ(RqRy((RR* s  cCsdg|_|i|ƒdS(sParse a $...$ formula.RÄN(RqRþt parsedollarRy(RqRy((RR9 s cCs>dg|_|i|ƒ|idƒp|idƒndS(sParse a $$...$$ formula.RÆRs1Formula should be $$...$$, but last $ is missing.N(RqRþRRyR†R(RqRy((RR> s   cCs0|idƒ|idƒ|_|idƒdS(sParse to the next $.RN(RyRrRoRqR¯Ru(RqRy((RRE s cCs dg|_|i||ƒdS(sParse a \(...\) formula.RÄN(RqRþt parseuptoRytlimit(RqRyR((RRK s cCs dg|_|i||ƒdS(sParse a \[...\] formula.RÆN(RqRþRRyR(RqRyR((RRP s cCs3|i|ƒ|id„ƒ|_|i|ƒdS(s1Parse a formula that ends with the given command.cCstS(N(R†(((RRðX sN(RyRrRR]RqR¯Ru(RqRyR((RRU s cCs1|io#|iiod|iidSndS(s"Return a printable representation.s Formula (RÁsUnnumbered formulaN(RqRªR¿(Rq((RRâ[ s(RRRRrRñRÎRÏRÖRRRRRRRRRâ(((RRö s              t WholeFormulacBs tZdZd„Zd„ZRS(sParse a whole formulacCs |iƒ S(s"Not outside the formula is enough.N(RyRK(RqRy((RRéd scCs2x+|iƒp|i|ii|ƒƒqWdS(sParse with any formula bitN(RyRKRqRpRRý(RqRy((RRêh s (RRRRéRê(((RRa s  RcBs‰tZdZeeeeeegZ eegZ e Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd „ZRS( sConstruct bits of formulacCstƒ|_dS(s Initialize the map of instances.N(RØRqt instances(Rq((RRru scCs+|iƒotSn|i|ƒi|ƒS(sDetect a bit of a given type.N(RyRKRRqRÂRèRé(RqRèRy((Rt detecttypey s cCsD||ijp|i| o|i|ƒ|i||iD]3}|i|ƒi|ƒo|i||ƒSq q WdS(sSkip any skipped types.N(Rqt skippedtypesRèRÂRéRyRÂR(RqRyRè((RR!� s  cCsix?|i|iD]-}|i||ƒo|i||ƒSqqWtid|i ƒƒt |i ƒƒS(s.Parse any formula bit at the current location.sUnrecognized formula at N( RqttypesR#RèR RyRÂRRR�RæRV(RqRyRè((RRý— scCsG|i|ƒ}d|i|<|i|ƒ}|o|i |ƒSn|S(s#Parse the given type and return it.N( RqRÂRèRàRRRêRyt returnedbitRß(RqRèRyR%Rà((RRŸ s cCsˆt|ƒ}|itƒ}|i|ƒo|i|ƒ|Sn|i ƒp7t i d|i ƒƒ|i tƒi|dƒƒn|S(s5Parse a string of text that contains a whole formula.sUnknown formula at: sspan class="unknown"N(R‡RÌRyRqRäRRRéRêRKRRR�RpRåR (RqRÌRyR((RR˨ s    (RRRRëRèRïRôRñRóR$R#RtdefiningRrR RÂRäR"R!RýRÂRË(((RRm s          t TranslatorcBsMtZdZeZd„ZeeƒZd„Zd„Zd„Z d„Z RS(s=Reads the configuration file and tries to find a translation.cCs|ii|ƒS(s%Get the translated message for a key.N(R RÂt getmessageRv(R Rv((Rt translateÎ scCsd|_t|_dS(N(RRqt translationR†tfirst(Rq((RRrÔ s cCsÖd|_tiptidƒdSntitijotidtiƒdSntitidjodSntitig}yt i dd|ƒ|_ Wn*t j otidt |ƒƒnXdS(s/Find the translation for the document language.sNo language in documentNsUnknown language tentelyxersNo translation for ( RRqt langcodesR¶R¼RRRmRntgettextR*tIOErrorRÆ(RqR.((RtfindtranslationØ s   cCsr|io|iƒt|_n|i|ƒ}|ip|Sny|ii|ƒ}Wnt j onX|S(s-Get the translated message for the given key.N( RqR+R1RtgetuntranslatedRvR R*tugettextR0(RqRvR ((RR(é s    cCs4|tijotid|ƒ|Snti|S(sGet the untranslated message.sCannot translate N(RvRmRYRR(RqRv((RR2÷ s ( RRRRRÂR)RRrR1R(R2(((RR'È s      t NumberCountercBsÒtZdZeZeZeZeZdZe i dZ d)d*d+d,d-d.d/d0d1d2d3d4d5g Z d„Z d„Zd„Zd „Zd!„Zd"„Zd#„Zd$„Zd%„Zd&„Zd'„Zd(„ZRS(6s#A counter for numbers (by default).tABCDEFGHIJKLMNOPQRSTUVWXYZtsymbolstMiètCMi„tDiôtCDi�tCidtXCiZtLi2tXLi(tXi tIXi tVitIVitIicCs ||_dS(sGive a name to the counter.N(RÜRq(RqRÜ((RRr scCs ||_|S(s0Set the counter mode. Can be changed at runtime.N(R—Rq(RqR—((Rtsetmode s cCs ||_dS(sSet an initial value.N(RwRq(RqRw((Rtinit scCs t|iƒS(s$Get the next value as a text string.N(RÆRqRw(Rq((RR/ scCs|i|iƒS(sGet the next value as a letter.N(Rqt getsequencetletters(Rq((Rt getletter$ scCs|i|iƒS(sGet the next value as a symbol.N(RqRFR6(Rq((Rt getsymbol( scCs||idt|ƒS(s*Get the next value from elyxer.a sequence.iN(RRqRwR(RqR((RRF, scCsZd}|i}xD|iD]9\}}||jo ||||7}||}qqW|S(s%Get the next value as a roman number.R|N(R“RqRwR¿t romannumeralstnumeral(RqRKR“RwR¿((Rtgetroman0 s   cCsË|i p|iddgjo|iƒSn|idjo|iƒSn|idjo|iƒiƒSn|idjo|iƒSn|idjo|iƒSntid|iƒ|iƒS( s8Get the current value as configured in the current mode.RˆRàtAtaRCR‰sUnknown counter mode N( RqR—R/RHRƒRLRIRR(Rq((Rtgetvalue: s!cCs0|ip d|_n|id7_|iƒS(s@Increase the current value and get the next value as configured.iiN(RqRwRO(Rq((RtgetnextI s   cCs d|_dS(sReset the counter.iN(RqRw(Rq((RtresetP scCs0d|i}|io|d|i7}n|S(s"Return a printable representation.sCounter s in mode N(RqRÜR“R—(RqR“((RRâT s   (R7iè(sCMi„(R9iô(sCDi�(R;id(sXCiZ(R=i2(sXLi((R?i (sIXi (RAi(sIVi(RCi(RRRRRÜRwR—tmasterRGRZRR6RJRrRDRER/RHRIRFRLRORPRQRâ(((RR4 s*  -          tDependentCountercBs)tZdZd„Zd„Zd„ZRS(s4A counter which depends on another one (the master).cCs||_|iiƒ|_|S(sSet the master counter.N(RRRqROR (RqRR((Rt setmaster^ s cCsL|i|iiƒjo|iƒnti|ƒ}|iiƒ|_|S(s8Increase or, if the master counter has changed, restart.N(RqR RRRORQR4RPRw(RqRw((RRPd s cCs|iiƒdti|ƒS(s8Get the value of the combined counter: master.dependent.t.N(RqRRROR4(Rq((RROl s(RRRRTRPRO(((RRS[ s   tNumberGeneratorcBstZdZeZeZgZeidD]Z ee i ƒq*[Z gZeidD]Z ee i ƒqX[Z e ƒZeZd„Zd„Zd„Zd„Zd„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„ZRS(sMA number generator for unique sequences and hierarchical structures. Used in:tromantorderedcCs|iddƒS(s.Remove the possible asterisk in a layout type.R‰R|N(RèR€(RqRè((Rt deasterisk€ scCs |i|ƒS(s9Find out if the layout type corresponds to a unique part.N(RqtisromanRè(RqRè((Rtisunique„ scCs|i|ƒiƒ|ijS(s9Find out if the layout type should have roman numeration.N(RqRYRèRƒt romanlayouts(RqRè((RRZˆ scCs|i|ƒiƒ|ijS(s?Find out if the layout type corresponds to an (un)ordered part.N(RqRYRèRƒtorderedlayouts(RqRè((Rt isinorderedŒ scCsjd|jotSn|i|ƒotSn|i|ƒptSn|i|ƒtijotSntS(sCFind out if the type for a layout corresponds to a numbered layout.R‰N( RèRRqRZR†R^tgetlevelR¶R»(RqRè((Rt isnumbered� s cCs d|jS(s5Find out if the type contains an asterisk, basically.R‰N(Rè(RqRè((Rt isunorderedœ scCsw|i|ƒodSn|i|ƒptid|ƒdSn|i|ƒiƒ}|ii |ƒd}|t i S(s0Get the level that corresponds to a layout type.isUnknown layout type iN( RqR[RèR^RRRYRƒR]R}R£R¶Rº(RqRèR£((RR_  scCs5tio|i|ƒdjodSn|i|ƒS(s4Obtain the type for the part: without the asterisk, itAppendixN(RVtappendixRqR_RèRY(RqRè((Rt getparttype« s  cCs|i|ƒiƒS(s$Generate a number for a layout type.N(Rqt getcounterRèRP(RqRè((Rtgenerate² s cCsA|iƒ}||ijo|i|ƒ|i|(RqR3(Rq((RRñ‹ s(RRRRrRñ(((RR“„ s  t EmphaticTextcBstZdZd„ZRS(sText with emphatic modecCsd|i_dS(NR(RqRøR'(Rq((RRñ‘ s(RRRRñ(((RR”Ž s t ShapedTextcBstZdZd„ZRS(sText shaped (italic, slanted)cCsi|id|_|itijo,tid|idƒd|i_dSnti|i|i_dS(NisUnrecognized shape tspan( RqRþRèReRlRRRøR'(Rq((RRñ— s  (RRRRñ(((RR•” s tVersalitasTextcBstZdZd„ZRS(sText in versalitascCsd|i_dS(Nsspan class="versalitas"(RqRøR'(Rq((RRñ¢ s(RRRRñ(((RR—Ÿ s t ColorTextcBstZdZd„ZRS(s Colored textcCs+|id|_d|id|i_dS(Nis span class="R}(RqRþRÛRøR'(Rq((RRñ¨ s(RRRRñ(((RR˜¥ s tSizeTextcBstZdZd„ZRS(s Sized textcCs+|id|_d|id|i_dS(Nis span class="R}(RqRþR`RøR'(Rq((RRñ¯ s(RRRRñ(((RR™¬ s tBoldTextcBstZdZd„ZRS(s Bold textcCsd|i_dS(Ntb(RqRøR'(Rq((RRñ¶ s(RRRRñ(((RRš³ s t TextFamilycBstZdZd„ZRS(s,A bit of text from elyxer.a different familycCsb|id|_|itijo%tidtƒd|i_dSnti|i|i_dS(sParse the type of familyisUnrecognized family R–N( RqRþRèReRgRRRøR'(Rq((RRñ¼ s (RRRRñ(((RRœ¹ s tHfillcBstZdZd„ZRS(sHorizontall fillcCsd|i_dS(Nsspan class="hfill"(RqRøR'(Rq((RRñÈ s(RRRRñ(((RR�Å s t BarredTextcBstZdZd„ZRS(sText with a bar somewherecCse|id|_|itijo(tid|iƒd|i_dSnti|i|i_dS(sParse the type of barisUnknown bar type R–N( RqRþRèReRfRRRøR'(Rq((RRñÎ s (RRRRñ(((RRžË s tLangLinecBstZdZd„ZRS(s A line with language informationcCs|id|_dS(Ni(RqRþtlang(Rq((RRñÚ s(RRRRñ(((RRŸ× s t InsetLengthcBstZdZd„ZRS(s!A length measure inside an inset.cCs|id|_dS(Ni(RqRþR‚(Rq((RRñà s(RRRRñ(((RR¡Ý s tSpacecBs)tZdZd„Zd„Zd„ZRS(sA space of several typescCstƒ|_tƒ|_dS(N(RRqR’R#Rø(Rq((RRræ s cCs±|id|_|itijo(tid|iƒdg|_dSnti|ig|_|iƒ}|pdSnt ƒi dt ƒ|_ tƒi|ƒi|ƒdS(NisUnknown space type R‹sspan class="hspace"(RqRþRèR\R]RRR3t getlengthR‚R&R*RRøRtRÞR‘(RqR‚((RRñê s  cCsDt|iƒdjpt|idtƒ odSn|idiS(s<Get the space length from elyxer.the contents or parameters.iN(RRqRùR„R¡RR‚(Rq((RR£÷ s.(RRRRrRñR£(((RR¢ã s   t VerticalSpacecBs tZdZd„Zd„ZRS(s(An inset that contains a vertical space.cCstƒ|_tƒ|_dS(N(RRqR’R#Rø(Rq((RRrs cCsh|id|_|itijo+tƒid|idtƒ|_dSnti|ig|_ dS(sSet the correct tagis"div class="vspace" style="height: s;"N( RqRþRèR\RaR&R*R†RøR3(Rq((RRñs #(RRRRrRñ(((RR¤ý s  tAligncBs tZdZd„Zd„ZRS(sBit of aligned textcCs%tƒ|_tƒitƒ|_dS(N(RRqR’R&R+R†Rø(Rq((RRrs cCsd|idd|i_dS(Ns div class="iR}(RqRþRøR'(Rq((RRñs(RRRRrRñ(((RR¥ s  tNewlinecBs tZdZd„Zd„ZRS(s A newlinecCstƒ|_tƒ|_dS(N(RRqR’R#Rø(Rq((RRrs cCsdg|_dS(sProcess contentss
N(RqR3(Rq((RRñs(RRRRrRñ(((RR¦s  tNewPagecBstZdZd„ZRS(s A new pagecCsdg|_dS(sProcess contentss


N(RqR3(Rq((RRñ$s(RRRRñ(((RR§!s t SeparatorcBstZdZd„ZRS(s;A separator string which is not extracted by extracttext().cCs%tƒ|_g|_|g|_dS(N(R#RqRøRùR R3(RqR ((RRr+s  (RRRRr(((RR¨(s t StrikeOutcBstZdZd„ZRS(sStriken out text.cCsd|i_dS(sSet the output tag to strike.tstrikeN(RqRøR'(Rq((RRñ3s(RRRRñ(((RR©0s t StartAppendixcBstZdZd„ZRS(sMark to start an appendix here.cCstiiƒdS(sDActivate the special numbering scheme for appendices, using letters.N(RVRoRm(Rq((RRñ;s(RRRRñ(((RR«7s tLinkcBsqtZdZeZeZeZeZeZeZ eZ d„Z eeeed„Z d„Z d„Zd„ZRS(s&A link to another part of the documentcCs?g|_tƒ|_tƒ|_tioti|_ndS(s.Initialize the link, add target if configured.N(RqRùRR’t LinkOutputRøR�RÊ(Rq((RRrOs     cCsft|ƒg|_|o ||_n|o ||_n|o ||_n|o ||_n|S(sComplete the link.N(R³RˆRqRùtanchorRRèRÇ(RqRˆR®RRèRÇ((RRµWs    cCsj|ipdSnd|_|iiod|ii|_n|iio|ii|i|_ndS(s8Use the destination link to fill in the destination URL.NR|t#(Rqt destinationRR®tpage(Rq((Rtcomputedestinationds    cCs||_||_dS(sESet another link as destination, and set its destination to this one.N(R°Rq(RqR°((Rtsetmutualdestinationns cCsHd}|io|d|i7}n|io|d|i7}n|S(s"Return a printable representation.R¬s #s to N(R“RqR®R(RqR“((RRâss  (RRRRR®RRèR±RÊR°RÇRrRµR²R³Râ(((RR¬Ds   tURLcBstZdZd„ZRS(sA clickable URLcCs‡|i|idƒƒ}||_|idƒ}|o|i|ƒ||_n|idƒ}|p |}nt|ƒg|_dS(sRead URL from elyxer.parametersRÊRèRÜN( RqR‘R¥RÊRRèRÜR³Rù(RqRèRÊRÜ((RRñs  (RRRRñ(((RR´|s tFlexURLcBstZdZd„ZRS(sA flexible URLcCs|iƒ|_dS(sRead URL from elyxer.contentsN(RqR*R(Rq((RRñŽs(RRRRñ(((RRµ‹s R­cBstZdZd„ZRS(s#A link pointing to some destinationcCsî|ii}|io |i}nd|d}|io|d|id7}n|io|iƒn|io|d|id7}n|i o|d|i d7}n|i o|d|i d7}nt ƒi |ƒi |ƒS(sGet the HTML code for the links a class="R}s name="s href="s target="s title="N(tlinkRæRRèR'R®R°R²RRÊRÇR&R*R (RqR¶RèR'((RR –s         (RRRR (((RR­’s t PostprocessorcBs8tZdZgZd„Zd„Zd„Zd„ZRS(s,Postprocess a container keeping some contextcCs+tti|ƒ|_d|_d|_dS(N(t StageDictR·tstagesRqRRƒR (Rq((RRr±s cCs8|i|iƒ|i|ƒ}|i|_||_|S(s)Postprocess a container and its contents.N(Rqt postrecursiveRƒt postcurrentR…R“R (RqR…R“((Rt postprocess¶s   cCsñt|dƒpdSnt|iƒdjodSnt|dƒo|ipdSq\ntƒ}g}x8|iD]-}|i|ƒ}|o|i |ƒququWx;t dƒD]-}|idƒ}|o|i |ƒq³q³W||_dS(s.Postprocess the container contents recursivelyRùNiR¼i( R�RôRRùR¼R·t postprocessorR%tpostRŠRCRR(RqRôRR½R%RùR¾((RRº¾s*     cCs@|ii|iƒ}|p |iSn|i|i|i|ƒS(sBPostprocess the current element taking into account next and last.N(RqR¹tgetstageRƒtstageR¼R R…(RqR…RÀ((RR»Ôs  (RRRR¹RrR¼RºR»(((RR·¬s    R¸cBs)tZdZd„Zd„Zd„ZRS(s/A dictionary of stages corresponding to classescCsI|i||ƒ}tg}|D]}||i|fq ~ƒ|_ dS(sGInstantiate an element from elyxer.each class and store as a dictionaryN( Rqt instantiatetclassesR½RRØRãRptprocessedclasst stagedict(RqRÂR½RãRRp((RRrÞscCsRg}|D]}||i|ƒq ~}x!|D]}|iƒ||_q1W|S(s-Instantiate an element from elyxer.each classN(RãRÂRpRéR¹R%RrR½(RqRÂR½R%RãRpR¹((RRÁãs*  cCs)|i|ijodSn|i|iS(s=Get the stage for a given element, if the type is in the dictN(R%RæRqRÄR(RqR%((RR¿ës(RRRRrRÁR¿(((RR¸Ûs   tLabelcBsVtZdZeƒZeZd„Zd„Zdd„Z d„Z d„Z d„Z RS(sA label to be referencedcCsti|ƒd|_dS(N(R¬RrRqRt lastnumbered(Rq((RRrùs cCs/|idƒ}|id|ƒti|_dS(sProcess a label container.RÜR‹N(RqR¥RvRäRÅt lastlayoutRÆ(RqRv((RRñýsRÅcCsh||_|i|d|d|ƒ|ti|<|tijo%x"ti|D]}||_ qMWn|S(s!Create the label for a given key.R®RèN( RvRqRµRˆRèRÅtnamest Referencet referencest referenceR°(RqRˆRvRèRË((RRäs  cCs/|i|ƒ}|o|io |iSndS(s8Get the part key for the latest numbered container seen.R|N(RqRÉRª(RqRÉ((Rt findpartkey s  cCsI|io|Sn|ip|io |iSndSn|i|iƒS(s)Get the numbered container for the label.N(RôRªRRqRÆRRÉ(RqRô((RRÉs    cCs#t|dƒpdSnd|iS(s"Return a printable representation.Rvs Unnamed labelsLabel N(R�RqRv(Rq((RRâs( RRRRØRÈRRÇRrRñRäRÌRÉRâ(((RRÅós      RÉcBsAtZdZeƒZdZd„Zd„Zd„Zd„Z RS(sA reference to a label.tnonecCs»|idƒ|_|itijod|_ti|i}n%d|_tƒid|idƒ}||_|i ƒ|it i jogt i |iFind a function which is represented by a symbol (like _ or ^)cCs|iƒtijS(sFind the symbolN(RyRƒRïRÝ(RqRy((RRé'scCsL|i|iƒƒ|i|iƒtƒi|iƒ|_ |i |ƒdS(sParse the symbolN( RqRßRyRƒRlRÑR&R*RåRøR(RqRy((RRê+s (RRRR6RIRÝRéRê(((RRï"s   t TextFunctioncBs)tZdZeiZd„Zd„ZRS(s-A function where parameters are read as text.cCs)tƒi|iƒ|_|i|ƒdS(sParse a text parameterN(R&R*RqRåRøRùRy(RqRy((RRê7scCs d|_dS(sSet the type to fontR N(RqRè(Rq((RRñ<s(RRRR6RJRÝRêRñ(((RRð2s   t LabelFunctioncBs)tZdZeiZd„Zd„ZRS(sA function that acts as a labelcCs|i|ƒ|_dS(sParse a literal parameterN(RqRûRyRv(RqRy((RRêEscCsPd|_tƒid|iddƒ|_|ig|_|iti|itiptSnt|i|iƒdjotSntiS(s7Decide if the limit should be a small, one-line symbol.iN( R¶R¿R†RRqR6RîR�R«(Rq((RRõ}s  ( RRRR6R:R6RrRöRõ(((RRôls    t BigBracketcBsYtZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z RS( sA big bracket generator.tlcCsL||_||_||_d|_|tijoti||_ndS(s(Set the size and symbol for the bracket.N( R`RqRÒRåt alignmentRR•R6R9(RqR`RÒRù((RRrˆs    cCs,t|dtt|iƒƒƒ}||ƒS(s%Return the nth piece for the bracket.tgetpieceN(R‚RqRÆRR•tfunctionR}(RqR}Rû((RRú‘s"cCs |idS(s1Return the only piece for a single-piece bracket.iN(RqR•(RqR}((Rt getpiece1–scCsJ|djo|idSn||idjo|idSn|idS(sGGet the nth piece for a 3-piece bracket: parenthesis or square bracket.iiiÿÿÿÿN(R}RqR•R`(RqR}((Rt getpiece3šs  cCsq|djo|idSn||idjo|idSn||iddjo|idSn|idS(s7Get the nth piece for a 4-piece bracket: curly bracket.iiiiN(R}RqR•R`(RqR}((Rt getpiece4¢s cCs3|i|ƒ}d|id}tƒi||ƒS(s'Get the bracket piece as an array cell.sspan class="bracket align-R}N(RqRúR}R—RùR–RåR (RqR}R—R–((Rtgetcell¬scCs�|idjp |i o|iƒSng}xEt|iƒD]4}|i|ƒ}|i t ƒi |gdƒƒq?Wt ƒi |dƒgS(s3Get the bracket as an array or as a single bracket.isspan class="arrayrow"sspan class="array"N( RqR`R•tgetsinglebrackettrowsRCR}RÿtcellRŠRåRµ(RqR}RR((Rt getcontents²s#cCsC|idjotƒiddƒgSntƒi|idƒgS(s$Return the bracket as a single sign.RUR|sspan class="emptydot"sspan class="symbol"N(RqRåRåR (Rq((RR¼s( RRRRrRúRüRýRþRÿRR(((RR÷…s      tFormulaEquationcBstZdZdZd„ZRS(sA simple numbered equation.tequationcCs,tƒ|_|i|iit|ƒƒdS(sParse the arrayN(R$RqRøRpRRÂRRy(RqRy((RRêÌs (RRRR—Rê(((RRÇs t FormulaCellcBs tZdZd„Zd„ZRS(sAn array cell inside a rowcCs-||_tƒid|dtƒ|_|S(Nsspan class="arraycell align-R}(RùRqR&R*R†Rø(RqRù((Rt setalignmentÔs  cCsE|ii|ƒ|iƒodSn|i|iit|ƒƒdS(N(RqRR"RyRKRpRÂR(RqRy((RRêÙs (RRRRRê(((RRÑs  t FormulaRowcBs6tZdZeidZd„Zd„Zd„ZRS(sAn array row inside an arrayt cellseparatorcCs%||_tƒidtƒ|_|S(Nsspan class="arrayrow"(t alignmentsRqR&R*R†Rø(RqR ((Rt setalignmentsäs cCsžd}|i|idtƒxU|iƒpG|i|ƒ}|i |ƒ|i |ƒ|d7}|i |iƒqWt |i ƒdjotƒ|_ndS(sParse a whole rowiRqiN(R}RyRrRqR R†RKt createcellRRêRpR†RRùR"Rø(RqRyR}R((RRêés    cCs3|i|t|iƒ}|iitƒi|ƒS(s4Create the cell that corresponds to the given index.N( RqR R}RRùRRäRR(RqR}Rù((RR ös( RRRR6R8R R RêR (((RRßs    tMultiRowFormulacBs2tZdZd„Zd„Zd„Zd„ZRS(sA formula with multiple rows.cCstg|_t}xL|i|ƒD];}|o t}n |iƒ|i |ƒ|i |ƒqWt |iƒ|_ dS(s,Parse all rows, finish when no more row endsN( RqRR†R+t iteraterowsRytrowRtaddemptyRêtaddrowRR`(RqRyR+R((Rt parserowsþs    ccs‚tid}xntof|i|tƒ|iit ƒ}|i |i ƒV|i |ƒo|i|i|ƒ7_qdSqWdS(s0Iterate over all rows, end when no more row endst rowseparatorN(R6R8RR†RyRrRqRRäRRR R RYRåRu(RqRyRR((RR s cCs…|iitƒi|iƒ}xSt|idi ƒD];\}}|i |ƒ}|itdƒƒ|i|ƒq5W|i|ƒdS(sAdd an empty row.iÿÿÿÿu N(RqRRäRR R RR|RRùR}t originalcellR RRpRæR(RqR}RRR((RRs cCs!|ii|ƒ|i|ƒdS(s2Add a row to the contents and to the list of rows.N(RqRRŠRRp(RqR((RR!s(RRRRRRR(((RR ûs   t FormulaArraycBs&tZdZdZd„Zd„ZRS(sAn array within a formulaR8cCs6tƒidtƒ|_|i|ƒ|i|ƒdS(sParse the arraysspan class="array"N(R&R*RRqRøtparsealignmentsRyR(RqRy((RRê+s cCsid|_|i|ƒ}|o ||_n|i|ƒ}g|_x|D]}|ii|ƒqKWdS(sParse the different alignmentsRïN( RqtvalignRèRyRÿRûR RøRŠ(RqRyRÿRø((RR1s   (RRRR—RêR(((RR&s  t FormulaMatrixcBstZdZdZd„ZRS(s'A matrix (array with center alignment).tmatrixcCs>tƒidtƒ|_d|_dg|_|i|ƒdS(s(Parse the matrix, set alignments to 'c'.sspan class="array"RïN( R&R*RRqRøRR RRy(RqRy((RRêCs   (RRRR—Rê(((RR>s t FormulaCasescBstZdZdZd„ZRS(sA cases statementtcasescCsÉtƒ|_ddg|_|i|ƒxN|iD]C}x:|iD]/}|ii dt ƒ|ii t dƒƒqBWq2Wt ƒi|idt ƒ}tt|iƒddƒ}|iƒ|g|_dS(sParse the casesRøsspan class="case align-l"u sspan class="bracketcases"t{N(R$RqRøR RRyRùRRR*R†RŠRæRåRµR8R÷RtbraceR(RqRyRRR8R((RRêOs    (RRRR—Rê(((RRJs tEquationEnvironmentcBstZdZd„ZRS(s;A \begin{}...\end equation environment with rows and cells.cCs‚tƒidtƒ|_|iiddƒ}|ti joti ||_ n!t i d|iƒdg|_ |i |ƒdS(sParse the whole environment.sspan class="environment"R‰R|sUnknown equation environment RøN(R&R*RRqRøR—R€t environmentR6R?R RRRRy(RqRyR((RRê_s (RRRRê(((RR\s t BeginCommandcBsHtZdZheiddRÝRê(((RR(¥s  t LimitCommandcBs tZdZeiZd„ZRS(s@A command which accepts limits above and below, in display mode.cCs^t|iƒiƒ}tƒidƒ|_x-|D]%}|i i t ƒi |dƒƒq1WdS(sParse a limit command.sspan class="limits"sspan class="limit"N( RôRqRåRöR•R&R*RøR—RùRŠRåR (RqRyR•R—((RRêºs (RRRR6RDRÝRê(((RR)µs  tLimitPreviousCommandcBs&tZdZeZd„Zd„ZRS(s(A command to limit the previous command.cCs)tƒidƒ|_|ii|ƒdS(s Do nothing.sspan class="limits"N(R&R*RqRøRR"Ry(RqRy((RRêÆscCsdS(s"Return a printable representation.sLimit previous commandN((Rq((RRâËs(RRRRRÝRêRâ(((RR*Ás  tLimitsProcessorcBs_tZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( s)A processor for limits inside an element.cCs{tiodSn|i||ƒo|i||ƒn|i||ƒo+|i||dƒo|i||ƒndS(s"Process the limits for an element.Ni( R�R«Rqt checklimitsRùR}t modifylimitst checkscriptt modifyscripts(RqRùR}((RRñÒs *cCsttiptSn|i||dtƒo|i||ƒtSnt ||t ƒptSn|i ||dƒS(s3Check if the current position has a limits command.iN( R¶R¿RRqt checkcommandRùR}R*t limitsaheadR„R)R.(RqRùR}((RR,Ûs cCs3||di||iƒƒtƒ||_dS(s,Limit the current element based on the next.iN(RùR}RpRçR"Rø(RqRùR}((RR1æscCs�||}|i||dƒ}|ii|ƒ|i||dƒo|i||dƒ}nt ƒi ddƒ}|ii d|ƒdS(sCModify a limits commands so that the limits appear above and below.iuâ�Ÿssup class="limit"iN( RùR}tlimitedRqtgetlimitt subscriptRŠR.t superscriptRåR RŽ(RqRùR}R2R4R5((RR-ës cCs4|i||ƒ}|iiiddƒ|i_|S(s#Get the limit for a limits command.tscriptRN(Rqt getscriptRùR}RRøR'R€(RqRùR}R((RR3öscCsS|i||ƒ}|i||ƒ}tƒi||gdƒ}|i ||ƒdS(s=Modify the super- and subscript to appear vertically aligned.sspan class="scripts"N( RqR7RùR}R4R5RåRµtscriptsRŽ(RqRùR}R8R4R5((RR/üs cCs|i||tƒS(s6Check if the current element is a sub- or superscript.N(RqR0RùR}Rï(RqRùR}((RR.scCs,t|ƒ|jotSnt|||ƒS(s0Check for the given type as the current element.N(RRùR}RR„Rè(RqRùR}Rè((RR0scCs'||}|iid7_||=|S(sGet the sub- or superscript.s class="script"N(RùR}RàRøR'(RqRùR}Rà((RR7s  ( RRRRñR,R1R-R3R/R.R0R7(((RR+Ïs      tBracketCommandcBs)tZdZeiZd„Zd„ZRS(s"A command which defines a bracket.cCsti||ƒdS(sParse the bracket.N(RìRêRqRy(RqRy((RRêscCs,||_d||_t|ƒg|_|S(s+Create the bracket for the given character.s\N(t characterRqRåRÏRÑRæRù(RqRÏR:((RRäs   (RRRR6R;RÝRêRä(((RR9s   tBracketProcessorcBsVtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s!A processor for bracket commands.cCs=tiodSn|i||ƒo|i||ƒSndS(s6Convert the bracket using Unicode pieces, if possible.N(R�R«Rqt checkleftRùR}t processleft(RqRùR}((RRñ(s  cCsf|i||dƒ}|pdSn|i|||ƒ}|i|||ƒ|i|||ƒdS(sProcess a left bracket.iN(Rqt findrightRùR}t rightindextfindmaxR`tresize(RqRùR}R?R`((RR=/scCs|i||dƒS(s0Check if the command at the given index is left.s\leftN(RqtcheckdirectionRùR}(RqRùR}((RR<8scCs|i||dƒS(s1Check if the command at the given index is right.s\rightN(RqRBRùR}(RqRùR}((Rt checkright<scCs%t|tƒptSn|i|jS(s6Check if the given bit is the desired bracket command.N(R„RàR9RRÑ(RqRàRÑ((RRB@scCs†d}xy|t|ƒjoe|i||ƒo|d7}n|i||ƒo|d8}n|djo|Sn|d7}q WdS(s9Find the right bracket starting at the given index, or 0.iiN(tdepthR}RRùRqR<RCR(RqRùR}RD((RR>Fs cCs5|||!}tg}|D]}||iq~ƒS(s@Find the max size of the contents between the two given indices.N(Rùt leftindexR?tslicedRâRãR%R`(RqRùRER?RãR%RF((RR@Ss cCsR|iƒ}|iiddƒ}t|||ƒ}tƒ|_ |i ƒ|_ dS(s+Resize a bracket command to the given size.s\R|N( RÑR*R:R€RùR÷R`RÒR$RøRRù(RqRÑR`R:RÒRù((RRAXs   ( RRRRñR=R<RCRBR>R@RA(((RR;%s      tParameterDefinitioncBs>tZdZd d gZd„Zd„Zd„Zd„ZRS( s3The definition of a parameter in a hybrid function.t[R~RR"cCs1d|_t|_t|_d|_d|_dS(N(RRqRÜRRÿRqRwt literalvalue(Rq((RRrts     cCsõx×tiD]Ì\}}|i|ƒo°|djo t|_n|idƒp#t i d|i ƒdƒdSn|i ƒ|_|idƒo t|_n|i|ƒpt i d|i ƒƒdSn|Sq q Wt i d|i ƒƒdS( s2Parse a parameter definition: [$0], {$x}, {$1!}...RHRs$Wrong parameter name, did you mean $t?t!sWrong parameter closing s'Wrong character in parameter template: N(RGt parambracketstopeningtclosingRyR†R†RqRqRRRƒRRVRÜRÿ(RqRyRMRN((RR{s$     cCs–|ioV|io|i|ƒ|_n|i|ƒ|_|iot|iƒ|_ q’n3|io|i |ƒ|_ n|i |ƒ|_ dS(s/Read the parameter itself using the definition.N( RqRÿRqRûRèRyRIRûRæRwRçR(RqRyRû((RtreadŽs    cCs@d|i}|io|dt|iƒ7}n |d7}|S(s"Return a printable representation.sparam s: s (empty)N(RqRÜR“RwRÆ(RqR“((RRâœs    (RHR~(RR"(RRRRLRrRRORâ(((RRGks     tParameterFunctioncBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(sFA function with a variable number of parameters defined in a template.cCsNtƒ|_x;|i|ƒD]*}|i||ƒ||id|i$1. Literal parameters can be used in tags definitions: [f0{$1},span style="color: $p;"] yields $1, 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
. cCsJ|id}|id}|i||ƒ|i|ƒ|_|iƒdS(s*Parse a function with [] and {} parametersiiN( RqRåRSt writetemplateRURyt writeparamsRùtcomputehybridsize(RqRyRSRY((RRêÝs   cCs|it|ƒƒS(s*Write all params according to the templateN(RqtwriteposR‡RY(RqRY((RRZåscCsg}x|iƒpö|idƒo+|i|ƒ}|o|i|ƒqq |idƒo4|i|ƒ}|od|_ |i|ƒqq |idƒo|i|i ddƒƒq |idƒo|i|i ddƒƒq |it |iƒƒƒq W|S(s/Write all params as read in the parse position.Rtft(tleftRÁtrightN(R“RyRKR†Rqt writeparamR¯RŠt writefunctionRûRRèt writebracketRæRV(RqRyRûR¯R“((RR\és&  cCsŠd|iƒ}||ijotid|ƒdSn|i|pdSn|idƒo|i ƒ|i|i _ n|i|i S(s*Write a single param of the form $0, $x...RsUnknown parameter RUN( RyRVRÜRqRQRRRR†R`RwRè(RqRyRÜ((RRaþscCs»|i|ƒ}|pdSn|idƒotƒi|ƒSn|idƒpti dƒdSn|i dƒ|i |ƒ}|i ƒt|ƒdjodSntƒi||ƒS(s"Write a single function f0,...,fn.t/Rs Function should be defined in {}R"iN(RqtreadtagRyR'RR†RåRçRRRrR\RùRuRRµ(RqRyR'Rù((RRb s   cCs:|iƒiƒptid|iƒƒd Snt|iƒƒ}d|t |i ƒjo#tidt |ƒdƒd Sn|i d|}d|jo|SnxŒ|iD]�}||jon|i|}|ip$tid|d|dƒq±n|io |i}nd }|i||ƒ}q±q±W|S( sJGet the tag corresponding to the given index. Does parameter substitution.sFunction should be f0,...,f9: fis Function fs is not definedRsParameters in tag s should be literal: {s!}R|N(RyRƒRaRRRR¡RVR}RRqRåRÆR'RQtvariableR¯RÿRIRwR€(RqRyR}R'R¯RfRw((RRes.       cCs|iitƒi||ƒS(s4Return a new bracket looking at the given direction.N(RqRRäR9RÏR:(RqRÏR:((RRc5scCs^|itijo|iƒdSntƒi|ƒ|_x|iD]}|i|_qDWdS(s(Compute the size of the hybrid function.N( RqRÑt HybridSizet configsizesRätgetsizeR`RùR%(RqR%((RR[9s  (RRRR6RARÝRêRZR\RaRbReRcR[(((RRXÉs        RgcBs tZdZeiZd„ZRS(s+The size associated with a hybrid function.cCs“|i|i}xP|iD]E}||jo2|i|iiƒ}|i |t |ƒƒ}qqWd|jot i d|ƒdSnt|ƒS(s*Read the size for a function and parse it.Rs%Unconverted variable in hybrid size: iN(RqRhRûRÑt sizestringRQRÜRwRäR`R€RÆRRteval(RqRûRÜRjR`((RRiHs    (RRRR6RBRhRi(((RRgCs  t HeaderParsercBs2tZdZd„Zd„Zd„Zd„ZRS(sParses the LyX headercs0g‰ˆiˆ‡‡‡d†ƒˆiƒˆS(s?Parse header parameters into a dictionary, return the preamble.csˆiˆˆƒS(N(Rqt parselineRüRù((RqRùRü(RRðesN(RùRqR RüRÿ(RqRüRù((RqRüRùRRbs  cCs°|iƒ}|itidƒo|i|ƒdSnh|itidƒotƒi |ƒdSn9|itidƒo!|i |i i |ƒƒdSn|i|ƒdS(s0Parse a single line as a parameter or as a starttbranchNtlstsett beginpreamble(RüRýR4RtRORPRqt parsebrancht LstParsert parselstsetRùRŠRRR(RqRüRùR4((RRmjs  cCsŽ|iƒiƒd}|iƒtƒitidƒ}|i |ƒt |ƒ}x(|iD]}|i||i|ƒq\W|ti|tiiƒ|_|idƒ}|ii|i |ƒƒdS(s-Parse some lstparams from elyxer.a container.t lstparamsN( RrR~R–RôRR§t paramlisttupdateRqR}(RqRôR€((RR²scCstƒ}xo|D]g}d|jo2t|iƒƒdjotid|ƒqwq|iddƒ\}}|||š 2 "h,   F 8k K 6 Yn  �       8/1?U;    B +  F<:$z *./X