r97014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97013‎ | r97014 | r97015 >
Date:22:14, 13 September 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 27754) Archaic Greek letters for math

May require texlive-lang-greek package to be installed; but it's only loaded when these bits are used.
Reapplied r87298 plus parser test case to confirm the new chars can render and the existing \digamma hasn't changed.
Modified paths:
  • /trunk/extensions/Math/math/texutil.ml (modified) (history)
  • /trunk/extensions/Math/mathParserTests.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/Math/mathParserTests.txt
@@ -66,3 +66,22 @@
6767 <img class="tex" alt="\officialeuro" src="/images/math/d/7/0/d708de0eed23dbd6f02b99ea9073547b.png" />
6868 </p>
6969 !! end
 70+
 71+!! test
 72+BUG 27754: Archaic Greek letters for math (may require texlive-lang-greek)
 73+!! input
 74+<math>\digamma</math><!-- Lowercase digamma was already available -->
 75+<math>\Coppa\coppa\varcoppa</math>
 76+<math>\Digamma</math>
 77+<math>\Koppa\koppa</math>
 78+<math>\Sampi\sampi</math>
 79+<math>\Stigma\stigma\varstigma</math>
 80+!! result
 81+<p><img class="tex" alt="\digamma" src="/images/math/2/f/0/2f057b6e514c8ca2d9cf9a3e549f8865.png" />
 82+<img class="tex" alt="\Coppa\coppa\varcoppa" src="/images/math/8/3/0/8308ee5003aa36112414cad8ef874f85.png" />
 83+<img class="tex" alt="\Digamma" src="/images/math/5/c/f/5cfd6e5df6c87798542dca2e22c1e7cb.png" />
 84+<img class="tex" alt="\Koppa\koppa" src="/images/math/5/2/5/52593a0cdac178d165985ac014788b97.png" />
 85+<img class="tex" alt="\Sampi\sampi" src="/images/math/e/9/d/e9dabb19e4c27bf23d3c2a3629474562.png" />
 86+<img class="tex" alt="\Stigma\stigma\varstigma" src="/images/math/7/b/9/7b9233276816994a33a5e968202cef6e.png" />
 87+</p>
 88+!! end
Index: trunk/extensions/Math/math/texutil.ml
@@ -45,18 +45,21 @@
4646 let modules_nonascii = ref false
4747 let modules_encoding = ref UTF8
4848 let modules_color = ref false
 49+let modules_teubner = ref false
4950 let modules_euro = ref false
5051
5152 (* wrappers to easily set / reset module properties *)
5253 let tex_use_ams () = modules_ams := true
5354 let tex_use_nonascii () = modules_nonascii := true
5455 let tex_use_color () = modules_color := true
 56+let tex_use_teubner () = modules_teubner := true
5557 let tex_use_euro () = modules_euro := true
5658 let tex_mod_reset () = (
5759 modules_ams := false;
5860 modules_nonascii := false;
5961 modules_encoding := UTF8;
6062 modules_color := false;
 63+ modules_teubner := false;
6164 modules_euro := false;
6265 )
6366
@@ -71,6 +74,7 @@
7275 (if !modules_nonascii then get_encoding !modules_encoding else "") ^
7376 (if !modules_ams then "\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n" else "") ^
7477 (if !modules_color then "\\usepackage[dvips,usenames]{color}\n" else "") ^
 78+ (if !modules_teubner then "\\usepackage[greek]{babel}\n\\usepackage{teubner}\n" else "") ^
7579 (if !modules_euro then "\\usepackage{eurosym}\n" else "") ^
7680 "\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n"
7781
@@ -428,6 +432,17 @@
429433 | "\\geneuronarrow" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneuronarrow}"))
430434 | "\\geneurowide" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\geneurowide}"))
431435 | "\\officialeuro" -> (tex_use_euro (); LITERAL (TEX_ONLY "\\mbox{\\officialeuro}"))
 436+ | "\\Coppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Coppa}", "&#984;")))
 437+ | "\\coppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\coppa}", "&#985;")))
 438+ | "\\varcoppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\coppa}", "&#985;")))
 439+ | "\\Digamma" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Digamma}", "&#988;")))
 440+ | "\\Koppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\Koppa}", "&#984;")))
 441+ | "\\koppa" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\koppa}", "&#991;")))
 442+ | "\\Sampi" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\Sampi}"))
 443+ | "\\sampi" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\sampi}", "&#993;")))
 444+ | "\\Stigma" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\Stigma}"))
 445+ | "\\stigma" -> (tex_use_teubner (); LITERAL (HTMLABLE (FONT_UF, "\\mbox{\\stigma}", "&#987;")))
 446+ | "\\varstigma" -> (tex_use_teubner (); LITERAL (TEX_ONLY "\\mbox{\\varstigma}"))
432447 | "\\implies" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\implies ", "&rArr;")))
433448 | "\\mod" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mod ", "mod")))
434449 | "\\Diamond" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\Diamond ", "&loz;")))

Follow-up revisions

RevisionCommit summaryAuthorDate
r97259REL1_18 MFT r97001, r97002, r97007, r97014, r97018, r97034reedy13:06, 16 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87298This update provides the functionality requested in bug 27754. More...thenub31421:13, 2 May 2011

Status & tagging log