o n_@s\ddlmZddlZdZdddZdddZdd d Zed kr,d Ze ee d dSdS))print_functionNzP\documentclass{article} \usepackage{amsmath} \begin{document} %s \end{document} c Cs&tjgdtjtjtjdd}|jt|d|j|j }|j d}|r<| ddks7|s<| |tjgdtjtjtjdd}|j||j|j d}|j d}|rv| ddksq|sv| || d| d d }} ||| }d |vrt||S) zdConvert LaTeX math code to MathML with LaTeXML_ .. _LaTeXML: http://dlmf.nist.gov/LaTeXML/ )latexml-z--inputencoding=utf8Tstdinstdoutstderr close_fdsutf8Errorr) latexmlpostrz--nonumbersectionsz--format=xhtmlz--zclass="ltx_ERROR) subprocessPopenPIPErwritedocument_templateencodecloserreadrdecodefinderror SyntaxError) math_codereporterp latexml_code latexml_errpost_presult post_p_errstartendr&G/usr/lib/python3/dist-packages/docutils/utils/math/tex2mathml_extern.pyrs:        rcCstjgdtjtjtjdd}|jt|d|j|j }|j d}| ddkrEd dd |D}td ||rN| d dksP|sU||| d | d d}}|||}|S)zgConvert LaTeX math code to MathML with TtM_ .. _TtM: http://hutchinson.belmont.ma.us/tth/mml/ )ttmz-uz-rTrr z **** Unknownr cSsg|] }|dr|qS)z****) startswith).0liner&r&r' ]s zttm..z& Message from external converter TtM: **** Errorr rr)rrrrrrrrrrrrrjoin splitlinesrr)rrrr"errmsgr$r%r&r&r'r(Js$      r(Tc Csgd}|r d}nd}|dtjdg|tjtjtjdd}|j|d|j|j d}|j d}| d d krWt d || d d | d|rg| dd ksb|sg||| dd | d}} d|||| f}|S)zlConvert LaTeX math code to MathML with blahtexml_ .. _blahtexml: http://gva.noekeon.org/blahtexml/ ) z--mathmlz --indentedz --spacingmoderatez--mathml-encodingrawz--other-encodingr4z--doctype-xhtml+mathmlz--annotate-TeXzmode="display"z --displaymath blahtexmlTrr zrz, Message from external converter blahtexml: z z r.zz z> %s )appendrrrrrrrrrrrrrr) rinlineroptions mathmode_argrr"r1r$r%r&r&r'r6fs4    r6__main__uG\frac{\partial \sin^2(\alpha)}{\partial \vec r}\varpi \, \text{Grüße}r )N)TN) __future__rrrrr(r6__name__exampleprintrr&r&r&r's   . )