1<?php 2 3require_once(realpath(dirname(__FILE__).'/../latexinc.php')); 4 5class syntax_plugin_latex_ddollar extends syntax_plugin_latex_common { 6 /** 7 * return some info 8 */ 9 function getInfo(){ 10 $a = parent::getInfo(); 11 $a['name'] = '$$...$$ syntax for displayed LaTeX-math'; 12 return $a; 13 } 14 15 // Sort in at medium priority. 16 function getSort(){return 300; } 17 18 function connectTo($mode) { 19 $this->Lexer->addEntryPattern('\$\$(?=.*\$\$)',$mode,'plugin_latex_ddollar'); 20 } 21 function postConnect() { $this->Lexer->addExitPattern('\$\$','plugin_latex_ddollar'); } 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("$$".$match."$$",$state,'class'=>"latex_displayed", 'title'=>"Equation", NULL); 32 } 33 } 34