Lexer->addEntryPattern('\x5Cbegin\{equation\}(?=.*\x5Cend\{equation\})', $mode,'plugin_latex_equation'); } function postConnect() { $this->Lexer->addExitPattern('\x5Cend\{equation\}','plugin_latex_equation'); } function getPType(){return 'stack';} /** * Handle the match */ function handle($match, $state, $pos, &$handler){ if($state != DOKU_LEXER_UNMATCHED) return array($match,$state,NULL); return array("\\begin{equation}".$match."\\end{equation}",$state,'class'=>"latex_displayed", 'title'=>"Equation", NULL); } }