Index: trunk/extensions/Math/mathParserTests.txt |
— | — | @@ -50,3 +50,19 @@ |
51 | 51 | </p> |
52 | 52 | !! end |
53 | 53 | |
| 54 | +!! test |
| 55 | +BUG 27324: Euro symbol for math |
| 56 | +!! input |
| 57 | +<math>\euro 200</math> |
| 58 | +<math>\geneuro</math> |
| 59 | +<math>\geneuronarrow</math> |
| 60 | +<math>\geneurowide</math> |
| 61 | +<math>\officialeuro</math> |
| 62 | +!! result |
| 63 | +<p><span class="texhtml" dir="ltr">€200</span> |
| 64 | +<img class="tex" alt="\geneuro" src="/images/math/9/8/b/98b63c235ee187a38267e0e170b10e9d.png" /> |
| 65 | +<img class="tex" alt="\geneuronarrow" src="/images/math/a/a/4/aa4a1ed370f4ee705c6930384bf89502.png" /> |
| 66 | +<img class="tex" alt="\geneurowide" src="/images/math/4/4/0/4404468e6187fb04e4f7e1f15e550825.png" /> |
| 67 | +<img class="tex" alt="\officialeuro" src="/images/math/d/7/0/d708de0eed23dbd6f02b99ea9073547b.png" /> |
| 68 | +</p> |
| 69 | +!! end |
Index: trunk/extensions/Math/math/texutil.ml |
— | — | @@ -45,16 +45,19 @@ |
46 | 46 | let modules_nonascii = ref false |
47 | 47 | let modules_encoding = ref UTF8 |
48 | 48 | let modules_color = ref false |
| 49 | +let modules_euro = ref false |
49 | 50 | |
50 | 51 | (* wrappers to easily set / reset module properties *) |
51 | 52 | let tex_use_ams () = modules_ams := true |
52 | 53 | let tex_use_nonascii () = modules_nonascii := true |
53 | 54 | let tex_use_color () = modules_color := true |
| 55 | +let tex_use_euro () = modules_euro := true |
54 | 56 | let tex_mod_reset () = ( |
55 | 57 | modules_ams := false; |
56 | 58 | modules_nonascii := false; |
57 | 59 | modules_encoding := UTF8; |
58 | | - modules_color := false |
| 60 | + modules_color := false; |
| 61 | + modules_euro := false; |
59 | 62 | ) |
60 | 63 | |
61 | 64 | (* Return TeX fragment for one of the encodings in (UTF8,LATIN1,LATIN2) *) |
— | — | @@ -68,6 +71,7 @@ |
69 | 72 | (if !modules_nonascii then get_encoding !modules_encoding else "") ^ |
70 | 73 | (if !modules_ams then "\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n" else "") ^ |
71 | 74 | (if !modules_color then "\\usepackage[dvips,usenames]{color}\n" else "") ^ |
| 75 | + (if !modules_euro then "\\usepackage{eurosym}\n" else "") ^ |
72 | 76 | "\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n" |
73 | 77 | |
74 | 78 | (* TeX fragment appended after the content *) |
— | — | @@ -97,7 +101,7 @@ |
98 | 102 | | "\\epsilon" -> LITERAL (TEX_ONLY "\\epsilon ") |
99 | 103 | | "\\Epsilon" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
100 | 104 | "\\mathrm{E}", "Ε"))) |
101 | | - | "\\varepsilon" -> LITERAL (TEX_ONLY "\\varepsilon ") |
| 105 | + | "\\varepsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\varepsilon ", "ε")) |
102 | 106 | | "\\zeta" -> LITERAL (HTMLABLEC (FONT_UF, "\\zeta ", "ζ")) |
103 | 107 | | "\\Zeta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
104 | 108 | "\\mathrm{Z}", "Ζ"))) |
— | — | @@ -142,9 +146,9 @@ |
143 | 147 | "\\mathrm{T}", "Τ"))) |
144 | 148 | | "\\upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\upsilon ", "υ")) |
145 | 149 | | "\\Upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\Upsilon ", "Υ")) |
146 | | - | "\\phi" -> LITERAL (TEX_ONLY "\\phi ") |
| 150 | + | "\\phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\phi ", "ϕ")) |
147 | 151 | | "\\Phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Phi ", "Φ")) |
148 | | - | "\\varphi" -> LITERAL (TEX_ONLY "\\varphi ") |
| 152 | + | "\\varphi" -> LITERAL (HTMLABLEC (FONT_UF, "\\varphi ", "φ")) |
149 | 153 | | "\\chi" -> LITERAL (HTMLABLEC (FONT_UF, "\\chi ", "χ")) |
150 | 154 | | "\\Chi" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, |
151 | 155 | "\\mathrm{X}", "Χ"))) |
— | — | @@ -419,6 +423,11 @@ |
420 | 424 | | "\\asymp" -> LITERAL (TEX_ONLY "\\asymp ") |
421 | 425 | | "\\doteq" -> LITERAL (TEX_ONLY "\\doteq ") |
422 | 426 | | "\\parallel" -> LITERAL (TEX_ONLY "\\parallel ") |
| 427 | + | "\\euro" -> (tex_use_euro (); LITERAL (HTMLABLEC (FONT_UF, "\\mbox{\\euro}", "€"))) |
| 428 | + | "\\geneuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuro}")) |
| 429 | + | "\\geneuronarrow" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuronarrow}")) |
| 430 | + | "\\geneurowide" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneurowide}")) |
| 431 | + | "\\officialeuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\officialeuro}")) |
423 | 432 | | "\\implies" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\implies ", "⇒"))) |
424 | 433 | | "\\mod" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mod ", "mod"))) |
425 | 434 | | "\\Diamond" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\Diamond ", "◊"))) |
— | — | @@ -427,16 +436,17 @@ |
428 | 437 | | "\\dotsi" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsi ", "⋅⋅⋅"))) |
429 | 438 | | "\\dotsm" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsm ", "⋅⋅⋅"))) |
430 | 439 | | "\\dotso" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotso ", "..."))) |
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>"))) |
| 440 | + | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 441 | + | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 442 | + | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 443 | + | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 444 | + | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 445 | + | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 446 | + | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "ℤ"))) |
| 447 | + | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
| 448 | + | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
| 449 | + | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "ℚ"))) |
| 450 | + | "\\H" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{H}", "ℍ"))) |
441 | 451 | | "\\lVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\lVert ", "||"))) |
442 | 452 | | "\\rVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\rVert ", "||"))) |
443 | 453 | | "\\nmid" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\nmid ")) |