;ς )δHEc@sαdZdkZdkZdklZdklZlZlZl Z dk l Z l Z l Z dklZlZdklZdklZdklZd klZeid eiƒZd Zd „Zed „Zd„Z dS(s> Replace Latex math mode/\begin{}\end{} blocks with html img tag after rendering $Id: ReplaceInlineLatex.py,v 1.11 2001/09/07 14:21:16 rsbowman Exp $ TODO: test a table/array use \ref{shit} to make reference to equations. Convert \ref{shit} to the appropriate (number): add negative match to latexPattern for \ref, do a s/// after generating an equation with a \label. Separate vertical alignment characters & into a new \end{equation}\begin{equation} and then render the separate images in a table to acheive vertical alignment. N(s html_quote(s fileNameFors imagesPaths workingDirs getPngSize(sstripsjoinsreplace(s runCommandslog(sreplaceInlineAxiom(sreplaceInlineReduce(sreplaceInlineMaxima(sreplaceInlineHTMLs·(? Some or all expressions may not have rendered properly, because Latex returned the following error:
%s
cCs#td„ti|ƒƒ}|SdS(NcCs|dS(Ni(sx(sx((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pys3s(smaps latexPatternsfindallstextscodeList(stextscodeList((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pys findLatexCode2scCs―dkl} gatiti}d„}d„}ti dƒ}ti dƒ}t |ƒ}t|ƒ}t|ƒ}t|ƒ}t|ƒ}g}d}xC|D];}|ddjo^ti dtiƒid |ƒ}ti d tiƒid |ƒ}t|||d ƒ}q’n|i|ƒ|}|i|ƒ} | o|d }|id ||d ƒ}| id ƒ}ti d|ƒid||d ƒ}|id ||d ƒ}|||i|ƒ(ssavePresappendsxsgroup(sx((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pyshidePre<scCs"tdtdf\}a|SdS(Nii(ssavePresfirst(sxsfirst((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pys restorePreAss+[ \t]*\\begin{ *(math|equation|eqnarray) *}s\[ \t]*(\\begin{ *((math|equation|eqnarray)\*|table|tabular|displaymath|array|latex) *}|\$\$)is!s^!ss\\\[s\![is\\begin{\1*} \label{eq%d}s \\end{ *%s *}s \\end{%s*}s latexTemplates\\label{eq(\d+)}s^s--s- -ss6
s=(%s)
ss> sA((?:>|^)(?:[^<]*\s|))\( *(?:[Ee][Qq]\.)?\s*(%d) *\)([^>]*(?:<|$))s\1(\2)\3s
s
s(?%s(spreambles postambleswidthsheights fileNameFors latexCodes charheightpxs imageFiles imagesPathsimageUrls getPngSizesosspathsjoins workingDirssrc( s latexCodes charheightpxssrcs postamblesheights imageFileswidthspreamblesimageUrl((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pys getImageForšs !(!s__doc__sresossDocumentTemplate.html_quotes html_quotesutils fileNameFors imagesPaths workingDirs getPngSizesstringsstripsjoinsreplaces latexWrappers runCommandslogsReplaceInlineAxiomsreplaceInlineAxiomsReplaceInlineReducesreplaceInlineReducesReplaceInlineMaximasreplaceInlineMaximasReplaceInlineHTMLsreplaceInlineHTMLscompilesDOTALLs latexPatterns errorMessages findLatexCodesNonesreplaceInlineLatexs getImageFor(sreplacesstripsreplaceInlineHTMLslogs findLatexCodesreplaceInlineLatexs workingDirsreplaceInlineReducesreplaceInlineAxiomsres errorMessages getPngSizes latexPatterns runCommandsreplaceInlineMaximasjoinsoss getImageFors imagesPaths fileNameFors html_quote((sU/mnt/gmirror/ports/www/zope-zwiki/work/ZWiki/plugins/mathaction/ReplaceInlineLatex.pys?s        d