tag with the Parser. * * @param $parser Object: instance of Parser * @return Boolean: true */ static function onParserFirstCallInit( $parser ) { $parser->setHook( 'math', array( 'MathHooks', 'mathTagHook' ) ); return true; } /** * Callback function for the parser hook. * * @param $content * @param $attributes * @param $parser Parser * @return */ static function mathTagHook( $content, $attributes, $parser ) { global $wgContLang; $renderedMath = MathRenderer::renderMath( $content, $attributes, $parser->getOptions() ); return $wgContLang->armourMath( $renderedMath ); } /** * Add the new math rendering options to Special:Preferences. * * @param $user Object: current User object * @param $defaultPreferences Object: Preferences object * @return Boolean: true */ static function onGetPreferences( $user, &$defaultPreferences ) { global $wgLang; $defaultPreferences['math'] = array( 'type' => 'radio', 'options' => array_flip( array_map( 'wfMsgHtml', $wgLang->getMathNames() ) ), 'label' => ' ', 'section' => 'rendering/math', ); return true; } }