@@ -87,16 +87,15 @@ def latex2html(node, source):
87
87
88
88
return '<img src="%s/%s.png" %s%s/>' % (path , name , cls , style )
89
89
90
+
90
91
def setup (app ):
91
92
setup .app = app
92
93
93
- app .add_node (latex_math )
94
- app .add_role ('math' , math_role )
95
-
96
94
# Add visit/depart methods to HTML-Translator:
97
95
def visit_latex_math_html (self , node ):
98
96
source = self .document .attributes ['source' ]
99
97
self .body .append (latex2html (node , source ))
98
+
100
99
def depart_latex_math_html (self , node ):
101
100
pass
102
101
@@ -109,13 +108,13 @@ def visit_latex_math_latex(self, node):
109
108
self .body .extend (['\\ begin{equation}' ,
110
109
node ['latex' ],
111
110
'\\ end{equation}' ])
111
+
112
112
def depart_latex_math_latex (self , node ):
113
113
pass
114
114
115
- app .add_node (latex_math , html = (visit_latex_math_html ,
116
- depart_latex_math_html ))
117
- app .add_node (latex_math , latex = (visit_latex_math_latex ,
118
- depart_latex_math_latex ))
115
+ app .add_node (latex_math ,
116
+ html = (visit_latex_math_html , depart_latex_math_html ),
117
+ latex = (visit_latex_math_latex , depart_latex_math_latex ))
119
118
app .add_role ('math' , math_role )
120
119
app .add_directive ('math' , math_directive ,
121
120
True , (0 , 0 , 0 ), ** options_spec )
0 commit comments