Index: trunk/extensions/Math/math/lexer.mll |
— | — | @@ -13,6 +13,8 @@ |
14 | 14 | let delimiter_uf_op = ['/' '|'] |
15 | 15 | let boxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' ' ' '\128'-'\255'] |
16 | 16 | let aboxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' ' '] |
| 17 | +let latex_function_names = "arccos"| "arcsin" | "arctan" | "arg" | "cos" | "cosh" | "cot" | "coth" | "csc"| "deg" | "det" | "dim" | "exp" | "gcd" | "hom" | "inf" | "ker" | "lg" | "lim" | "liminf" | "limsup" | "ln" | "log" | "max" | "min" | "Pr" | "sec" | "sin" | "sinh" | "sup" | "tan" | "tanh" |
| 18 | +let mediawiki_function_names = "arccot" | "arcsec" | "arccsc" | "sgn" | "sen" |
17 | 19 | |
18 | 20 | rule token = parse |
19 | 21 | space + { token lexbuf } |
— | — | @@ -58,6 +60,14 @@ |
59 | 61 | | "\\sqrt" space * "[" { FUN_AR1opt "\\sqrt" } |
60 | 62 | | "\\xleftarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xleftarrow" } |
61 | 63 | | "\\xrightarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xrightarrow" } |
| 64 | + | "\\" (latex_function_names as name) space * "(" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "(", name ^ "(")) } |
| 65 | + | "\\" (latex_function_names as name) space * "[" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "[", name ^ "[")) } |
| 66 | + | "\\" (latex_function_names as name) space * "\\{" { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name ^ "\\{", name ^ "{")) } |
| 67 | + | "\\" (latex_function_names as name) space * { LITERAL (HTMLABLEC(FONT_UFH,"\\" ^ name, name ^ " ")) } |
| 68 | + | "\\" (mediawiki_function_names as name) space * "(" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}(", name^ "("))) } |
| 69 | + | "\\" (mediawiki_function_names as name) space * "[" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}[", name^ "["))) } |
| 70 | + | "\\" (mediawiki_function_names as name) space * "\\{" { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}\\{", name^ "{"))) } |
| 71 | + | "\\" (mediawiki_function_names as name) space * { (Texutil.tex_use_ams(); LITERAL (HTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}", name ^ " "))) } |
62 | 72 | | "\\," { LITERAL (HTMLABLE (FONT_UF, "\\,"," ")) } |
63 | 73 | | "\\ " { LITERAL (HTMLABLE (FONT_UF, "\\ "," ")) } |
64 | 74 | | "\\;" { LITERAL (HTMLABLE (FONT_UF, "\\;"," ")) } |
Index: trunk/extensions/Math/math/texutil.ml |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | | TEX_DQN (a) -> "_{" ^ (render_tex a) ^ "}" |
22 | 22 | | TEX_UQN (a) -> "^{" ^ (render_tex a) ^ "}" |
23 | 23 | | TEX_LITERAL s -> tex_part s |
24 | | - | TEX_FUN1 (f,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
| 24 | + | TEX_FUN1 (f,a) -> f ^ " " ^ (render_tex a) |
25 | 25 | | TEX_FUN1hl (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
26 | 26 | | TEX_FUN1hf (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
27 | 27 | | TEX_DECLh (f,_,a) -> "{" ^ f ^ "{" ^ (mapjoin render_tex a) ^ "}}" |