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}", "Χ"))) |
— | — | @@ -387,6 +391,11 @@ |
388 | 392 | | "\\asymp" -> LITERAL (TEX_ONLY "\\asymp ") |
389 | 393 | | "\\doteq" -> LITERAL (TEX_ONLY "\\doteq ") |
390 | 394 | | "\\parallel" -> LITERAL (TEX_ONLY "\\parallel ") |
| 395 | + | "\\euro" -> (tex_use_euro (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\euro}", "€"))) |
| 396 | + | "\\geneuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuro}")) |
| 397 | + | "\\geneuronarrow" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuronarrow}")) |
| 398 | + | "\\geneurowide" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneurowide}")) |
| 399 | + | "\\officialeuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\officialeuro}")) |
391 | 400 | | "\\implies" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\implies ", "⇒"))) |
392 | 401 | | "\\mod" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mod ", "mod"))) |
393 | 402 | | "\\Diamond" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\Diamond ", "◊"))) |
— | — | @@ -395,16 +404,17 @@ |
396 | 405 | | "\\dotsi" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsi ", "⋅⋅⋅"))) |
397 | 406 | | "\\dotsm" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotsm ", "⋅⋅⋅"))) |
398 | 407 | | "\\dotso" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\dotso ", "..."))) |
399 | | - | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
400 | | - | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
401 | | - | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "<b>R</b>"))) |
402 | | - | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
403 | | - | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
404 | | - | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "<b>C</b>"))) |
405 | | - | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "<b>Z</b>"))) |
406 | | - | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "<b>N</b>"))) |
407 | | - | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "<b>N</b>"))) |
408 | | - | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "<b>Q</b>"))) |
| 408 | + | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 409 | + | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 410 | + | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "ℝ"))) |
| 411 | + | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 412 | + | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 413 | + | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "ℂ"))) |
| 414 | + | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "ℤ"))) |
| 415 | + | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
| 416 | + | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "ℕ"))) |
| 417 | + | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "ℚ"))) |
| 418 | + | "\\H" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{H}", "ℍ"))) |
409 | 419 | | "\\lVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\lVert ", "||"))) |
410 | 420 | | "\\rVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\rVert ", "||"))) |
411 | 421 | | "\\nmid" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\nmid ")) |