1<?php
2
3require_once(realpath(dirname(__FILE__).'/../latexinc.php'));
4
5class syntax_plugin_latex_equationstar extends syntax_plugin_latex_common {
6   /**
7    * return some info
8    */
9    function getInfo(){
10		$a = parent::getInfo();
11		$a['name'] = '\\begin{equation*} ... \\end{equation*} syntax';
12		return $a;
13    }
14
15	function connectTo($mode) {
16      $this->Lexer->addEntryPattern('\x5Cbegin\{equation\*\}(?=.*\x5Cend\{equation\*\})',
17				    $mode,'plugin_latex_equationstar');
18    }
19    function postConnect() {
20      $this->Lexer->addExitPattern('\x5Cend\{equation\*\}','plugin_latex_equationstar');
21    }
22
23		function getPType(){return 'stack';}
24
25   /**
26    * Handle the match
27    */
28    function handle($match, $state, $pos, &$handler){
29	  if($state != DOKU_LEXER_UNMATCHED)
30		return array($match,$state,NULL);
31	  return array("\\begin{equation*}".$match."\\end{equation*}",$state,'class'=>"latex_displayed", 'title'=>"Equation", NULL);
32    }
33 }
34