|
From: <var...@us...> - 2016-10-14 11:00:16
|
Revision: 9970
http://sourceforge.net/p/phpwiki/code/9970
Author: vargenau
Date: 2016-10-14 11:00:13 +0000 (Fri, 14 Oct 2016)
Log Message:
-----------
Update ASCIIMathPHP to version 2.1 (from Zefling/ASCIIMathPHP on github.com)
Modified Paths:
--------------
trunk/lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php
trunk/lib/ASCIIMathPHP/ASCIIMathPHP.class.php
trunk/pgsrc/ReleaseNotes
Modified: trunk/lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php
===================================================================
--- trunk/lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php 2016-10-14 10:41:55 UTC (rev 9969)
+++ trunk/lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php 2016-10-14 11:00:13 UTC (rev 9970)
@@ -2,215 +2,213 @@
$symbol_arr = array(
-// Greek symbols
-'alpha' => array( 'input'=>'alpha','tag'=>'mi', 'output'=>'&#' . hexdec('03B1') . ';'),
-'beta' => array( 'input'=>'beta','tag'=>'mi', 'output'=>'&#' . hexdec('03B2') . ';'),
-'chi' => array( 'input'=>'chi','tag'=>'mi', 'output'=>'&#' . hexdec('03C7') . ';'),
-'delta' => array( 'input'=>'delta','tag'=>'mi', 'output'=>'&#' . hexdec('03B4') . ';'),
-'Delta' => array( 'input'=>'Delta','tag'=>'mo', 'output'=>'&#' . hexdec('0394') . ';'),
-'epsi' => array( 'input'=>'epsi','tag'=>'mi', 'output'=>'&#' . hexdec('03B5') . ';'),
-'varepsilon' => array( 'input'=>'varepsilon','tag'=>'mi', 'output'=>'&#' . hexdec('025B') . ';'),
-'eta' => array( 'input'=>'eta','tag'=>'mi', 'output'=>'&#' . hexdec('03B7') . ';'),
-'gamma' => array( 'input'=>'gamma','tag'=>'mi', 'output'=>'&#' . hexdec('03B3') . ';'),
-'Gamma' => array( 'input'=>'Gamma','tag'=>'mi', 'output'=>'&#' . hexdec('0393') . ';'),
-'iota' => array( 'input'=>'iota','tag'=>'mi', 'output'=>'&#' . hexdec('03B9') . ';'),
-'kappa' => array( 'input'=>'kappa','tag'=>'mi', 'output'=>'&#' . hexdec('03BA') . ';'),
-'lambda' => array( 'input'=>'lambda','tag'=>'mi', 'output'=>'&#' . hexdec('03BB') . ';'),
-'Lambda' => array( 'input'=>'Lambda','tag'=>'mo', 'output'=>'&#' . hexdec('039B') . ';'),
-'mu' => array( 'input'=>'mu','tag'=>'mi', 'output'=>'&#' . hexdec('03BC') . ';'),
-'nu' => array( 'input'=>'nu','tag'=>'mi', 'output'=>'&#' . hexdec('03BD') . ';'),
-'omega' => array( 'input'=>'omega','tag'=>'mi', 'output'=>'&#' . hexdec('03C9') . ';'),
-'Omega' => array( 'input'=>'Omega','tag'=>'mo', 'output'=>'&#' . hexdec('03A9') . ';'),
-'phi' => array( 'input'=>'phi','tag'=>'mi', 'output'=>'&#' . hexdec('03C6') . ';'),
-'varphi' => array( 'input'=>'varphi','tag'=>'mi', 'output'=>'&#' . hexdec('03D5') . ';'),
-'Phi' => array( 'input'=>'Phi','tag'=>'mo', 'output'=>'&#' . hexdec('03A6') . ';'),
-'pi' => array( 'input'=>'pi','tag'=>'mi', 'output'=>'&#' . hexdec('03C0') . ';'),
-'Pi' => array( 'input'=>'Pi','tag'=>'mo', 'output'=>'&#' . hexdec('03A0') . ';'),
-'psi' => array( 'input'=>'psi','tag'=>'mi', 'output'=>'&#' . hexdec('03C8') . ';'),
-'rho' => array( 'input'=>'rho','tag'=>'mi', 'output'=>'&#' . hexdec('03C1') . ';'),
-'sigma' => array( 'input'=>'sigma','tag'=>'mi', 'output'=>'&#' . hexdec('03C3') . ';'),
-'Sigma' => array( 'input'=>'Sigma','tag'=>'mo', 'output'=>'&#' . hexdec('03A3') . ';'),
-'tau' => array( 'input'=>'tau','tag'=>'mi', 'output'=>'&#' . hexdec('03C4') . ';'),
-'theta' => array( 'input'=>'theta','tag'=>'mi', 'output'=>'&#' . hexdec('03B8') . ';'),
-'vartheta' => array( 'input'=>'vartheta','tag'=>'mi', 'output'=>'&#' . hexdec('03D1') . ';'),
-'Theta' => array( 'input'=>'Theta','tag'=>'mo', 'output'=>'&#' . hexdec('0398') . ';'),
-'upsilon' => array( 'input'=>'upsilon','tag'=>'mi', 'output'=>'&#' . hexdec('03C5') . ';'),
-'xi' => array( 'input'=>'xi','tag'=>'mi', 'output'=>'&#' . hexdec('03BE') . ';'),
-'Xi' => array( 'input'=>'alpha','tag'=>'mo', 'output'=>'&#' . hexdec('039E') . ';'),
-'zeta' => array( 'input'=>'zeta','tag'=>'mi', 'output'=>'&#' . hexdec('03B6') . ';'),
-
-// Binary operation symbols
-'*' => array( 'input'=>'*','tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';'),
-'**' => array( 'input'=>'**','tag'=>'mo', 'output'=>'&#' . hexdec('22C6') . ';'),
-'//' => array( 'input'=>'//','tag'=>'mo', 'output'=>'/'),
-'\\\\' => array( 'input'=>'\\\\','tag'=>'mo', 'output'=>'\\'),
-'xx' => array( 'input'=>'xx','tag'=>'mo', 'output'=>'&#' . hexdec('00D7') . ';'),
-'-:' => array( 'input'=>'-:','tag'=>'mo', 'output'=>'&#' . hexdec('00F7') . ';'),
-'@' => array( 'input'=>'@','tag'=>'mo', 'output'=>'&#' . hexdec('2218') . ';'),
-'o+' => array( 'input'=>'o+','tag'=>'mo', 'output'=>'&#' . hexdec('2295') . ';'),
-'ox' => array( 'input'=>'ox','tag'=>'mo', 'output'=>'&#' . hexdec('2297') . ';'),
-'sum' => array( 'input'=>'sum','tag'=>'mo', 'output'=>'&#' . hexdec('2211') . ';', 'underover'=>TRUE),
-'prod' => array( 'input'=>'prod','tag'=>'mo', 'output'=>'&#' . hexdec('220F') . ';', 'underover'=>TRUE),
-'^^' => array( 'input'=>'^^','tag'=>'mo', 'output'=>'&#' . hexdec('2227') . ';'),
-'^^^' => array( 'input'=>'^^^','tag'=>'mo', 'output'=>'&#' . hexdec('22C0') . ';', 'underover'=>TRUE),
-'vv' => array( 'input'=>'vv','tag'=>'mo', 'output'=>'&#' . hexdec('2228') . ';'),
-'vvv' => array( 'input'=>'vvv','tag'=>'mo', 'output'=>'&#' . hexdec('22C1') . ';', 'underover'=>TRUE),
-'nn' => array( 'input'=>'nn','tag'=>'mo', 'output'=>'&#' . hexdec('2229') . ';'),
-'nnn' => array( 'input'=>'nnn','tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';', 'underover'=>TRUE),
-'uu' => array( 'input'=>'uu','tag'=>'mo', 'output'=>'&#' . hexdec('222A') . ';'),
-'uuu' => array( 'input'=>'uuu','tag'=>'mo', 'output'=>'&#' . hexdec('22C3') . ';', 'underover'=>TRUE),
-
-// Binary relation symbols
-'!=' => array( 'input'=>'!=','tag'=>'mo', 'output'=>'&#' . hexdec('2260') . ';'),
-':=' => array( 'input'=>':=','tag'=>'mo', 'output'=>':=' ), /* 2005-06-05 wes */
-'<' => array( 'input'=>'<','tag'=>'mo', 'output'=>'<'),
-'lt' => array( 'input'=>'lt','tag'=>'mo', 'output'=>'<'), /* 2005-06-05 wes */
-'<=' => array( 'input'=>'<=','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
-'lt=' => array( 'input'=>'lt=','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
-'le' => array( 'input'=>'le','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'), /* 2005-06-05 wes */
-'>' => array( 'input'=>'>','tag'=>'mo', 'output'=>'>'),
-'>=' => array( 'input'=>'>=','tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
-'qeq' => array( 'input'=>'geq','tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
-'-<' => array( 'input'=>'-<','tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
-'-lt' => array( 'input'=>'-lt','tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
-'>-' => array( 'input'=>'>-','tag'=>'mo', 'output'=>'&#' . hexdec('227B') . ';'),
-'in' => array( 'input'=>'in','tag'=>'mo', 'output'=>'&#' . hexdec('2208') . ';'),
-'!in' => array( 'input'=>'!in','tag'=>'mo', 'output'=>'&#' . hexdec('2209') . ';'),
-'sub' => array( 'input'=>'sub','tag'=>'mo', 'output'=>'&#' . hexdec('2282') . ';'),
-'sup' => array( 'input'=>'sup','tag'=>'mo', 'output'=>'&#' . hexdec('2283') . ';'),
-'sube' => array( 'input'=>'sube','tag'=>'mo', 'output'=>'&#' . hexdec('2286') . ';'),
-'supe' => array( 'input'=>'supe','tag'=>'mo', 'output'=>'&#' . hexdec('2287') . ';'),
-'-=' => array( 'input'=>'-=','tag'=>'mo', 'output'=>'&#' . hexdec('2261') . ';'),
-'~=' => array( 'input'=>'~=','tag'=>'mo', 'output'=>'&#' . hexdec('2245') . ';'),
-'~~' => array( 'input'=>'~~','tag'=>'mo', 'output'=>'&#' . hexdec('2248') . ';'),
-'prop' => array( 'input'=>'prop','tag'=>'mo', 'output'=>'&#' . hexdec('221D') . ';'),
-
-// Logical symbols
-'and' => array( 'input'=>'and','tag'=>'mtext', 'output'=>'and', 'space'=>'1ex'),
-'or' => array( 'input'=>'or','tag'=>'mtext', 'output'=>'or', 'space'=>'1ex'),
-'not' => array( 'input'=>'not','tag'=>'mo', 'output'=>'&#' . hexdec('00AC') . ';'),
-'=>' => array( 'input'=>'=>','tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
-'if' => array( 'input'=>'if','tag'=>'mo', 'output'=>'if', 'space'=>'1ex'),
-'iff' => array( 'input'=>'iff','tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
-'<=>' => array( 'input'=>'iff','tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'), /* 2005-06-07 wes */
-'AA' => array( 'input'=>'AA','tag'=>'mo', 'output'=>'&#' . hexdec('2200') . ';'),
-'EE' => array( 'input'=>'EE','tag'=>'mo', 'output'=>'&#' . hexdec('2203') . ';'),
-'_|_' => array( 'input'=>'_|_','tag'=>'mo', 'output'=>'&#' . hexdec('22A5') . ';'),
-'TT' => array( 'input'=>'TT','tag'=>'mo', 'output'=>'&#' . hexdec('22A4') . ';'),
-'|-' => array( 'input'=>'|-','tag'=>'mo', 'output'=>'&#' . hexdec('22A2') . ';'),
-'|=' => array( 'input'=>'|=','tag'=>'mo', 'output'=>'&#' . hexdec('22A8') . ';'),
-
-// Miscellaneous symbols
-'ang' => array('input'=>'ang','tag'=>'mo','output'=>'&#' . hexdec('2220') . ';'),
-'deg' => array('input'=>'deg','tag'=>'mo','output'=>'&#' . hexdec('00B0') . ';'),
-'int' => array( 'input'=>'int','tag'=>'mo', 'output'=>'&#' . hexdec('222B') . ';'),
-'dx' => array( 'input'=>'dx','tag'=>'mi', 'output'=>'{:d x:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dy' => array( 'input'=>'dy','tag'=>'mi', 'output'=>'{:d y:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dz' => array( 'input'=>'dz','tag'=>'mi', 'output'=>'{:d z:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dt' => array( 'input'=>'dt','tag'=>'mi', 'output'=>'{:d t:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'oint' => array( 'input'=>'oint','tag'=>'mo', 'output'=>'&#' . hexdec('222E') . ';'),
-'del' => array( 'input'=>'del','tag'=>'mo', 'output'=>'&#' . hexdec('2202') . ';'),
-'grad' => array( 'input'=>'grad','tag'=>'mo', 'output'=>'&#' . hexdec('2207') . ';'),
-'+-' => array( 'input'=>'+-','tag'=>'mo', 'output'=>'&#' . hexdec('00B1') . ';'),
-'O/' => array( 'input'=>'0/','tag'=>'mo', 'output'=>'&#' . hexdec('2205') . ';'),
-'oo' => array( 'input'=>'oo','tag'=>'mo', 'output'=>'&#' . hexdec('221E') . ';'),
-'aleph' => array( 'input'=>'aleph','tag'=>'mo', 'output'=>'&#' . hexdec('2135') . ';'),
-'...' => array( 'input'=>'int','tag'=>'mo', 'output'=>'...'),
-'~' => array( 'input'=>'!~','tag'=>'mo', 'output'=>'&#' . hexdec('0020') . ';'),
-'\\ ' => array( 'input'=>'~','tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';'),
-'quad' => array( 'input'=>'quad','tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
-'qquad' => array( 'input'=>'qquad','tag'=>'mo', 'output'=> '&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
-'cdots' => array( 'input'=>'cdots','tag'=>'mo', 'output'=>'&#' . hexdec('22EF') . ';'),
-'vdots' => array( 'input'=>'vdots','tag'=>'mo', 'output'=>'&#' . hexdec('22EE') . ';'), /* 2005-06-11 wes */
-'ddots' => array( 'input'=>'ddots','tag'=>'mo', 'output'=>'&#' . hexdec('22F1') . ';'), /* 2005-06-11 wes */
-'diamond' => array( 'input'=>'diamond','tag'=>'mo', 'output'=>'&#' . hexdec('22C4') . ';'),
-'square' => array( 'input'=>'square','tag'=>'mo', 'output'=>'&#' . hexdec('25A1') . ';'),
-'|_' => array( 'input'=>'|_','tag'=>'mo', 'output'=>'&#' . hexdec('230A') . ';'),
-'_|' => array( 'input'=>'_|','tag'=>'mo', 'output'=>'&#' . hexdec('230B') . ';'),
-'|~' => array( 'input'=>'|~','tag'=>'mo', 'output'=>'&#' . hexdec('2308') . ';'),
-'~|' => array( 'input'=>'~|','tag'=>'mo', 'output'=>'&#' . hexdec('2309') . ';'),
-'CC' => array( 'input'=>'CC','tag'=>'mo', 'output'=>'&#' . hexdec('2102') . ';'),
-'NN' => array( 'input'=>'NN','tag'=>'mo', 'output'=>'&#' . hexdec('2115') . ';'),
-'QQ' => array( 'input'=>'QQ','tag'=>'mo', 'output'=>'&#' . hexdec('211A') . ';'),
-'RR' => array( 'input'=>'RR','tag'=>'mo', 'output'=>'&#' . hexdec('211D') . ';'),
-'ZZ' => array( 'input'=>'ZZ','tag'=>'mo', 'output'=>'&#' . hexdec('2124') . ';'),
-
-// Standard functions
-'lim' => array( 'input'=>'lim','tag'=>'mo', 'output'=>'lim', 'underover'=>TRUE),
-'Lim' => array( 'input'=>'Lim','tag'=>'mo', 'output'=>'Lim', 'underover'=>TRUE), /* 2005-06-11 wes */
-'sin' => array( 'input'=>'sin','tag'=>'mo', 'output'=>'sin', 'unary'=>TRUE, 'func'=>TRUE),
-'cos' => array( 'input'=>'cos', 'tag'=>'mo', 'output'=>'cos', 'unary'=>TRUE, 'func'=>TRUE),
-'tan' => array( 'input'=>'tan', 'tag'=>'mo', 'output'=>'tan', 'unary'=>TRUE, 'func'=>TRUE),
-'arcsin' => array( 'input'=>'arcsin','tag'=>'mo', 'output'=>'arcsin', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'arccos' => array( 'input'=>'arccos', 'tag'=>'mo', 'output'=>'arccos', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'arctan' => array( 'input'=>'arctan', 'tag'=>'mo', 'output'=>'arctan', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'sinh' => array( 'input'=>'sinh','tag'=>'mo', 'output'=>'sinh', 'unary'=>TRUE, 'func'=>TRUE),
-'cosh' => array( 'input'=>'cosh', 'tag'=>'mo', 'output'=>'cosh', 'unary'=>TRUE, 'func'=>TRUE),
-'tanh' => array( 'input'=>'tanh', 'tag'=>'mo', 'output'=>'tanh', 'unary'=>TRUE, 'func'=>TRUE),
-'cot' => array( 'input'=>'cot','tag'=>'mo', 'output'=>'cot', 'unary'=>TRUE, 'func'=>TRUE),
-'sec' => array( 'input'=>'sec', 'tag'=>'mo', 'output'=>'sec', 'unary'=>TRUE, 'func'=>TRUE),
-'csc' => array( 'input'=>'csc', 'tag'=>'mo', 'output'=>'csc', 'unary'=>TRUE, 'func'=>TRUE),
-'coth' => array( 'input'=>'coth','tag'=>'mo', 'output'=>'coth', 'unary'=>TRUE, 'func'=>TRUE),
-'sech' => array( 'input'=>'sech', 'tag'=>'mo', 'output'=>'sech', 'unary'=>TRUE, 'func'=>TRUE),
-'csch' => array( 'input'=>'csch', 'tag'=>'mo', 'output'=>'csch', 'unary'=>TRUE, 'func'=>TRUE),
-'log' => array( 'input'=>'log', 'tag'=>'mo', 'output'=>'log', 'unary'=>TRUE, 'func'=>TRUE),
-'ln' => array( 'input'=>'ln', 'tag'=>'mo', 'output'=>'ln', 'unary'=>TRUE, 'func'=>TRUE),
-'det' => array( 'input'=>'det', 'tag'=>'mo', 'output'=>'det', 'unary'=>TRUE, 'func'=>TRUE),
-'dim' => array( 'input'=>'dim', 'tag'=>'mo', 'output'=>'dim'),
-'mod' => array( 'input'=>'mod', 'tag'=>'mo', 'output'=>'mod'),
-'gcd' => array( 'input'=>'gcd', 'tag'=>'mo', 'output'=>'gcd', 'unary'=>TRUE, 'func'=>TRUE),
-'lcm' => array( 'input'=>'lcm', 'tag'=>'mo', 'output'=>'lcm', 'unary'=>TRUE, 'func'=>TRUE),
-'lub' => array( 'input'=>'lub', 'tag'=>'mo', 'output'=>'lub'), /* 2005-06-11 wes */
-'glb' => array( 'input'=>'glb', 'tag'=>'mo', 'output'=>'glb'), /* 2005-06-11 wes */
-'min' => array( 'input'=>'min', 'tag'=>'mo', 'output'=>'min', 'underover'=>TRUE), /* 2005-06-11 wes */
-'max' => array( 'input'=>'max', 'tag'=>'mo', 'output'=>'max', 'underover'=>TRUE), /* 2005-06-11 wes */
-'f' => array( 'input'=>'f','tag'=>'mi', 'output'=>'f', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'g' => array( 'input'=>'g', 'tag'=>'mi', 'output'=>'g', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-
-// Arrows
-'uarr' => array( 'input'=>'uarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2191') . ';'),
-'darr' => array( 'input'=>'darr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2193') . ';'),
-'rarr' => array( 'input'=>'rarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
-'->' => array( 'input'=>'->', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
-'|->' => array( 'input'=>'|->', 'tag'=>'mo', 'output'=>'&#' . hexdec('21A6') . ';'), /* 2005-06-11 wes */
-'larr' => array( 'input'=>'larr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2190') . ';'),
-'harr' => array( 'input'=>'harr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2194') . ';'),
-'rArr' => array( 'input'=>'rArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
-'lArr' => array( 'input'=>'lArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D0') . ';'),
-'hArr' => array( 'input'=>'hArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
-
-// Commands with argument
-'sqrt' => array( 'input'=>'sqrt', 'tag'=>'msqrt', 'output'=>'sqrt', 'unary'=>TRUE ),
-'root' => array( 'input'=>'root', 'tag'=>'mroot', 'output'=>'root', 'binary'=>TRUE ),
-'frac' => array( 'input'=>'frac', 'tag'=>'mfrac', 'output'=>'/', 'binary'=>TRUE),
-'/' => array( 'input'=>'/', 'tag'=>'mfrac', 'output'=>'/', 'infix'=>TRUE),
-'_' => array( 'input'=>'_', 'tag'=>'msub', 'output'=>'_', 'infix'=>TRUE),
-'^' => array( 'input'=>'^', 'tag'=>'msup', 'output'=>'^', 'infix'=>TRUE),
-'hat' => array( 'input'=>'hat', 'tag'=>'mover', 'output'=>'&#' . hexdec('005E') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'bar' => array( 'input'=>'bar', 'tag'=>'mover', 'output'=>'&#' . hexdec('00AF') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'vec' => array( 'input'=>'vec', 'tag'=>'mover', 'output'=>'&#' . hexdec('2192') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'dot' => array( 'input'=>'dot', 'tag'=>'mover', 'output'=>'.', 'unary'=>TRUE, 'acc'=>TRUE),
-'ddot' => array( 'input'=>'ddot', 'tag'=>'mover', 'output'=>'..', 'unary'=>TRUE, 'acc'=>TRUE),
-'ul' => array( 'input'=>'ul', 'tag'=>'munder', 'output'=>'&#' . hexdec('0332') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'avec' => array( 'input'=>'avec', 'tag'=>'munder', 'output'=>'~', 'unary'=>TRUE, 'acc'=>TRUE),
-'text' => array( 'input'=>'text', 'tag'=>'mtext', 'output'=>'text', 'unary'=>TRUE),
-'mbox' => array( 'input'=>'mbox', 'tag'=>'mtext', 'output'=>'mbox', 'unary'=>TRUE),
-'"' => array( 'input'=>'"', 'tag'=>'mtext','output'=>'mbox', 'unary'=>TRUE),
-
-/* 2005-06-05 wes: added stackrel */
-'stackrel' => array( 'input'=>'stackrel', 'tag'=>'mover', 'output'=>'stackrel', 'binary'=>TRUE),
-
-// Grouping brackets
-'(' => array( 'input'=>'(', 'tag'=>'mo', 'output'=>'(', 'left_bracket'=>TRUE),
-')' => array( 'input'=>')', 'tag'=>'mo', 'output'=>')', 'right_bracket'=>TRUE),
-'[' => array( 'input'=>'[', 'tag'=>'mo', 'output'=>'[', 'left_bracket'=>TRUE),
-']' => array( 'input'=>']', 'tag'=>'mo', 'output'=>']', 'right_bracket'=>TRUE),
-'{' => array( 'input'=>'{', 'tag'=>'mo', 'output'=>'{', 'left_bracket'=>TRUE),
-'}' => array( 'input'=>'}', 'tag'=>'mo', 'output'=>'}', 'right_bracket'=>TRUE),
-'(:' => array( 'input'=>'(:', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE),
-':)' => array( 'input'=>':)', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE),
-'{:' => array( 'input'=>'{:', 'tag'=>'mo', 'output'=>'{:', 'left_bracket'=>TRUE, 'invisible'=>TRUE),
-':}' => array( 'input'=>':}', 'tag'=>'mo', 'output'=>':}', 'right_bracket'=>TRUE ,'invisible'=>TRUE),
-'<<' => array( 'input'=>'<<', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE), // 2005-06-07 wes
-'>>' => array( 'input'=>'>>', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE) // 2005-06-07 wes
-);
+ // Greek symbols
+ 'alpha' => array( 'input'=>'alpha', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B1') . ';'),
+ 'beta' => array( 'input'=>'beta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B2') . ';'),
+ 'chi' => array( 'input'=>'chi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C7') . ';'),
+ 'delta' => array( 'input'=>'delta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B4') . ';'),
+ 'Delta' => array( 'input'=>'Delta', 'tag'=>'mo', 'output'=>'&#' . hexdec('0394') . ';'),
+ 'epsi' => array( 'input'=>'epsi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B5') . ';'),
+ 'varepsilon' => array( 'input'=>'varepsilon','tag'=>'mi', 'output'=>'&#' . hexdec('025B') . ';'),
+ 'eta' => array( 'input'=>'eta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B7') . ';'),
+ 'gamma' => array( 'input'=>'gamma', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B3') . ';'),
+ 'Gamma' => array( 'input'=>'Gamma', 'tag'=>'mi', 'output'=>'&#' . hexdec('0393') . ';'),
+ 'iota' => array( 'input'=>'iota', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B9') . ';'),
+ 'kappa' => array( 'input'=>'kappa', 'tag'=>'mi', 'output'=>'&#' . hexdec('03BA') . ';'),
+ 'lambda' => array( 'input'=>'lambda', 'tag'=>'mi', 'output'=>'&#' . hexdec('03BB') . ';'),
+ 'Lambda' => array( 'input'=>'Lambda', 'tag'=>'mo', 'output'=>'&#' . hexdec('039B') . ';'),
+ 'mu' => array( 'input'=>'mu', 'tag'=>'mi', 'output'=>'&#' . hexdec('03BC') . ';'),
+ 'nu' => array( 'input'=>'nu', 'tag'=>'mi', 'output'=>'&#' . hexdec('03BD') . ';'),
+ 'omega' => array( 'input'=>'omega', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C9') . ';'),
+ 'Omega' => array( 'input'=>'Omega', 'tag'=>'mo', 'output'=>'&#' . hexdec('03A9') . ';'),
+ 'phi' => array( 'input'=>'phi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C6') . ';'),
+ 'varphi' => array( 'input'=>'varphi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03D5') . ';'),
+ 'Phi' => array( 'input'=>'Phi', 'tag'=>'mo', 'output'=>'&#' . hexdec('03A6') . ';'),
+ 'pi' => array( 'input'=>'pi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C0') . ';'),
+ 'Pi' => array( 'input'=>'Pi', 'tag'=>'mo', 'output'=>'&#' . hexdec('03A0') . ';'),
+ 'psi' => array( 'input'=>'psi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C8') . ';'),
+ 'rho' => array( 'input'=>'rho', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C1') . ';'),
+ 'sigma' => array( 'input'=>'sigma', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C3') . ';'),
+ 'Sigma' => array( 'input'=>'Sigma', 'tag'=>'mo', 'output'=>'&#' . hexdec('03A3') . ';'),
+ 'tau' => array( 'input'=>'tau', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C4') . ';'),
+ 'theta' => array( 'input'=>'theta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B8') . ';'),
+ 'vartheta' => array( 'input'=>'vartheta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03D1') . ';'),
+ 'Theta' => array( 'input'=>'Theta', 'tag'=>'mo', 'output'=>'&#' . hexdec('0398') . ';'),
+ 'upsilon' => array( 'input'=>'upsilon', 'tag'=>'mi', 'output'=>'&#' . hexdec('03C5') . ';'),
+ 'xi' => array( 'input'=>'xi', 'tag'=>'mi', 'output'=>'&#' . hexdec('03BE') . ';'),
+ 'Xi' => array( 'input'=>'alpha', 'tag'=>'mo', 'output'=>'&#' . hexdec('039E') . ';'),
+ 'zeta' => array( 'input'=>'zeta', 'tag'=>'mi', 'output'=>'&#' . hexdec('03B6') . ';'),
+
+ // Binary operation symbols
+ '*' => array( 'input'=>'*', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';'),
+ '**' => array( 'input'=>'**', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C6') . ';'),
+ '//' => array( 'input'=>'//', 'tag'=>'mo', 'output'=>'/'),
+ '\\\\' => array( 'input'=>'\\\\', 'tag'=>'mo', 'output'=>'\\'),
+ 'xx' => array( 'input'=>'xx', 'tag'=>'mo', 'output'=>'&#' . hexdec('00D7') . ';'),
+ '-:' => array( 'input'=>'-:', 'tag'=>'mo', 'output'=>'&#' . hexdec('00F7') . ';'),
+ '@' => array( 'input'=>'@', 'tag'=>'mo', 'output'=>'&#' . hexdec('2218') . ';'),
+ 'o+' => array( 'input'=>'o+', 'tag'=>'mo', 'output'=>'&#' . hexdec('2295') . ';'),
+ 'ox' => array( 'input'=>'ox', 'tag'=>'mo', 'output'=>'&#' . hexdec('2297') . ';'),
+ 'sum' => array( 'input'=>'sum', 'tag'=>'mo', 'output'=>'&#' . hexdec('2211') . ';', 'underover'=>TRUE),
+ 'prod' => array( 'input'=>'prod', 'tag'=>'mo', 'output'=>'&#' . hexdec('220F') . ';', 'underover'=>TRUE),
+ '^^' => array( 'input'=>'^^', 'tag'=>'mo', 'output'=>'&#' . hexdec('2227') . ';'),
+ '^^^' => array( 'input'=>'^^^', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C0') . ';', 'underover'=>TRUE),
+ 'vv' => array( 'input'=>'vv', 'tag'=>'mo', 'output'=>'&#' . hexdec('2228') . ';'),
+ 'vvv' => array( 'input'=>'vvv', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C1') . ';', 'underover'=>TRUE),
+ 'nn' => array( 'input'=>'nn', 'tag'=>'mo', 'output'=>'&#' . hexdec('2229') . ';'),
+ 'nnn' => array( 'input'=>'nnn', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';', 'underover'=>TRUE),
+ 'uu' => array( 'input'=>'uu', 'tag'=>'mo', 'output'=>'&#' . hexdec('222A') . ';'),
+ 'uuu' => array( 'input'=>'uuu', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C3') . ';', 'underover'=>TRUE),
+
+ // Binary relation symbols
+ '!=' => array( 'input'=>'!=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2260') . ';'),
+ ':=' => array( 'input'=>':=', 'tag'=>'mo', 'output'=>':=' ), // 2005-06-05 wes
+ '<' => array( 'input'=>'<', 'tag'=>'mo', 'output'=>'<'),
+ 'lt' => array( 'input'=>'lt', 'tag'=>'mo', 'output'=>'<'), // 2005-06-05 wes
+ '<=' => array( 'input'=>'<=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
+ 'lt=' => array( 'input'=>'lt=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
+ 'le' => array( 'input'=>'le', 'tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'), // 2005-06-05 wes
+ '>' => array( 'input'=>'>', 'tag'=>'mo', 'output'=>'>'),
+ '>=' => array( 'input'=>'>=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
+ 'qeq' => array( 'input'=>'geq', 'tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
+ '-<' => array( 'input'=>'-<', 'tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
+ '-lt' => array( 'input'=>'-lt', 'tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
+ '>-' => array( 'input'=>'>-', 'tag'=>'mo', 'output'=>'&#' . hexdec('227B') . ';'),
+ 'in' => array( 'input'=>'in', 'tag'=>'mo', 'output'=>'&#' . hexdec('2208') . ';'),
+ '!in' => array( 'input'=>'!in', 'tag'=>'mo', 'output'=>'&#' . hexdec('2209') . ';'),
+ 'sub' => array( 'input'=>'sub', 'tag'=>'mo', 'output'=>'&#' . hexdec('2282') . ';'),
+ 'sup' => array( 'input'=>'sup', 'tag'=>'mo', 'output'=>'&#' . hexdec('2283') . ';'),
+ 'sube' => array( 'input'=>'sube', 'tag'=>'mo', 'output'=>'&#' . hexdec('2286') . ';'),
+ 'supe' => array( 'input'=>'supe', 'tag'=>'mo', 'output'=>'&#' . hexdec('2287') . ';'),
+ '-=' => array( 'input'=>'-=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2261') . ';'),
+ '~=' => array( 'input'=>'~=', 'tag'=>'mo', 'output'=>'&#' . hexdec('2245') . ';'),
+ '~~' => array( 'input'=>'~~', 'tag'=>'mo', 'output'=>'&#' . hexdec('2248') . ';'),
+ 'prop' => array( 'input'=>'prop', 'tag'=>'mo', 'output'=>'&#' . hexdec('221D') . ';'),
+
+ // Logical symbols
+ 'and' => array( 'input'=>'and', 'tag'=>'mtext', 'output'=>'and', 'space'=>'1ex'),
+ 'or' => array( 'input'=>'or', 'tag'=>'mtext', 'output'=>'or', 'space'=>'1ex'),
+ 'not' => array( 'input'=>'not', 'tag'=>'mo', 'output'=>'&#' . hexdec('00AC') . ';'),
+ '=>' => array( 'input'=>'=>', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
+ 'if' => array( 'input'=>'if', 'tag'=>'mo', 'output'=>'if', 'space'=>'1ex'),
+ 'iff' => array( 'input'=>'iff', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
+ '<=>' => array( 'input'=>'iff', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'), // 2005-06-07 wes
+ 'AA' => array( 'input'=>'AA', 'tag'=>'mo', 'output'=>'&#' . hexdec('2200') . ';'),
+ 'EE' => array( 'input'=>'EE', 'tag'=>'mo', 'output'=>'&#' . hexdec('2203') . ';'),
+ '_|_' => array( 'input'=>'_|_', 'tag'=>'mo', 'output'=>'&#' . hexdec('22A5') . ';'),
+ 'TT' => array( 'input'=>'TT', 'tag'=>'mo', 'output'=>'&#' . hexdec('22A4') . ';'),
+ '|-' => array( 'input'=>'|-', 'tag'=>'mo', 'output'=>'&#' . hexdec('22A2') . ';'),
+ '|=' => array( 'input'=>'|=', 'tag'=>'mo', 'output'=>'&#' . hexdec('22A8') . ';'),
+
+ // Miscellaneous symbols
+ 'ang' => array( 'input'=>'ang', 'tag'=>'mo', 'output'=>'&#' . hexdec('2220') . ';'),
+ 'deg' => array( 'input'=>'deg', 'tag'=>'mo', 'output'=>'&#' . hexdec('00B0') . ';'),
+ 'int' => array( 'input'=>'int', 'tag'=>'mo', 'output'=>'&#' . hexdec('222B') . ';'),
+ 'dx' => array( 'input'=>'dx', 'tag'=>'mi', 'output'=>'{:d x:}', 'definition'=>TRUE), // 2005-06-11 wes
+ 'dy' => array( 'input'=>'dy', 'tag'=>'mi', 'output'=>'{:d y:}', 'definition'=>TRUE), // 2005-06-11 wes
+ 'dz' => array( 'input'=>'dz', 'tag'=>'mi', 'output'=>'{:d z:}', 'definition'=>TRUE), // 2005-06-11 wes
+ 'dt' => array( 'input'=>'dt', 'tag'=>'mi', 'output'=>'{:d t:}', 'definition'=>TRUE), // 2005-06-11 wes
+ 'oint' => array( 'input'=>'oint', 'tag'=>'mo', 'output'=>'&#' . hexdec('222E') . ';'),
+ 'del' => array( 'input'=>'del', 'tag'=>'mo', 'output'=>'&#' . hexdec('2202') . ';'),
+ 'grad' => array( 'input'=>'grad', 'tag'=>'mo', 'output'=>'&#' . hexdec('2207') . ';'),
+ '+-' => array( 'input'=>'+-', 'tag'=>'mo', 'output'=>'&#' . hexdec('00B1') . ';'),
+ 'O/' => array( 'input'=>'0/', 'tag'=>'mo', 'output'=>'&#' . hexdec('2205') . ';'),
+ 'oo' => array( 'input'=>'oo', 'tag'=>'mo', 'output'=>'&#' . hexdec('221E') . ';'),
+ 'aleph' => array( 'input'=>'aleph', 'tag'=>'mo', 'output'=>'&#' . hexdec('2135') . ';'),
+ '...' => array( 'input'=>'int', 'tag'=>'mo', 'output'=>'...'),
+ '~' => array( 'input'=>'!~', 'tag'=>'mo', 'output'=>'&#' . hexdec('0020') . ';'),
+ '\\ ' => array( 'input'=>'~', 'tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';'),
+ 'quad' => array( 'input'=>'quad', 'tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
+ 'qquad' => array( 'input'=>'qquad', 'tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
+ 'cdots' => array( 'input'=>'cdots', 'tag'=>'mo', 'output'=>'&#' . hexdec('22EF') . ';'),
+ 'vdots' => array( 'input'=>'vdots', 'tag'=>'mo', 'output'=>'&#' . hexdec('22EE') . ';'), // 2005-06-11 wes
+ 'ddots' => array( 'input'=>'ddots', 'tag'=>'mo', 'output'=>'&#' . hexdec('22F1') . ';'), // 2005-06-11 wes
+ 'diamond' => array( 'input'=>'diamond', 'tag'=>'mo', 'output'=>'&#' . hexdec('22C4') . ';'),
+ 'square' => array( 'input'=>'square', 'tag'=>'mo', 'output'=>'&#' . hexdec('25A1') . ';'),
+ '|_' => array( 'input'=>'|_', 'tag'=>'mo', 'output'=>'&#' . hexdec('230A') . ';'),
+ '_|' => array( 'input'=>'_|', 'tag'=>'mo', 'output'=>'&#' . hexdec('230B') . ';'),
+ '|~' => array( 'input'=>'|~', 'tag'=>'mo', 'output'=>'&#' . hexdec('2308') . ';'),
+ '~|' => array( 'input'=>'~|', 'tag'=>'mo', 'output'=>'&#' . hexdec('2309') . ';'),
+ 'CC' => array( 'input'=>'CC', 'tag'=>'mo', 'output'=>'&#' . hexdec('2102') . ';'),
+ 'NN' => array( 'input'=>'NN', 'tag'=>'mo', 'output'=>'&#' . hexdec('2115') . ';'),
+ 'QQ' => array( 'input'=>'QQ', 'tag'=>'mo', 'output'=>'&#' . hexdec('211A') . ';'),
+ 'RR' => array( 'input'=>'RR', 'tag'=>'mo', 'output'=>'&#' . hexdec('211D') . ';'),
+ 'ZZ' => array( 'input'=>'ZZ', 'tag'=>'mo', 'output'=>'&#' . hexdec('2124') . ';'),
+
+ // Standard functions
+ 'lim' => array( 'input'=>'lim', 'tag'=>'mo', 'output'=>'lim', 'underover'=>TRUE),
+ 'Lim' => array( 'input'=>'Lim', 'tag'=>'mo', 'output'=>'Lim', 'underover'=>TRUE), // 2005-06-11 wes
+ 'sin' => array( 'input'=>'sin', 'tag'=>'mo', 'output'=>'sin', 'unary'=>TRUE, 'func'=>TRUE),
+ 'cos' => array( 'input'=>'cos', 'tag'=>'mo', 'output'=>'cos', 'unary'=>TRUE, 'func'=>TRUE),
+ 'tan' => array( 'input'=>'tan', 'tag'=>'mo', 'output'=>'tan', 'unary'=>TRUE, 'func'=>TRUE),
+ 'arcsin' => array( 'input'=>'arcsin', 'tag'=>'mo', 'output'=>'arcsin', 'unary'=>TRUE, 'func'=>TRUE), // 2006-09-07 DL
+ 'arccos' => array( 'input'=>'arccos', 'tag'=>'mo', 'output'=>'arccos', 'unary'=>TRUE, 'func'=>TRUE), // 2006-09-07 DL
+ 'arctan' => array( 'input'=>'arctan', 'tag'=>'mo', 'output'=>'arctan', 'unary'=>TRUE, 'func'=>TRUE), // 2006-09-07 DL
+ 'sinh' => array( 'input'=>'sinh', 'tag'=>'mo', 'output'=>'sinh', 'unary'=>TRUE, 'func'=>TRUE),
+ 'cosh' => array( 'input'=>'cosh', 'tag'=>'mo', 'output'=>'cosh', 'unary'=>TRUE, 'func'=>TRUE),
+ 'tanh' => array( 'input'=>'tanh', 'tag'=>'mo', 'output'=>'tanh', 'unary'=>TRUE, 'func'=>TRUE),
+ 'cot' => array( 'input'=>'cot', 'tag'=>'mo', 'output'=>'cot', 'unary'=>TRUE, 'func'=>TRUE),
+ 'sec' => array( 'input'=>'sec', 'tag'=>'mo', 'output'=>'sec', 'unary'=>TRUE, 'func'=>TRUE),
+ 'csc' => array( 'input'=>'csc', 'tag'=>'mo', 'output'=>'csc', 'unary'=>TRUE, 'func'=>TRUE),
+ 'coth' => array( 'input'=>'coth', 'tag'=>'mo', 'output'=>'coth', 'unary'=>TRUE, 'func'=>TRUE),
+ 'sech' => array( 'input'=>'sech', 'tag'=>'mo', 'output'=>'sech', 'unary'=>TRUE, 'func'=>TRUE),
+ 'csch' => array( 'input'=>'csch', 'tag'=>'mo', 'output'=>'csch', 'unary'=>TRUE, 'func'=>TRUE),
+ 'log' => array( 'input'=>'log', 'tag'=>'mo', 'output'=>'log', 'unary'=>TRUE, 'func'=>TRUE),
+ 'ln' => array( 'input'=>'ln', 'tag'=>'mo', 'output'=>'ln', 'unary'=>TRUE, 'func'=>TRUE),
+ 'det' => array( 'input'=>'det', 'tag'=>'mo', 'output'=>'det', 'unary'=>TRUE, 'func'=>TRUE),
+ 'dim' => array( 'input'=>'dim', 'tag'=>'mo', 'output'=>'dim'),
+ 'mod' => array( 'input'=>'mod', 'tag'=>'mo', 'output'=>'mod'),
+ 'gcd' => array( 'input'=>'gcd', 'tag'=>'mo', 'output'=>'gcd', 'unary'=>TRUE, 'func'=>TRUE),
+ 'lcm' => array( 'input'=>'lcm', 'tag'=>'mo', 'output'=>'lcm', 'unary'=>TRUE, 'func'=>TRUE),
+ 'lub' => array( 'input'=>'lub', 'tag'=>'mo', 'output'=>'lub'), // 2005-06-11 wes
+ 'glb' => array( 'input'=>'glb', 'tag'=>'mo', 'output'=>'glb'), // 2005-06-11 wes
+ 'min' => array( 'input'=>'min', 'tag'=>'mo', 'output'=>'min', 'underover'=>TRUE), // 2005-06-11 wes
+ 'max' => array( 'input'=>'max', 'tag'=>'mo', 'output'=>'max', 'underover'=>TRUE), // 2005-06-11 wes
+ 'f' => array( 'input'=>'f', 'tag'=>'mi', 'output'=>'f', 'unary'=>TRUE, 'func'=>TRUE), // 2006-09-07 DL
+ 'g' => array( 'input'=>'g', 'tag'=>'mi', 'output'=>'g', 'unary'=>TRUE, 'func'=>TRUE), // 2006-09-07 DL
+
+ // Arrows
+ 'uarr' => array( 'input'=>'uarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2191') . ';'),
+ 'darr' => array( 'input'=>'darr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2193') . ';'),
+ 'rarr' => array( 'input'=>'rarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
+ '->' => array( 'input'=>'->', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
+ '|->' => array( 'input'=>'|->', 'tag'=>'mo', 'output'=>'&#' . hexdec('21A6') . ';'), // 2005-06-11 wes
+ 'larr' => array( 'input'=>'larr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2190') . ';'),
+ 'harr' => array( 'input'=>'harr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2194') . ';'),
+ 'rArr' => array( 'input'=>'rArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
+ 'lArr' => array( 'input'=>'lArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D0') . ';'),
+ 'hArr' => array( 'input'=>'hArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
+
+ // Commands with argument
+ 'sqrt' => array( 'input'=>'sqrt', 'tag'=>'msqrt', 'output'=>'sqrt', 'unary'=>TRUE),
+ 'root' => array( 'input'=>'root', 'tag'=>'mroot', 'output'=>'root', 'binary'=>TRUE),
+ 'frac' => array( 'input'=>'frac', 'tag'=>'mfrac', 'output'=>'/', 'binary'=>TRUE),
+ 'stackrel' => array( 'input'=>'stackrel', 'tag'=>'mover', 'output'=>'stackrel', 'binary'=>TRUE), // 2005-06-05 wes
+ '/' => array( 'input'=>'/', 'tag'=>'mfrac', 'output'=>'/', 'infix'=>TRUE),
+ '_' => array( 'input'=>'_', 'tag'=>'msub', 'output'=>'_', 'infix'=>TRUE),
+ '^' => array( 'input'=>'^', 'tag'=>'msup', 'output'=>'^', 'infix'=>TRUE),
+ 'hat' => array( 'input'=>'hat', 'tag'=>'mover', 'output'=>'&#' . hexdec('005E') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'bar' => array( 'input'=>'bar', 'tag'=>'mover', 'output'=>'&#' . hexdec('00AF') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'vec' => array( 'input'=>'vec', 'tag'=>'mover', 'output'=>'&#' . hexdec('2192') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'dot' => array( 'input'=>'dot', 'tag'=>'mover', 'output'=>'.', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'ddot' => array( 'input'=>'ddot', 'tag'=>'mover', 'output'=>'..', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'ul' => array( 'input'=>'ul', 'tag'=>'munder', 'output'=>'&#' . hexdec('0332') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'avec' => array( 'input'=>'avec', 'tag'=>'munder', 'output'=>'~', 'unary'=>TRUE, 'acc'=>TRUE),
+ 'text' => array( 'input'=>'text', 'tag'=>'mtext', 'output'=>'text', 'unary'=>TRUE),
+ 'mbox' => array( 'input'=>'mbox', 'tag'=>'mtext', 'output'=>'mbox', 'unary'=>TRUE),
+ '"' => array( 'input'=>'"', 'tag'=>'mtext', 'output'=>'mbox', 'unary'=>TRUE),
+
+ // Grouping brackets
+ '(' => array( 'input'=>'(', 'tag'=>'mo', 'output'=>'(', 'left_bracket'=>TRUE),
+ ')' => array( 'input'=>')', 'tag'=>'mo', 'output'=>')', 'right_bracket'=>TRUE),
+ '[' => array( 'input'=>'[', 'tag'=>'mo', 'output'=>'[', 'left_bracket'=>TRUE),
+ ']' => array( 'input'=>']', 'tag'=>'mo', 'output'=>']', 'right_bracket'=>TRUE),
+ '{' => array( 'input'=>'{', 'tag'=>'mo', 'output'=>'{', 'left_bracket'=>TRUE),
+ '}' => array( 'input'=>'}', 'tag'=>'mo', 'output'=>'}', 'right_bracket'=>TRUE),
+ '(:' => array( 'input'=>'(:', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE),
+ ':)' => array( 'input'=>':)', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE),
+ '{:' => array( 'input'=>'{:', 'tag'=>'mo', 'output'=>'{:', 'left_bracket'=>TRUE, 'invisible'=>TRUE),
+ ':}' => array( 'input'=>':}', 'tag'=>'mo', 'output'=>':}', 'right_bracket'=>TRUE ,'invisible'=>TRUE),
+ '<<' => array( 'input'=>'<<', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE), // 2005-06-07 wes
+ '>>' => array( 'input'=>'>>', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE) // 2005-06-07 wes
+);
\ No newline at end of file
Modified: trunk/lib/ASCIIMathPHP/ASCIIMathPHP.class.php
===================================================================
--- trunk/lib/ASCIIMathPHP/ASCIIMathPHP.class.php 2016-10-14 10:41:55 UTC (rev 9969)
+++ trunk/lib/ASCIIMathPHP/ASCIIMathPHP.class.php 2016-10-14 11:00:13 UTC (rev 9970)
@@ -5,11 +5,13 @@
* -- XMLNode
* -- MathMLNode extends XMLNode
*
+ * ASCIIMathPHP Version 2.1, 30 December 2013, (c) Zefling (http://ikilote.net / ze...@ik...)
+ *
* These classes are a PHP port of ASCIIMath
* Version 1.3 Feb 19 2004, (c) Peter Jipsen http://www.chapman.edu/~jipsen
*
* ASCIIMathPHP Version 1.11, 26 April 2006, (c) Kee-Lin Steven Chan (kc...@co...)
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
@@ -23,6 +25,10 @@
*
* ChangeLog
*
+ * Ver 2.1
+ * -- correct PHP5 object version of ASCIIMathPHP, MathMLNode, XMLNode
+ * -- fixed bug of empty list in XMLNode (dumpXML & _dumpAttr)
+ *
* Ver 2.0
* -- PHP5 only version of ASCIIMathPHP
*
@@ -31,10 +37,10 @@
*
* Ver 1.12
* -- Added changes that David Lippman <DLi...@pi...> made to bring ASCIIMathPHP up to
- * ASCIIMath 1.4.7 functionality.
+ * ASCIIMath 1.4.7 public functionality.
* -- Added parseIntExpr, for intermediate expression parsing rule, allowing x^2/x^3 to render as (x^2)/(x^3)
* -- Added quotes as another way of designating text; "hello" is equivalent to text(hello)
- * -- Added FUNC designator to allow sin, cos, etc to act as functions, so sin(x)/x renders as {sin(x)}/x
+ * -- Added FUNC designator to allow sin, cos, etc to act as public functions, so sin(x)/x renders as {sin(x)}/x
*
* Ver 1.11
* -- Fixed bug that stopped script execution for incomplete expressions
@@ -57,1062 +63,1073 @@
class XMLNode
{
- // Private variables
- var $_id;
- var $_name;
- var $_content;
- var $_mt_elem_flg;
- var $_attr_arr;
- var $_child_arr;
- var $_nmspc;
- var $_nmspc_alias;
- var $_parent_id;
- var $_parent_node;
+ // Private variables
+ protected $_id;
+ protected $_name;
+ protected $_content;
+ protected $_mt_elem_flg;
+ protected $_attr_arr;
+ protected $_child_arr;
+ protected $_nmspc;
+ protected $_nmspc_alias;
+ protected $_parent_id;
+ protected $_parent_node;
- function XMLNode($id = NULL)
- {
- $this->_id = isset($id) ? $id : md5(uniqid(rand(),1));
- $this->_name = '';
- $this->_content = '';
- $this->_mt_elem_flg = FALSE;
- $this->_attr_arr = array();
- $this->_child_arr = array();
- $this->_nmspc = '';
- $this->_nmspc_alias = '';
- $this->_parent_id = FALSE;
- $this->_parent_node = NULL;
- }
+ public function __construct($id = null)
+ {
+ $this->_id = isset($id) ? $id : md5(uniqid(rand(),1));
+ $this->_name = '';
+ $this->_content = '';
+ $this->_mt_elem_flg = false;
+ $this->_attr_arr = array();
+ $this->_child_arr = array();
+ $this->_nmspc = '';
+ $this->_nmspc_alias = '';
+ $this->_parent_id = false;
+ $this->_parent_node = null;
+ }
- function addChild(&$node)
- {
- $this->_child_arr[$node->getId()] = $node;
- $node->setParentId($this->_id);
- $node->setParentNode($this);
- }
+ public function addChild(&$node)
+ {
+ $this->_child_arr[$node->getId()] = $node;
+ $node->setParentId($this->_id);
+ $node->setParentNode($this);
+ }
- function addChildArr(&$node_arr)
- {
- $key_arr = array_keys($node_arr);
- $num_key = count($key_arr);
+ public function addChildArr(&$node_arr)
+ {
+ $key_arr = array_keys($node_arr);
+ $num_key = count($key_arr);
- for ($i = 0; $i < $num_key; $i++) {
- $node = $node_arr[$key_arr[$i]];
- $this->addChild($node);
- }
- }
+ for ($i = 0; $i < $num_key; $i++) {
+ $node = $node_arr[$key_arr[$i]];
+ $this->addChild($node);
+ }
+ }
- function insertChildBefore($idx,&$node)
- {
- $key_arr = array_keys($this->_child_arr);
- $num_key = count($key_arr);
- $tmp_arr = arry();
+ public function insertChildBefore($idx,&$node)
+ {
+ $key_arr = array_keys($this->_child_arr);
+ $num_key = count($key_arr);
+ $tmp_arr = arry();
- for ($i = 0;$i < $num_key;$i++) {
- if ($i == $idx) {
- $tmp_arr[$node->getId()] = $node;
- }
- $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
- }
- $this->_child_arr = $tmp_arr;
- }
+ for ($i = 0;$i < $num_key;$i++) {
+ if ($i == $idx) {
+ $tmp_arr[$node->getId()] = $node;
+ }
+ $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
+ }
+ $this->_child_arr = $tmp_arr;
+ }
- function insertChildAfter($idx,&$node)
- {
- $key_arr = array_keys($this->_child_arr);
- $num_key = count($key_arr);
- $tmp_arr = arry();
+ public function insertChildAfter($idx,&$node)
+ {
+ $key_arr = array_keys($this->_child_arr);
+ $num_key = count($key_arr);
+ $tmp_arr = arry();
- for ($i = 0;$i < $num_key;$i++) {
- $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
- if ($i == $idx) {
- $tmp_arr[$node->getId()] = $node;
- }
- }
- $this->_child_arr = $tmp_arr;
- }
+ for ($i = 0;$i < $num_key;$i++) {
+ $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
+ if ($i == $idx) {
+ $tmp_arr[$node->getId()] = $node;
+ }
+ }
+ $this->_child_arr = $tmp_arr;
+ }
- function setId($id)
- {
- $this->_id = $id;
- }
+ public function setId($id)
+ {
+ $this->_id = $id;
+ }
- function setName($name)
- {
- $this->_name = $name;
- }
+ public function setName($name)
+ {
+ $this->_name = $name;
+ }
- function setNamepace($nmspc)
- {
- $this->_nmspc = $nmspc;
- }
+ public function setNamepace($nmspc)
+ {
+ $this->_nmspc = $nmspc;
+ }
- function setNamespaceAlias($nmspc_alias)
- {
- $this->_nmspc_alias = $nmspc_alias;
- }
+ public function setNamespaceAlias($nmspc_alias)
+ {
+ $this->_nmspc_alias = $nmspc_alias;
+ }
- function setContent($content)
- {
- $this->_content = $content;
- }
+ public function setContent($content)
+ {
+ $this->_content = $content;
+ }
- function setEmptyElem($mt_elem_flg)
- {
- $this->_mt_elem_flg = $mt_elem_flg;
- }
+ public function setEmptyElem($mt_elem_flg)
+ {
+ $this->_mt_elem_flg = $mt_elem_flg;
+ }
- function setAttr($attr_nm,$attr_val)
- {
- $this->_attr_arr[$attr_nm] = $attr_val;
- }
+ public function setAttr($attr_nm,$attr_val)
+ {
+ $this->_attr_arr[$attr_nm] = $attr_val;
+ }
- function setAttrArr($attr_arr)
- {
- $this->_attr_arr = $attr_arr;
- }
+ public function setAttrArr($attr_arr)
+ {
+ $this->_attr_arr = $attr_arr;
+ }
- function setParentId($id)
- {
- $this->_parent_id = $id;
- }
+ public function setParentId($id)
+ {
+ $this->_parent_id = $id;
+ }
- function setParentNode(&$node)
- {
- $this->_parent_node = $node;
- }
+ public function setParentNode(&$node)
+ {
+ $this->_parent_node = $node;
+ }
- function getId()
- {
- return($this->_id);
- }
+ public function getId()
+ {
+ return($this->_id);
+ }
- function getName()
- {
- return($this->_name);
- }
+ public function getName()
+ {
+ return($this->_name);
+ }
- function getNamespace()
- {
- return($this->_nmspc);
- }
+ public function getNamespace()
+ {
+ return($this->_nmspc);
+ }
- function getNamespaceAlias()
- {
- return($this->_nmspc_alias);
- }
+ public function getNamespaceAlias()
+ {
+ return($this->_nmspc_alias);
+ }
- function getContent()
- {
- return($this->_content);
- }
+ public function getContent()
+ {
+ return($this->_content);
+ }
- function getAttr($attr_nm)
- {
- if (isset($this->_attr_arr[$attr_nm])) {
- return($this->_attr_arr[$attr_nm]);
- } else {
- return(NULL);
- }
- }
+ public function getAttr($attr_nm)
+ {
+ if (isset($this->_attr_arr[$attr_nm])) {
+ return($this->_attr_arr[$attr_nm]);
+ } else {
+ return(null);
+ }
+ }
- function getAttrArr()
- {
- return($this->_attr_arr);
- }
+ public function getAttrArr()
+ {
+ return($this->_attr_arr);
+ }
- function getParentId()
- {
- return($this->parent_id);
- }
+ public function getParentId()
+ {
+ return($this->parent_id);
+ }
- function getParentNode()
- {
- return($this->_parent_node);
- }
+ public function getParentNode()
+ {
+ return($this->_parent_node);
+ }
- function getChild($id)
- {
- if (isset($this->_child_arr[$id])) {
- return($this->_child_arr[$id]);
- } else {
- return(FALSE);
- }
- }
+ public function getChild($id)
+ {
+ if (isset($this->_child_arr[$id])) {
+ return($this->_child_arr[$id]);
+ } else {
+ return(false);
+ }
+ }
- function getFirstChild()
- {
- $id_arr = array_keys($this->_child_arr);
- $num_child = count($id_arr);
+ public function getFirstChild()
+ {
+ $id_arr = array_keys($this->_child_arr);
+ $num_child = count($id_arr);
- if ($num_child > 0) {
- return($this->_child_arr[$id_arr[0]]);
- } else {
- return(FALSE);
- }
- }
+ if ($num_child > 0) {
+ return($this->_child_arr[$id_arr[0]]);
+ } else {
+ return(false);
+ }
+ }
- function getLastChild()
- {
- $id_arr = array_keys($this->_child_arr);
- $num_child = count($id_arr);
+ public function getLastChild()
+ {
+ $id_arr = array_keys($this->_child_arr);
+ $num_child = count($id_arr);
- if ($num_child > 0) {
- return($this->_child_arr[$id_arr[$num_child - 1]]);
- } else {
- return(FALSE);
- }
- }
+ if ($num_child > 0) {
+ return($this->_child_arr[$id_arr[$num_child - 1]]);
+ } else {
+ return(false);
+ }
+ }
- function getChildByIdx($idx)
- {
- $id_arr = array_keys($this->_child_arr);
+ public function getChildByIdx($idx)
+ {
+ $id_arr = array_keys($this->_child_arr);
- if (isset($this->_child_arr[$id_arr[$idx]])) {
- return($this->_child_arr[$id_arr[$idx]]);
- } else {
- return(FALSE);
- }
- }
+ if (isset($this->_child_arr[$id_arr[$idx]])) {
+ return($this->_child_arr[$id_arr[$idx]]);
+ } else {
+ return(false);
+ }
+ }
- function getNumChild()
- {
- return(count($this->_child_arr));
- }
+ public function getNumChild()
+ {
+ return(count($this->_child_arr));
+ }
- function removeChild($id)
- {
- unset($this->_child_arr[$id]);
- }
+ public function removeChild($id)
+ {
+ unset($this->_child_arr[$id]);
+ }
- function removeChildByIdx($idx)
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[$idx]]);
- }
+ public function removeChildByIdx($idx)
+ {
+ $key_arr = array_keys($this->_child_arr);
+ unset($this->_child_arr[$key_arr[$idx]]);
+ }
- function removeFirstChild()
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[0]]);
- }
+ public function removeFirstChild()
+ {
+ $key_arr = array_keys($this->_child_arr);
+ unset($this->_child_arr[$key_arr[0]]);
+ }
- function removeLastChild()
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[count($key_arr)-1]]);
- }
+ public function removeLastChild()
+ {
+ $key_arr = array_keys($this->_child_arr);
+ unset($this->_child_arr[$key_arr[count($key_arr)-1]]);
+ }
- function dumpXML($indent_str = "\t")
- {
- $attr_txt = $this->_dumpAttr();
- $name = $this->_dumpName();
- $xmlns = $this->_dumpXmlns();
- $lvl = $this->_getCurrentLevel();
- $indent = str_pad('',$lvl,$indent_str);
+ public function dumpXML($indent_str = "\t")
+ {
+ $attr_txt = $this->_dumpAttr();
+ $name = $this->_dumpName();
+ $xmlns = $this->_dumpXmlns();
+ $lvl = $this->_getCurrentLevel();
+ $indent = str_pad('',$lvl,$indent_str);
+
+
+ if ($this->_mt_elem_flg) {
+ $tag = "$indent<$name$xmlns$attr_txt />";
+ return($tag);
+ } else {
+ $num_child = 0;
+ if (!empty($this->_child_arr)) {
+ $key_arr = array_keys($this->_child_arr);
+
+ $num_child = count($key_arr);
+ }
+
+ $tag = "$indent<$name$xmlns$attr_txt>$this->_content";
- if ($this->_mt_elem_flg) {
- $tag = "$indent<$name$xmlns$attr_txt />";
- return($tag);
- } else {
- $key_arr = array_keys($this->_child_arr);
- $num_child = count($key_arr);
+ for ($i = 0;$i < $num_child; $i++) {
+ $node = $this->_child_arr[$key_arr[$i]];
+
+ //print_r($node);
+
+ $child_txt = $node->dumpXML($indent_str);
+ $tag .= "\n$child_txt";
+ }
- $tag = "$indent<$name$xmlns$attr_txt>$this->_content";
+ $tag .= ($num_child > 0 ? "\n$indent</$name>" : "</$name>");
+ return($tag);
+ }
+ }
+
+ public function _dumpAttr()
+ {
+ $attr_txt = '';
+ if (!empty($this->_attr_arr)) {
+ $id_arr = array_keys($this->_attr_arr);
+ $id_arr_cnt = count($id_arr);
+
+ for($i = 0;$i < $id_arr_cnt;$i++) {
+ $key = $id_arr[$i];
+ $attr_txt .= " $key=\"{$this->_attr_arr[$key]}\"";
+ }
+ }
+ return($attr_txt);
+ }
- for ($i = 0;$i < $num_child;$i++) {
- $node = $this->_child_arr[$key_arr[$i]];
+ public function _dumpName()
+ {
+ $alias = $this->getNamespaceAlias();
+ if ($alias == '') {
+ return($this->getName());
+ } else {
+ return("$alias:" . $this->getName());
+ }
+ }
- $child_txt = $node->dumpXML($indent_str);
- $tag .= "\n$child_txt";
- }
+ public function _dumpXmlns()
+ {
+ $nmspc = $this->getNamespace();
+ $alias = $this->getNamespaceAlias();
- $tag .= ($num_child > 0 ? "\n$indent</$name>" : "</$name>");
- return($tag);
- }
- }
+ if ($nmspc != '') {
+ if ($alias == '') {
+ return(" xmlns=\"" . $nmspc . "\"");
+ } else {
+ return(" xmlns:$alias=\"" . $nmspc . "\"");
+ }
+ } else {
+ return('');
+ }
+ }
- function _dumpAttr()
- {
- $id_arr = array_keys($this->_attr_arr);
- $id_arr_cnt = count($id_arr);
- $attr_txt = '';
-
- for($i = 0;$i < $id_arr_cnt;$i++) {
- $key = $id_arr[$i];
- $attr_txt .= " $key=\"{$this->_attr_arr[$key]}\"";
- }
-
- return($attr_txt);
- }
-
- function _dumpName()
- {
- $alias = $this->getNamespaceAlias();
- if ($alias == '') {
- return($this->getName());
- } else {
- return("$alias:" . $this->getName());
- }
- }
-
- function _dumpXmlns()
- {
- $nmspc = $this->getNamespace();
- $alias = $this->getNamespaceAlias();
-
- if ($nmspc != '') {
- if ($alias == '') {
- return(" xmlns=\"" . $nmspc . "\"");
- } else {
- return(" xmlns:$alias=\"" . $nmspc . "\"");
- }
- } else {
- return('');
- }
- }
-
- function _getCurrentLevel()
- {
- if ($this->_parent_id === FALSE) {
- return(0);
- } else {
- $node = $this->getParentNode();
- $lvl = $node->_getCurrentLevel();
- $lvl++;
- return($lvl);
- }
- }
+ public function _getCurrentLevel()
+ {
+ if ($this->_parent_id === false) {
+ return 0 ;
+ } else {
+ $node = $this->getParentNode();
+ if ($node != null) {
+ $lvl = $node->_getCurrentLevel();
+ $lvl++;
+ return($lvl);
+ } else {
+ return 0 ;
+ }
+ }
+ }
}
class MathMLNode extends XMLNode
{
- function MathMLNode($id = NULL)
- {
- parent::XMLNode($id);
- }
+ public function __construct($id = null)
+ {
+ parent::__construct($id);
+ }
- function removeBrackets()
- {
- if ($this->_name == 'mrow') {
- if ($c_node_0 = $this->getFirstChild()) {
- $c_node_0->isLeftBracket() ? $this->removeFirstChild() : 0;
- }
+ public function removeBrackets()
+ {
+ if ($this->_name == 'mrow') {
+ if ($c_node_0 = $this->getFirstChild()) {
+ $c_node_0->isLeftBracket() ? $this->removeFirstChild() : 0;
+ }
- if ($c_node_0 = $this->getLastChild()) {
- $c_node_0->isRightBracket() ? $this->removeLastChild() : 0;
- }
- }
- }
+ if ($c_node_0 = $this->getLastChild()) {
+ $c_node_0->isRightBracket() ? $this->removeLastChild() : 0;
+ }
+ }
+ }
- function isLeftBracket()
- {
- switch ($this->_content) {
- case '{':
- case '[':
- case '(':
- return(TRUE);
- break;
- }
- return(FALSE);
- }
+ public function isLeftBracket()
+ {
+ switch ($this->_content) {
+ case '{':
+ case '[':
+ case '(':
+ return(true);
+ break;
+ }
+ return(false);
+ }
- function isRightBracket()
- {
- switch ($this->_content) {
- case '}':
- case ']':
- case ')':
- return(TRUE);
- break;
- }
- return(FALSE);
- }
+ public function isRightBracket()
+ {
+ switch ($this->_content) {
+ case '}':
+ case ']':
+ case ')':
+ return(true);
+ break;
+ }
+ return(false);
+ }
}
class ASCIIMathPHP
{
- var $_expr;
- var $_curr_expr;
- var $_prev_expr;
- var $_symbol_arr;
- var $_node_arr;
- var $_node_cntr;
+ protected $_expr;
+ protected $_curr_expr;
+ protected $_prev_expr;
+ protected $_symbol_arr;
+ protected $_node_arr;
+ protected $_node_cntr;
- function ASCIIMathPHP($symbol_arr,$expr = NULL)
- {
- $this->_symbol_arr = $symbol_arr;
- if (isset($expr)) {
- $this->setExpr($expr);
- }
- }
+ public function __construct($symbol_arr, $expr = null) {
+ $this->_symbol_arr = $symbol_arr;
+ if (isset($expr)) {
+ $this->setExpr($expr);
+ }
+ }
- /**
- * Returns an empty node (containing a non-breaking space) 26-Apr-2006
- *
- * Used when an expression is incomplete
- *
- * @return object
- *
- * @access private
- */
- function emptyNode()
- {
- $tmp_node = $this->createNode();
- $tmp_node->setName('mn');
- $tmp_node->setContent('&#' . hexdec('200B') . ';');
- return $tmp_node;
- }
+ /**
+ * Returns an empty node (containing a non-breaking space) 26-Apr-2006
+ *
+ * Used when an expression is incomplete
+ *
+ * @return object
+ *
+ * @access private
+ */
+ public function emptyNode()
+ {
+ $tmp_node = $this->createNode();
+ $tmp_node->setName('mn');
+ $tmp_node->setContent('&#' . hexdec('200B') . ';');
+ return $tmp_node;
+ }
- function pushExpr($prefix) // 2005-06-11 wes
- {
- $this->_curr_expr = $prefix . $this->_curr_expr;
- }
+ public function pushExpr($prefix) // 2005-06-11 wes
+ {
+ $this->_curr_expr = $prefix . $this->_curr_expr;
+ }
- function setExpr($expr)
- {
- $this->_expr = $expr;
- $this->_curr_expr = $expr;
- $this->_prev_expr = $expr;
+ public function setExpr($expr)
+ {
+ $this->_expr = $expr;
+ $this->_curr_expr = $expr;
+ $this->_prev_expr = $expr;
- $this->_node_arr = array();
- $this->_node_cntr = 0;
- }
+ $this->_node_arr = array();
+ $this->_node_cntr = 0;
+ }
- function genMathML($attr_arr = NULL)
- {
- // <math> node
- $node_0 = $this->createNode();
- $node_0->setName('math');
- $node_0->setNamepace('http://www.w3.org/1998/Math/MathML');
+ public function genMathML($attr_arr = null)
+ {
+ // <math> node
+ $node_0 = $this->createNode();
+ $node_0->setName('math');
+ $node_0->setNamepace('http://www.w3.org/1998/Math/MathML');
- // <mstyle> node
- if (isset($attr_arr)) {
- $node_1 = $this->createNode();
- $node_1->setName('mstyle');
- $node_1->setAttrArr($attr_arr);
+ // <mstyle> node
+ if (isset($attr_arr)) {
+ $node_1 = $this->createNode();
+ $node_1->setName('mstyle');
+ $node_1->setAttrArr($attr_arr);
- $node_arr = $this->parseExpr();
+ $node_arr = $this->parseExpr();
- $node_1->addChildArr($node_arr);
- $node_0->addChild($node_1);
- } else {
- $node_arr = $this->parseExpr();
- $node_0->addCh...
[truncated message content] |