3

T'ícÅã@sHdZddlmZddlmZeejedœdd„Zeeeedœdd	„Z	d
S)zUtility functions for math.é)Únodes)ÚHTMLTranslator)ÚwriterÚnodeÚreturncCs||jjjrp|jjjrpd}|jjdkr8d|jd	|f}n|}|dd}|jjj|iƒj|fƒ}djt	t
|ƒƒS|dSdS)
NZdisplaymathZ
singlehtmlz%s/%séÚidsrÚ.Únumberéÿÿÿÿ)ZbuilderÚconfigZmath_numfigZnumfigÚnameZdocnamesZ
fignumbersÚgetÚjoinÚmapÚstr)rrZfigtypeÚkeyÚidr
©rú2/tmp/pip-build-gk9425m9/sphinx/sphinx/util/math.pyÚget_node_equation_numbersr)ÚtextÚlabelÚ	numberingrc
Csâttdœdd„}|dkrd}nd|}d}tt||jdƒƒƒ}g}t|ƒdkrRdSt|ƒd	kr|rpd
|}d}nd|}d
}|jd|dƒn>|r¢d|}d}nd|}d}x|D]}	|jd|	jƒƒq´Wd|dj|ƒ|fS)N)ÚpartrcSs|jƒS)N)Ústrip)rrrrÚis_equationsz%wrap_displaymath.<locals>.is_equationÚz
\label{%s}Tz

rrz\begin{equation}z\end{equation}z\begin{equation*}z\end{equation*}z\begin{split}%s\end{split}
z \begin{align}%s\!\begin{aligned}z\end{aligned}\end{align}z!\begin{align*}%s\!\begin{aligned}z\end{aligned}\end{align*}z%s\\
z%s
%s%s)rÚlistÚfilterÚsplitÚlenÚappendrr)
rrrrZlabeldefÚpartsZ	equationsÚbeginÚendrrrrÚwrap_displaymaths0
r&N)
Ú__doc__ZdocutilsrZsphinx.builders.htmlrZ
math_blockrrÚboolr&rrrrÚ<module>s