Index: trunk/extensions/ParserPlayground/modules/ext.parserPlayground.pegParser.js |
— | — | @@ -9,8 +9,8 @@ |
10 | 10 | * to point at the MW page name containing the parser peg definition; default |
11 | 11 | * is 'MediaWiki:Gadget-ParserPlayground-PegParser.pegjs'. |
12 | 12 | */ |
13 | | -function PegParser(options) { |
14 | | - this.options = options; |
| 13 | +function PegParser(env) { |
| 14 | + this.env = env || {}; |
15 | 15 | } |
16 | 16 | |
17 | 17 | PegParser.src = false; |
— | — | @@ -34,8 +34,58 @@ |
35 | 35 | * @param {function(tree, error)} callback |
36 | 36 | */ |
37 | 37 | PegParser.prototype.expandTree = function(tree, callback) { |
38 | | - // no-op! |
39 | | - callback(tree, null); |
| 38 | + var self = this; |
| 39 | + var subParseArray = function(listOfTrees) { |
| 40 | + var content = []; |
| 41 | + $.each(listOfTrees, function(i, subtree) { |
| 42 | + self.expandTree(subtree, function(substr, err) { |
| 43 | + content.push(tree); |
| 44 | + }); |
| 45 | + }); |
| 46 | + return content; |
| 47 | + }; |
| 48 | + var src; |
| 49 | + if (typeof tree === "string") { |
| 50 | + callback(tree); |
| 51 | + return; |
| 52 | + } |
| 53 | + if (tree.type == 'template') { |
| 54 | + // expand a template node! |
| 55 | + |
| 56 | + // Resolve a possibly relative link |
| 57 | + var templateName = this.env.resolveTitle( tree.target, 'Template' ); |
| 58 | + this.env.fetchTemplate( tree.target, tree.params || {}, function( templateSrc, error ) { |
| 59 | + // @fixme should pre-parse/cache these too? |
| 60 | + self.parseToTree( templateSrc, function( templateTree, error ) { |
| 61 | + if ( error ) { |
| 62 | + callback({ |
| 63 | + type: 'placeholder', |
| 64 | + orig: tree, |
| 65 | + content: [ |
| 66 | + { |
| 67 | + // @fixme broken link? |
| 68 | + type: 'link', |
| 69 | + target: templateName |
| 70 | + } |
| 71 | + ] |
| 72 | + }); |
| 73 | + } else { |
| 74 | + callback({ |
| 75 | + type: 'placeholder', |
| 76 | + orig: tree, |
| 77 | + content: self.env.expandTemplateArgs( templateTree, tree.params ) |
| 78 | + }); |
| 79 | + } |
| 80 | + }) |
| 81 | + } ); |
| 82 | + // Wait for async... |
| 83 | + return; |
| 84 | + } |
| 85 | + var out = $.extend( tree ); // @fixme prefer a deep copy? |
| 86 | + if (tree.content) { |
| 87 | + out.content = subParseArray(tree.content); |
| 88 | + } |
| 89 | + callback(out); |
40 | 90 | }; |
41 | 91 | |
42 | 92 | PegParser.prototype.initSource = function(callback) { |
Index: trunk/extensions/ParserPlayground/modules/mediawiki.parser.environment.js |
— | — | @@ -1,7 +1,8 @@ |
2 | 2 | var MWParserEnvironment = function(opts) { |
3 | 3 | var options = { |
4 | 4 | tagHooks: {}, |
5 | | - parserFunctions: {} |
| 5 | + parserFunctions: {}, |
| 6 | + pageCache: {} // @fixme use something with managed space |
6 | 7 | }; |
7 | 8 | $.extend(options, opts); |
8 | 9 | this.tagHooks = options.tagHooks; |
— | — | @@ -38,12 +39,323 @@ |
39 | 40 | } else { |
40 | 41 | return null; |
41 | 42 | } |
| 43 | + }, |
| 44 | + |
| 45 | + /** |
| 46 | + * @fixme do this for real eh |
| 47 | + */ |
| 48 | + resolveTitle: function( name, namespace ) { |
| 49 | + // hack! |
| 50 | + if (name.indexOf(':') == 0 && typeof namespace ) { |
| 51 | + // hack hack hack |
| 52 | + name = namespace + ':' + name; |
| 53 | + } |
| 54 | + return name; |
| 55 | + }, |
| 56 | + |
| 57 | + /** |
| 58 | + * Async. |
| 59 | + * |
| 60 | + * @todo make some optimizations for fetching multiple at once |
| 61 | + * |
| 62 | + * @param string name |
| 63 | + * @param function(text, err) callback |
| 64 | + */ |
| 65 | + fetchTemplate: function( title, callback ) { |
| 66 | + this.fetchTemplateAndTitle( title, function( text, title, err ) { |
| 67 | + callback(title, err); |
| 68 | + }); |
| 69 | + }, |
| 70 | + |
| 71 | + fetchTemplateAndTitle: function( title, callback ) { |
| 72 | + // @fixme normalize name? |
| 73 | + if (title in this.pageCache) { |
| 74 | + // @fixme should this be forced to run on next event? |
| 75 | + callback( this.pageCache[title] ); |
| 76 | + } else { |
| 77 | + // whee fun hack! |
| 78 | + $.ajax({ |
| 79 | + url: wgScriptPath + '/api' + wgScriptExtension, |
| 80 | + data: { |
| 81 | + format: 'json', |
| 82 | + action: 'query', |
| 83 | + prop: 'revisions', |
| 84 | + rvprop: 'content', |
| 85 | + titles: name |
| 86 | + }, |
| 87 | + success: function(data, xhr) { |
| 88 | + var src = null, title = null; |
| 89 | + $.each(data.query.pages, function(i, page) { |
| 90 | + if (page.revisions && page.revisions.length) { |
| 91 | + src = page.revisions[0]['*']; |
| 92 | + title = page.title; |
| 93 | + } |
| 94 | + }); |
| 95 | + if (typeof src !== 'string') { |
| 96 | + callback(null, null, 'Page not found'); |
| 97 | + } else { |
| 98 | + callback(src, title); |
| 99 | + } |
| 100 | + }, |
| 101 | + error: function(msg) { |
| 102 | + callback(null, null, 'Page/template fetch failure'); |
| 103 | + }, |
| 104 | + dataType: 'json', |
| 105 | + cache: false // @fixme caching, versions etc? |
| 106 | + }, 'json'); |
| 107 | + } |
| 108 | + }, |
| 109 | + |
| 110 | + getTemplateDom: function( title, callback ) { |
| 111 | + var self = this; |
| 112 | + this.fetchTemplateAndTitle( title, function( text, title, err ) { |
| 113 | + if (err) { |
| 114 | + callback(null, err); |
| 115 | + return; |
| 116 | + } |
| 117 | + self.pageCache[title] = text; |
| 118 | + self.parser.parseToTree( text, function( templateTree, err ) { |
| 119 | + // @fixme cache these too :) |
| 120 | + callback(templateTree, err); |
| 121 | + }); |
| 122 | + }); |
| 123 | + }, |
| 124 | + |
| 125 | + braceSubstitution: function( templateNode, frame, callback ) { |
| 126 | + // stuff in Parser.braceSubstitution |
| 127 | + // expand/flatten the 'title' piece (to get the template reference) |
| 128 | + frame.flatten(templateNode.name, function(templateName, err) { |
| 129 | + if (err) { |
| 130 | + callback(null, err); |
| 131 | + return; |
| 132 | + } |
| 133 | + var out = { |
| 134 | + type: 'placeholder', |
| 135 | + orig: templateNode, |
| 136 | + contents: [] |
| 137 | + }; |
| 138 | + |
| 139 | + // check for 'subst:' |
| 140 | + // check for variable magic names |
| 141 | + // check for msg, msgnw, raw magics |
| 142 | + // check for parser functions |
| 143 | + |
| 144 | + // resolve template name |
| 145 | + // load template w/ canonical name |
| 146 | + // load template w/ variant names |
| 147 | + // recursion depth check |
| 148 | + // fetch from DB or interwiki |
| 149 | + // infinte loop check |
| 150 | + this.getTemplateDom(templateName, function(dom, err) { |
| 151 | + // Expand in-place! |
| 152 | + var templateFrame = frame.newChild(templateName.params || []); |
| 153 | + templateFrame.expand(dom, 0, function(expandedTemplateNode) { |
| 154 | + out.contents = expandedTemplateNode.contents; |
| 155 | + callback(out); |
| 156 | + return; // done |
| 157 | + }); |
| 158 | + return; // wait for async |
| 159 | + }); |
| 160 | + }); |
| 161 | + }, |
| 162 | + |
| 163 | + argSubstitution: function( argNode, frame, callback ) { |
| 164 | + frame.flatten(argNode.name, function(argName, err) { |
| 165 | + if (err) { |
| 166 | + callback(null, err); |
| 167 | + return; |
| 168 | + } |
| 169 | + |
| 170 | + var arg = frame.getArgument(argName); |
| 171 | + if (arg === false && 'params' in argNode && argNode.params.length) { |
| 172 | + // No match in frame, use the supplied default |
| 173 | + arg = argNode.params[0].val; |
| 174 | + } |
| 175 | + var out = { |
| 176 | + type: 'placeholder', |
| 177 | + orig: argNode, |
| 178 | + contents: [arg] |
| 179 | + }; |
| 180 | + callback(out); |
| 181 | + }); |
42 | 182 | } |
43 | | - |
| 183 | + |
| 184 | + |
44 | 185 | }); |
45 | 186 | |
| 187 | +function PPFrame(env) { |
| 188 | + this.env = env; |
| 189 | + this.loopCheckHash = []; |
| 190 | + this.depth = 0; |
| 191 | +} |
46 | 192 | |
| 193 | +// Flag constants |
| 194 | +$.extend(PPFrame, { |
| 195 | + NO_ARGS: 1, |
| 196 | + NO_TEMPLATES: 2, |
| 197 | + STRIP_COMMENTS: 4, |
| 198 | + NO_IGNORE: 8, |
| 199 | + RECOVER_COMMENTS: 16 |
| 200 | +}); |
| 201 | +PPFrame.RECOVER_ORIG = PPFrame.NO_ARGS |
| 202 | + | PPFrame.NO_TEMPLATES |
| 203 | + | PPFrame.STRIP_COMMENTS |
| 204 | + | PPFrame.NO_IGNORE |
| 205 | + | PPFrame.RECOVER_COMMENTS; |
47 | 206 | |
| 207 | +$.extend(PPFrame.prototype, { |
| 208 | + newChild: function(args, title) { |
| 209 | + // |
| 210 | + }, |
| 211 | + |
| 212 | + /** |
| 213 | + * Using simple recursion for now -- PHP version is a little fancier |
| 214 | + * @param {object} tree |
| 215 | + * @param {number} flags |
| 216 | + * @param {function(tree, error)} callback |
| 217 | + */ |
| 218 | + expand: function(root, flags, callback) { |
| 219 | + var self = this, |
| 220 | + expansionDepth = 0, |
| 221 | + outStack = [Array(), Array()], |
| 222 | + iteratorStack = [false, root], |
| 223 | + indexStack = [0, 0], |
| 224 | + contextNode = false, |
| 225 | + newIterator = false; |
| 226 | + |
| 227 | + var iteration = function() { |
| 228 | + var level = outStack.length - 1, |
| 229 | + iteratorNode = iteratorStack[level], |
| 230 | + out = outStack[level], |
| 231 | + index = indexStack[level]; // ???? |
| 232 | + |
| 233 | + if ($.isArray(iteratorNode)) { |
| 234 | + if (index >= iteratorNode.length) { |
| 235 | + // All done with this iterator. |
| 236 | + iteratorStack[level] = false; |
| 237 | + contextNode = false; |
| 238 | + } else { |
| 239 | + contextNode = iteratorNode[index]; |
| 240 | + indexStack[level]++; |
| 241 | + } |
| 242 | + } else { |
| 243 | + // Copy to contextNode and then delete from iterator stack, |
| 244 | + // because this is not an iterator but we do have to execute it once |
| 245 | + contextNode = iteratorStack[level]; |
| 246 | + iteratorStack[level] = false; |
| 247 | + } |
| 248 | + |
| 249 | + if (contextNode === false) { |
| 250 | + // nothing to do |
| 251 | + } else if (typeof contextNode === 'string') { |
| 252 | + out.push(contextNode); |
| 253 | + } else if (contextNode.type === 'template') { |
| 254 | + // Double-brace expansion |
| 255 | + self.env.braceSubstitution(contextNode, self, function(replacementNode, err) { |
| 256 | + out.push(replacementNode); |
| 257 | + // ... and continue on the next node! |
| 258 | + iteration(); |
| 259 | + }); |
| 260 | + } else if (contextNode.type == 'tplarg') { |
| 261 | + // Triple-brace expansion |
| 262 | + self.env.argSubstitution(contextNode, self, function(replacementNode, err) { |
| 263 | + out.push(replacementNode); |
| 264 | + // ... and continue on the next node! |
| 265 | + iteration(); |
| 266 | + }); |
| 267 | + } else if (contextNode.type === 'comment') { |
| 268 | + // HTML-style comment |
| 269 | + } else if (contextNode.type === 'ignore') { |
| 270 | + // |
| 271 | + } else if (contextNode.type === 'ext') { |
| 272 | + // |
| 273 | + } else if (contextNode.type === 'h') { |
| 274 | + // |
| 275 | + } else { |
| 276 | + if ('content' in contextNode) { |
| 277 | + newIterator = contextNode.content; |
| 278 | + } |
| 279 | + } |
| 280 | + |
| 281 | + if (newIterator !== false) { |
| 282 | + outStack.push([]); |
| 283 | + iteratorStack.push(newIterator); |
| 284 | + indexStack.push(0); |
| 285 | + } else if ( iteratorStack[level] === false) { |
| 286 | + // Return accumulated value to parent |
| 287 | + // With tail recursion |
| 288 | + while (iteratorStack[level] === false && level > 0) { |
| 289 | + outStack[level - 1]; |
| 290 | + } |
| 291 | + } |
| 292 | + }; |
| 293 | + iteration(); |
| 294 | + |
| 295 | + if (typeof tree === "string") { |
| 296 | + callback(tree); |
| 297 | + return; |
| 298 | + } |
| 299 | + if (tree.type == 'template') { |
| 300 | + // expand a template node! |
| 301 | + // Resolve a possibly relative link |
| 302 | + } |
| 303 | + if (tree.type == 'tplarg') { |
| 304 | + |
| 305 | + } |
| 306 | + var out = $.extend( tree ); // @fixme prefer a deep copy? |
| 307 | + if (tree.content) { |
| 308 | + out.content = subParseArray(tree.content); |
| 309 | + } |
| 310 | + callback(out); |
| 311 | + }, |
| 312 | + |
| 313 | + implodeWithFlags: function(sep, flags) { |
| 314 | + |
| 315 | + }, |
| 316 | + |
| 317 | + implode: function(sep) { |
| 318 | + |
| 319 | + }, |
| 320 | + |
| 321 | + virtualImport: function(sep) { |
| 322 | + |
| 323 | + }, |
| 324 | + |
| 325 | + virtualBracketedImplode: function(start, sep, end /*, ... */ ) { |
| 326 | + |
| 327 | + }, |
| 328 | + |
| 329 | + isEmpty: function() { |
| 330 | + |
| 331 | + }, |
| 332 | + |
| 333 | + getArguments: function() { |
| 334 | + |
| 335 | + }, |
| 336 | + |
| 337 | + getNumberedArguments: function() { |
| 338 | + |
| 339 | + }, |
| 340 | + |
| 341 | + getNamedArguments: function() { |
| 342 | + |
| 343 | + }, |
| 344 | + |
| 345 | + getArgument: function( name ) { |
| 346 | + |
| 347 | + }, |
| 348 | + |
| 349 | + loopCheck: function(title) { |
| 350 | + }, |
| 351 | + |
| 352 | + isTemplate: function() { |
| 353 | + |
| 354 | + } |
| 355 | + |
| 356 | +}); |
| 357 | + |
| 358 | + |
| 359 | + |
48 | 360 | /** |
49 | 361 | * @parm MWParserEnvironment env |
50 | 362 | * @constructor |
Index: trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt |
— | — | @@ -174,6 +174,17 @@ |
175 | 175 | }; |
176 | 176 | } |
177 | 177 | |
| 178 | +tplarg = "{{{" name:link_target params:("|" p:template_param { return p })* "}}}" { |
| 179 | + var obj = { |
| 180 | + type: 'tplarg', |
| 181 | + name: name |
| 182 | + }; |
| 183 | + if (params && params.length) { |
| 184 | + obj.params = params; |
| 185 | + } |
| 186 | + return obj; |
| 187 | +} |
| 188 | + |
178 | 189 | template_param_name |
179 | 190 | = h:( !"}}" x:([^=|]) { return x } )* { return h.join(''); } |
180 | 191 | |
Index: trunk/extensions/Math/math/mathml.ml |
— | — | @@ -1,15 +1,13 @@ |
2 | 2 | open Tex |
3 | 3 | open Render_info |
4 | 4 | |
5 | | -type t = TREE_MN of string | TREE_MO of string | TREE_MI of string | TREE_MF of string | TREE_MFB of string * string |
| 5 | +type t = TREE_MN of string | TREE_MO of string | TREE_MI of string |
6 | 6 | |
7 | 7 | let rec make_mathml_tree = function |
8 | 8 | TREE_MN a::otr,TEX_LITERAL(MHTMLABLEC(_,_,_,MN,b))::itr -> make_mathml_tree(TREE_MN (a^b)::otr,itr) |
9 | 9 | | otr,TEX_LITERAL(MHTMLABLEC(_,_,_,MN,a))::itr -> make_mathml_tree(TREE_MN a::otr,itr) |
10 | 10 | | otr,TEX_LITERAL(MHTMLABLEC(_,_,_,MO,a))::itr -> make_mathml_tree(TREE_MO a::otr,itr) |
11 | 11 | | otr,TEX_LITERAL(MHTMLABLEC(_,_,_,MI,a))::itr -> make_mathml_tree(TREE_MI a::otr,itr) |
12 | | - | otr,TEX_LITERAL(MHTMLABLEC(_,_,_,MF,a))::itr -> make_mathml_tree(TREE_MF a::otr,itr) |
13 | | - | otr,TEX_LITERAL(MHTMLABLEFC(_,_,_,MF,a,b))::itr -> make_mathml_tree(TREE_MFB (a,b)::otr,itr) |
14 | 12 | | otr,TEX_CURLY(crl)::itr -> make_mathml_tree(otr,crl@itr) |
15 | 13 | | otr,[] -> List.rev otr |
16 | 14 | | _ -> failwith "failed to render mathml" |
— | — | @@ -18,7 +16,5 @@ |
19 | 17 | TREE_MN s -> "<mn>"^s^"</mn>" |
20 | 18 | | TREE_MI s -> "<mi>"^s^"</mi>" |
21 | 19 | | TREE_MO s -> "<mo>"^s^"</mo>" |
22 | | - | TREE_MF s -> "<mi>"^s^" </mi>" |
23 | | - | TREE_MFB (s,b) -> "<mi>"^s^"</mi>"^"<mo>"^b^"</mo>" |
24 | 20 | |
25 | 21 | let render tree = try Some (Util.mapjoin render_mathml_tree (make_mathml_tree ([],tree))) with _ -> None |
Index: trunk/extensions/Math/math/parser.mly |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | open Tex |
4 | 4 | open Render_info |
5 | 5 | |
6 | | - let sq_close_ri = MHTMLABLEC(FONT_UFH,"]", "]",MO,"]") |
| 6 | + let sq_close_ri = HTMLABLEC(FONT_UFH,"]", "]") |
7 | 7 | %} |
8 | 8 | %token <Render_info.t> LITERAL DELIMITER |
9 | 9 | %token <string> FUN_AR2 FUN_INFIX FUN_AR1 DECL FUN_AR1opt BIG FUN_AR2nb |
Index: trunk/extensions/Math/math/lexer.mll |
— | — | @@ -6,15 +6,13 @@ |
7 | 7 | let space = [' ' '\t' '\n' '\r'] |
8 | 8 | let alpha = ['a'-'z' 'A'-'Z'] |
9 | 9 | let literal_id = ['a'-'z' 'A'-'Z'] |
10 | | -let literal_mn = ['0'-'9' '.'] |
| 10 | +let literal_mn = ['0'-'9'] |
11 | 11 | let literal_uf_lt = [',' ':' ';' '?' '!' '\''] |
12 | | -let delimiter_uf_lt = ['(' ')'] |
| 12 | +let delimiter_uf_lt = ['(' ')' '.'] |
13 | 13 | let literal_uf_op = ['+' '-' '*' '='] |
14 | 14 | let delimiter_uf_op = ['/' '|'] |
15 | | -let boxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' '\'' '`' ' ' '\128'-'\255'] |
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" |
| 15 | +let boxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' ' ' '\128'-'\255'] |
| 16 | +let aboxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' ' '] |
19 | 17 | |
20 | 18 | rule token = parse |
21 | 19 | space + { token lexbuf } |
— | — | @@ -52,39 +50,20 @@ |
53 | 51 | | literal_id { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_IT, str,str,MI,str)) } |
54 | 52 | | literal_mn { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_RM, str,str,MN,str)) } |
55 | 53 | | literal_uf_lt { let str = Lexing.lexeme lexbuf in LITERAL (HTMLABLEC (FONT_UFH, str,str)) } |
56 | | - | delimiter_uf_lt { let str = Lexing.lexeme lexbuf in DELIMITER (MHTMLABLEC (FONT_UFH, str,str,MO,str)) } |
57 | | - | "-" { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH,"-"," − ",MO," − "))} |
58 | | - | literal_uf_op { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO," "^str^" ")) } |
| 54 | + | delimiter_uf_lt { let str = Lexing.lexeme lexbuf in DELIMITER (HTMLABLEC (FONT_UFH, str,str)) } |
| 55 | + | "-" { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH,"-"," − ",MO,str))} |
| 56 | + | literal_uf_op { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) } |
59 | 57 | | delimiter_uf_op { let str = Lexing.lexeme lexbuf in DELIMITER (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) } |
| 58 | + | "\\" alpha + { Texutil.find (Lexing.lexeme lexbuf) } |
60 | 59 | | "\\sqrt" space * "[" { FUN_AR1opt "\\sqrt" } |
61 | 60 | | "\\xleftarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xleftarrow" } |
62 | 61 | | "\\xrightarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xrightarrow" } |
63 | | - | "\\" (latex_function_names as name) space * "(" |
64 | | - { LITERAL (MHTMLABLEFC(FONT_UFH,"\\" ^ name ^ "(", name ^ "(", MF, name, "(")) } |
65 | | - | "\\" (latex_function_names as name) space * "[" |
66 | | - { LITERAL (MHTMLABLEFC(FONT_UFH,"\\" ^ name ^ "[", name ^ "[", MF, name, "[")) } |
67 | | - | "\\" (latex_function_names as name) space * "\\{" |
68 | | - { LITERAL (MHTMLABLEFC(FONT_UFH, "\\" ^ name ^ "\\{", name ^ "{", MF, name, "{")) } |
69 | | - | "\\" (latex_function_names as name) space * |
70 | | - { LITERAL (MHTMLABLEC(FONT_UFH,"\\" ^ name ^ " ", name ^ " ", MF, name)) } |
71 | | - | "\\" (mediawiki_function_names as name) space * "(" |
72 | | - { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEFC(FONT_UFH, |
73 | | - "\\operatorname{" ^ name ^ "}(", name ^ "(", MF, name, "("))) } |
74 | | - | "\\" (mediawiki_function_names as name) space * "[" |
75 | | - { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEFC(FONT_UFH, |
76 | | - "\\operatorname{" ^ name ^ "}[", name ^ "[", MF, name, "["))) } |
77 | | - | "\\" (mediawiki_function_names as name) space * "\\{" |
78 | | - { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEFC(FONT_UFH, |
79 | | - "\\operatorname{" ^ name ^ "}\\{", name ^ "{", MF, name, "{"))) } |
80 | | - | "\\" (mediawiki_function_names as name) space * |
81 | | - { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "} ", name ^ " ", MF, name))) } |
82 | | - | "\\" alpha + { Texutil.find (Lexing.lexeme lexbuf) } |
83 | 62 | | "\\," { LITERAL (HTMLABLE (FONT_UF, "\\,"," ")) } |
84 | 63 | | "\\ " { LITERAL (HTMLABLE (FONT_UF, "\\ "," ")) } |
85 | 64 | | "\\;" { LITERAL (HTMLABLE (FONT_UF, "\\;"," ")) } |
86 | 65 | | "\\!" { LITERAL (TEX_ONLY "\\!") } |
87 | | - | "\\{" { DELIMITER (MHTMLABLEC(FONT_UFH,"\\{","{",MO,"{")) } |
88 | | - | "\\}" { DELIMITER (MHTMLABLEC(FONT_UFH,"\\}","}",MO,"}")) } |
| 66 | + | "\\{" { DELIMITER (HTMLABLEC(FONT_UFH,"\\{","{")) } |
| 67 | + | "\\}" { DELIMITER (HTMLABLEC(FONT_UFH,"\\}","}")) } |
89 | 68 | | "\\|" { DELIMITER (HTMLABLE (FONT_UFH,"\\|","||")) } |
90 | 69 | | "\\_" { LITERAL (HTMLABLEC(FONT_UFH,"\\_","_")) } |
91 | 70 | | "\\#" { LITERAL (HTMLABLE (FONT_UFH,"\\#","#")) } |
— | — | @@ -120,7 +99,7 @@ |
121 | 100 | | '%' { LITERAL (HTMLABLEC(FONT_UFH,"\\%","%")) } |
122 | 101 | | '$' { LITERAL (HTMLABLEC(FONT_UFH,"\\$","$")) } |
123 | 102 | | '~' { LITERAL (HTMLABLE (FONT_UF, "~"," ")) } |
124 | | - | '[' { DELIMITER (MHTMLABLEC(FONT_UFH,"[","[",MO,"[")) } |
| 103 | + | '[' { DELIMITER (HTMLABLEC(FONT_UFH,"[","[")) } |
125 | 104 | | ']' { SQ_CLOSE } |
126 | 105 | | '{' { CURLY_OPEN } |
127 | 106 | | '}' { CURLY_CLOSE } |
Index: trunk/extensions/Math/math/texutil.ml |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | | HTMLABLEM (_,t,_) -> t |
11 | 11 | | HTMLABLEC (_,t,_) -> t |
12 | 12 | | MHTMLABLEC (_,t,_,_,_) -> t |
13 | | - | MHTMLABLEFC (_,t,_,_,_,_) -> t |
14 | 13 | | HTMLABLE_BIG (t,_) -> t |
15 | 14 | | TEX_ONLY t -> t |
16 | 15 | |
— | — | @@ -21,7 +20,7 @@ |
22 | 21 | | TEX_DQN (a) -> "_{" ^ (render_tex a) ^ "}" |
23 | 22 | | TEX_UQN (a) -> "^{" ^ (render_tex a) ^ "}" |
24 | 23 | | TEX_LITERAL s -> tex_part s |
25 | | - | TEX_FUN1 (f,a) -> f ^ " " ^ (render_tex a) |
| 24 | + | TEX_FUN1 (f,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
26 | 25 | | TEX_FUN1hl (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
27 | 26 | | TEX_FUN1hf (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
28 | 27 | | TEX_DECLh (f,_,a) -> "{" ^ f ^ "{" ^ (mapjoin render_tex a) ^ "}}" |
— | — | @@ -46,22 +45,16 @@ |
47 | 46 | let modules_nonascii = ref false |
48 | 47 | let modules_encoding = ref UTF8 |
49 | 48 | let modules_color = ref false |
50 | | -let modules_teubner = ref false |
51 | | -let modules_euro = ref false |
52 | 49 | |
53 | 50 | (* wrappers to easily set / reset module properties *) |
54 | 51 | let tex_use_ams () = modules_ams := true |
55 | 52 | let tex_use_nonascii () = modules_nonascii := true |
56 | 53 | let tex_use_color () = modules_color := true |
57 | | -let tex_use_teubner () = modules_teubner := true |
58 | | -let tex_use_euro () = modules_euro := true |
59 | 54 | let tex_mod_reset () = ( |
60 | 55 | modules_ams := false; |
61 | 56 | modules_nonascii := false; |
62 | 57 | modules_encoding := UTF8; |
63 | | - modules_color := false; |
64 | | - modules_teubner := false; |
65 | | - modules_euro := false; |
| 58 | + modules_color := false |
66 | 59 | ) |
67 | 60 | |
68 | 61 | (* Return TeX fragment for one of the encodings in (UTF8,LATIN1,LATIN2) *) |
— | — | @@ -75,8 +68,6 @@ |
76 | 69 | (if !modules_nonascii then get_encoding !modules_encoding else "") ^ |
77 | 70 | (if !modules_ams then "\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n" else "") ^ |
78 | 71 | (if !modules_color then "\\usepackage[dvips,usenames]{color}\n" else "") ^ |
79 | | - (if !modules_teubner then "\\usepackage[greek]{babel}\n\\usepackage{teubner}\n" else "") ^ |
80 | | - (if !modules_euro then "\\usepackage{eurosym}\n" else "") ^ |
81 | 72 | "\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n" |
82 | 73 | |
83 | 74 | (* TeX fragment appended after the content *) |
— | — | @@ -106,7 +97,7 @@ |
107 | 98 | | "\\epsilon" -> LITERAL (TEX_ONLY "\\epsilon ") |
108 | 99 | | "\\Epsilon" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
109 | 100 | "\\mathrm{E}", "Ε"))) |
110 | | - | "\\varepsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\varepsilon ", "ε")) |
| 101 | + | "\\varepsilon" -> LITERAL (TEX_ONLY "\\varepsilon ") |
111 | 102 | | "\\zeta" -> LITERAL (HTMLABLEC (FONT_UF, "\\zeta ", "ζ")) |
112 | 103 | | "\\Zeta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
113 | 104 | "\\mathrm{Z}", "Ζ"))) |
— | — | @@ -151,9 +142,9 @@ |
152 | 143 | "\\mathrm{T}", "Τ"))) |
153 | 144 | | "\\upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\upsilon ", "υ")) |
154 | 145 | | "\\Upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\Upsilon ", "Υ")) |
155 | | - | "\\phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\phi ", "ϕ")) |
| 146 | + | "\\phi" -> LITERAL (TEX_ONLY "\\phi ") |
156 | 147 | | "\\Phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Phi ", "Φ")) |
157 | | - | "\\varphi" -> LITERAL (HTMLABLEC (FONT_UF, "\\varphi ", "φ")) |
| 148 | + | "\\varphi" -> LITERAL (TEX_ONLY "\\varphi ") |
158 | 149 | | "\\chi" -> LITERAL (HTMLABLEC (FONT_UF, "\\chi ", "χ")) |
159 | 150 | | "\\Chi" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
160 | 151 | "\\mathrm{X}", "Χ"))) |
— | — | @@ -249,6 +240,16 @@ |
250 | 241 | | "\\triangleleft" -> LITERAL (TEX_ONLY "\\triangleleft ") |
251 | 242 | | "\\triangleright" -> LITERAL (TEX_ONLY "\\triangleright ") |
252 | 243 | | "\\textvisiblespace" -> LITERAL (TEX_ONLY "\\textvisiblespace ") |
| 244 | + | "\\ker" -> LITERAL (HTMLABLEC(FONT_UFH,"\\ker ","ker")) |
| 245 | + | "\\lim" -> LITERAL (TEX_ONLY "\\lim ") |
| 246 | + | "\\limsup" -> LITERAL (TEX_ONLY "\\limsup ") |
| 247 | + | "\\liminf" -> LITERAL (TEX_ONLY "\\liminf ") |
| 248 | + | "\\sup" -> LITERAL (TEX_ONLY "\\sup ") |
| 249 | + | "\\Pr" -> LITERAL (TEX_ONLY "\\Pr ") |
| 250 | + | "\\hom" -> LITERAL (HTMLABLEC(FONT_UFH,"\\hom ","hom")) |
| 251 | + | "\\arg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arg ","arg")) |
| 252 | + | "\\dim" -> LITERAL (HTMLABLEC(FONT_UFH,"\\dim ","dim")) |
| 253 | + | "\\inf" -> LITERAL (TEX_ONLY "\\inf ") |
253 | 254 | | "\\circ" -> LITERAL (TEX_ONLY "\\circ ") |
254 | 255 | | "\\hbar" -> LITERAL (TEX_ONLY "\\hbar ") |
255 | 256 | | "\\imath" -> LITERAL (TEX_ONLY "\\imath ") |
— | — | @@ -269,6 +270,32 @@ |
270 | 271 | | "\\limits" -> LITERAL (TEX_ONLY "\\limits ") |
271 | 272 | | "\\nolimits" -> LITERAL (TEX_ONLY "\\nolimits ") |
272 | 273 | | "\\top" -> LITERAL (TEX_ONLY "\\top ") |
| 274 | + | "\\sin" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sin ","sin")) |
| 275 | + | "\\cos" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cos ","cos")) |
| 276 | + | "\\sinh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sinh ","sinh")) |
| 277 | + | "\\cosh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cosh ","cosh")) |
| 278 | + | "\\tan" -> LITERAL (HTMLABLEC(FONT_UFH,"\\tan ","tan")) |
| 279 | + | "\\tanh" -> LITERAL (HTMLABLEC(FONT_UFH,"\\tanh ","tanh")) |
| 280 | + | "\\sec" -> LITERAL (HTMLABLEC(FONT_UFH,"\\sec ","sec")) |
| 281 | + | "\\csc" -> LITERAL (HTMLABLEC(FONT_UFH,"\\csc ","csc")) |
| 282 | + | "\\arcsin" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arcsin ","arcsin")) |
| 283 | + | "\\arctan" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arctan ","arctan")) |
| 284 | + | "\\arccos" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccos}}","arccos"))) |
| 285 | + | "\\arccot" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccot}}","arccot"))) |
| 286 | + | "\\arcsec" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arcsec}}","arcsec"))) |
| 287 | + | "\\arccsc" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccsc}}","arccsc"))) |
| 288 | + | "\\sgn" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{sgn}}","sgn"))) |
| 289 | + | "\\cot" -> LITERAL (HTMLABLEC(FONT_UFH,"\\cot ","cot")) |
| 290 | + | "\\coth" -> LITERAL (HTMLABLEC(FONT_UFH,"\\coth ","coth")) |
| 291 | + | "\\log" -> LITERAL (HTMLABLEC(FONT_UFH,"\\log ", "log")) |
| 292 | + | "\\lg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\lg ", "lg")) |
| 293 | + | "\\ln" -> LITERAL (HTMLABLEC(FONT_UFH,"\\ln ", "ln")) |
| 294 | + | "\\exp" -> LITERAL (HTMLABLEC(FONT_UFH,"\\exp ", "exp")) |
| 295 | + | "\\min" -> LITERAL (HTMLABLEC(FONT_UFH,"\\min ", "min")) |
| 296 | + | "\\max" -> LITERAL (HTMLABLEC(FONT_UFH,"\\max ", "max")) |
| 297 | + | "\\gcd" -> LITERAL (HTMLABLEC(FONT_UFH,"\\gcd ", "gcd")) |
| 298 | + | "\\deg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\deg ", "deg")) |
| 299 | + | "\\det" -> LITERAL (HTMLABLEC(FONT_UFH,"\\det ", "det")) |
273 | 300 | | "\\bullet" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•")) |
274 | 301 | | "\\bull" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•")) |
275 | 302 | | "\\angle" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\angle ", "∠"))) |
— | — | @@ -392,22 +419,6 @@ |
393 | 420 | | "\\asymp" -> LITERAL (TEX_ONLY "\\asymp ") |
394 | 421 | | "\\doteq" -> LITERAL (TEX_ONLY "\\doteq ") |
395 | 422 | | "\\parallel" -> LITERAL (TEX_ONLY "\\parallel ") |
396 | | - | "\\euro" -> (tex_use_euro (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\euro}", "€"))) |
397 | | - | "\\geneuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuro}")) |
398 | | - | "\\geneuronarrow" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuronarrow}")) |
399 | | - | "\\geneurowide" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneurowide}")) |
400 | | - | "\\officialeuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\officialeuro}")) |
401 | | - | "\\Coppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Coppa}", "Ϙ"))) |
402 | | - | "\\coppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\coppa}", "ϙ"))) |
403 | | - | "\\varcoppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\coppa}", "ϙ"))) |
404 | | - | "\\Digamma" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Digamma}", "Ϝ"))) |
405 | | - | "\\Koppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Koppa}", "Ϙ"))) |
406 | | - | "\\koppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\koppa}", "ϟ"))) |
407 | | - | "\\Sampi" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\Sampi}")) |
408 | | - | "\\sampi" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\sampi}", "ϡ"))) |
409 | | - | "\\Stigma" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\Stigma}")) |
410 | | - | "\\stigma" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\stigma}", "ϛ"))) |
411 | | - | "\\varstigma" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\varstigma}")) |
412 | 423 | | "\\implies" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\implies ", "⇒"))) |
413 | 424 | | "\\mod" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mod ", "mod"))) |
414 | 425 | | "\\Diamond" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\Diamond ", "◊"))) |
— | — | @@ -416,17 +427,16 @@ |
417 | 428 | | "\\dotsi" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsi ", "⋅⋅⋅"))) |
418 | 429 | | "\\dotsm" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsm ", "⋅⋅⋅"))) |
419 | 430 | | "\\dotso" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotso ", "..."))) |
420 | | - | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
421 | | - | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
422 | | - | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
423 | | - | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
424 | | - | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
425 | | - | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
426 | | - | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "ℤ"))) |
427 | | - | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
428 | | - | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
429 | | - | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "ℚ"))) |
430 | | - | "\\H" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{H}", "ℍ"))) |
| 431 | + | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
| 432 | + | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
| 433 | + | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
| 434 | + | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
| 435 | + | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
| 436 | + | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
| 437 | + | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "<b>Z</b>"))) |
| 438 | + | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "<b>N</b>"))) |
| 439 | + | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "<b>N</b>"))) |
| 440 | + | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "<b>Q</b>"))) |
431 | 441 | | "\\lVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\lVert ", "||"))) |
432 | 442 | | "\\rVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\rVert ", "||"))) |
433 | 443 | | "\\nmid" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\nmid ")) |
— | — | @@ -482,7 +492,6 @@ |
483 | 493 | | "\\hat" -> FUN_AR1 "\\hat " |
484 | 494 | | "\\hline" -> LITERAL (TEX_ONLY "\\hline ") |
485 | 495 | | "\\vline" -> LITERAL (TEX_ONLY "\\vline ") |
486 | | - | "\\widetilde" -> LITERAL (TEX_ONLY "\\widetilde ") |
487 | 496 | | "\\widehat" -> LITERAL (TEX_ONLY "\\widehat ") |
488 | 497 | | "\\overline" -> LITERAL (TEX_ONLY "\\overline ") |
489 | 498 | | "\\overbrace" -> LITERAL (TEX_ONLY "\\overbrace ") |
Index: trunk/extensions/Math/math/render_info.mli |
— | — | @@ -11,13 +11,10 @@ |
12 | 12 | MN |
13 | 13 | | MI |
14 | 14 | | MO |
15 | | - | MF |
16 | | - |
17 | 15 | type t = |
18 | 16 | HTMLABLEC of font_class * string * string |
19 | 17 | | HTMLABLEM of font_class * string * string |
20 | 18 | | HTMLABLE of font_class * string * string |
21 | 19 | | MHTMLABLEC of font_class * string * string * math_class * string |
22 | | - | MHTMLABLEFC of font_class * string * string * math_class * string * string |
23 | 20 | | HTMLABLE_BIG of string * string |
24 | 21 | | TEX_ONLY of string |
Index: trunk/extensions/Math/math/html.ml |
— | — | @@ -28,7 +28,6 @@ |
29 | 29 | TEX_LITERAL (HTMLABLE (ft,_,sh))::r -> (html_liberal (); (font_render sh (ctx,ft))^html_render_flat ctx r) |
30 | 30 | | TEX_LITERAL (HTMLABLEC(ft,_,sh))::r -> (font_render sh (ctx,ft))^html_render_flat ctx r |
31 | 31 | | TEX_LITERAL (MHTMLABLEC(ft,_,sh,_,_))::r -> (font_render sh (ctx,ft))^html_render_flat ctx r |
32 | | - | TEX_LITERAL (MHTMLABLEFC(ft,_,sh,_,_,_))::r -> (font_render sh (ctx,ft))^html_render_flat ctx r |
33 | 32 | | TEX_LITERAL (HTMLABLEM(ft,_,sh))::r -> (html_moderate(); (font_render sh (ctx,ft))^html_render_flat ctx r) |
34 | 33 | | TEX_LITERAL (HTMLABLE_BIG (_,sh))::r -> (html_liberal (); sh^html_render_flat ctx r) |
35 | 34 | | TEX_FUN1hl (_,(f1,f2),a)::r -> f1^(html_render_flat ctx [a])^f2^html_render_flat ctx r |
— | — | @@ -76,7 +75,6 @@ |
77 | 76 | | TEX_LITERAL (HTMLABLEM(ft,_,sh))::r -> (html_moderate(); ("",(font_render sh (ctx,ft)),"")::html_render_deep ctx r) |
78 | 77 | | TEX_LITERAL (HTMLABLEC(ft,_,sh))::r -> ("",(font_render sh (ctx,ft)),"")::html_render_deep ctx r |
79 | 78 | | TEX_LITERAL (MHTMLABLEC(ft,_,sh,_,_))::r -> ("",(font_render sh (ctx,ft)),"")::html_render_deep ctx r |
80 | | - | TEX_LITERAL (MHTMLABLEFC(ft,_,sh,_,_,_))::r -> ("",(font_render sh (ctx,ft)),"")::html_render_deep ctx r |
81 | 79 | | TEX_LITERAL (HTMLABLE_BIG (_,sh))::r -> (html_liberal (); ("",sh,"")::html_render_deep ctx r) |
82 | 80 | | TEX_FUN2h (_,f,a,b)::r -> (html_liberal (); (f a b)::html_render_deep ctx r) |
83 | 81 | | TEX_INFIXh (_,f,a,b)::r -> (html_liberal (); (f a b)::html_render_deep ctx r) |