def _init_math_handler(self):
fields = self.settings.math_output.split(None, <NUM_LIT:1>)<EOL>name = fields[<NUM_LIT:0>].lower()<EOL>option = fields[<NUM_LIT:1>] if len(fields) > <NUM_LIT:1> else None<EOL>if name == '<STR_LIT:html>':<EOL><INDENT>option = self.settings.math_css or option<EOL>self.math_handler = HTMLMathHandler(css_filename=option)<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>if option:<EOL><INDENT>raise ValueError(('<STR_LIT>' +<EOL>'<STR_LIT>') % (name, option))<EOL><DEDENT>self.math_handler = MathMLMathHandler()<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>js_url = option<EOL>config = None<EOL>if self.settings.mathjax_opts:<EOL><INDENT>parts = self.settings.mathjax_opts.split('<STR_LIT:U+002C>')<EOL>options = dict(part.split('<STR_LIT:=>', <NUM_LIT:1>) for part in parts)<EOL>js_url = options.get('<STR_LIT:url>', js_url)<EOL>config = options.get('<STR_LIT>', config)<EOL><DEDENT>js_url = self.settings.mathjax_url or js_url<EOL>config = self.settings.mathjax_config or config<EOL>self.math_handler = MathJaxMathHandler(js_url=js_url,<EOL>config_filename=config)<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>if option:<EOL><INDENT>raise ValueError(('<STR_LIT>' +<EOL>'<STR_LIT>') % (name, option))<EOL><DEDENT>self.math_handler = LaTeXMathHandler()<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % name)<EOL><DEDENT>
Parse math configuration and set up math handler.