Index: trunk/extensions/Math/mathParserTests.txt |
— | — | @@ -144,6 +144,24 @@ |
145 | 145 | !! input |
146 | 146 | <math>\operatorname{sen}</math> |
147 | 147 | !! result |
148 | | -<p><img class="tex" alt="\operatorname{sen}" src="/images/math/3/e/7/3e71e75d9aac1bf5107271ad89ca7c3b.png" /> |
| 148 | +<p><img class="tex" alt="\operatorname{sen}" src="/images/math/f/a/9/fa9660c7eb053ca8d3c9a87fa86635d9.png" /> |
149 | 149 | </p> |
150 | 150 | !! end |
| 151 | + |
| 152 | +!! test |
| 153 | +BUG 31442: Multiple math accents without braces fails to parse |
| 154 | +!! input |
| 155 | +<math>\dot \vec B</math> |
| 156 | +!! result |
| 157 | +<p><img class="tex" alt="\dot \vec B" src="/images/math/e/6/4/e64939568ecb506a86a392373cec0458.png" /> |
| 158 | +</p> |
| 159 | +!! end |
| 160 | + |
| 161 | +!! test |
| 162 | +BUG 31442: Math accents with math font fail to parse if braces not used |
| 163 | +!! input |
| 164 | +<math>\tilde \mathcal{M}</math> |
| 165 | +!! result |
| 166 | +<p><img class="tex" alt="\tilde \mathcal{M}" src="/images/math/5/5/0/55072ce6ef8c840c4b7687bd8a028bde.png" /> |
| 167 | +</p> |
| 168 | +!! end |
Index: trunk/extensions/Math/math/tex.mli |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | | TEX_BOX of string * string |
13 | 13 | | TEX_BIG of string * Render_info.t |
14 | 14 | | TEX_FUN1 of string * t |
| 15 | + | TEX_FUN1nb of string * t |
15 | 16 | | TEX_FUN2 of string * t * t |
16 | 17 | | TEX_FUN2nb of string * t * t |
17 | 18 | | TEX_INFIX of string * t list * t list |
Index: trunk/extensions/Math/math/parser.mly |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | let sq_close_ri = HTMLABLEC(FONT_UFH,"]", "]") |
7 | 7 | %} |
8 | 8 | %token <Render_info.t> LITERAL DELIMITER |
9 | | -%token <string> FUN_AR2 FUN_INFIX FUN_AR1 DECL FUN_AR1opt BIG FUN_AR2nb |
| 9 | +%token <string> FUN_AR2 FUN_INFIX FUN_AR1 DECL FUN_AR1nb FUN_AR1opt BIG FUN_AR2nb |
10 | 10 | %token <string*string> BOX |
11 | 11 | %token <string*(string*string)> FUN_AR1hl |
12 | 12 | %token <string*Render_info.font_force> FUN_AR1hf DECLh |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | | BIG SQ_CLOSE { TEX_BIG ($1,sq_close_ri) } |
87 | 87 | | left expr right { TEX_LR ($1,$3,$2) } |
88 | 88 | | FUN_AR1 lit { TEX_FUN1($1,$2) } |
| 89 | + | FUN_AR1nb lit { TEX_FUN1nb($1,$2) } |
89 | 90 | | FUN_AR1hl lit { let t,h=$1 in TEX_FUN1hl(t,h,$2) } |
90 | 91 | | FUN_AR1hf lit { let t,h=$1 in TEX_FUN1hf(t,h,$2) } |
91 | 92 | | FUN_AR1opt expr_nosqc SQ_CLOSE lit { TEX_FUN2sq($1,TEX_CURLY $2,$4) } |
Index: trunk/extensions/Math/math/lexer.mll |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | | "-" { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH,"-"," − ",MO,str))} |
58 | 58 | | literal_uf_op { let str = Lexing.lexeme lexbuf in LITERAL (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) } |
59 | 59 | | delimiter_uf_op { let str = Lexing.lexeme lexbuf in DELIMITER (MHTMLABLEC (FONT_UFH, str," "^str^" ",MO,str)) } |
| 60 | + | "\\operatorname" { Texutil.tex_use_ams(); FUN_AR1nb "\\operatorname" } |
60 | 61 | | "\\sqrt" space * "[" { FUN_AR1opt "\\sqrt" } |
61 | 62 | | "\\xleftarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xleftarrow" } |
62 | 63 | | "\\xrightarrow" space * "[" { Texutil.tex_use_ams(); FUN_AR1opt "\\xrightarrow" } |
Index: trunk/extensions/Math/math/texutil.ml |
— | — | @@ -20,7 +20,8 @@ |
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 | + | TEX_FUN1nb (f,a) -> f ^ " " ^ (render_tex a) |
25 | 26 | | TEX_FUN1hl (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
26 | 27 | | TEX_FUN1hf (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" |
27 | 28 | | TEX_DECLh (f,_,a) -> "{" ^ f ^ "{" ^ (mapjoin render_tex a) ^ "}}" |
Index: trunk/extensions/Math/math/html.ml |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | | TEX_BOX (_,s)::r -> s^html_render_flat ctx r |
58 | 58 | | TEX_LITERAL (TEX_ONLY _)::_ -> raise Too_difficult_for_html |
59 | 59 | | TEX_FUN1 _::_ -> raise Too_difficult_for_html |
| 60 | + | TEX_FUN1nb _::_ -> raise Too_difficult_for_html |
60 | 61 | | TEX_FUN2 _::_ -> raise Too_difficult_for_html |
61 | 62 | | TEX_FUN2nb _::_ -> raise Too_difficult_for_html |
62 | 63 | | TEX_FUN2h _::_ -> raise Too_difficult_for_html |