Enable \cancel and \cancelto in texvc
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 18 Dec 2008 23:24:00 +0000 (23:24 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 18 Dec 2008 23:24:00 +0000 (23:24 +0000)
This works on Hardy, but may break all math support in the event that
some platform doesn't have support for \cancel.  I don't know much
OCaml or LaTeX, so I'm not sure how to make it import the package only
if it exists or something similarly useful.

If this gets reverted, though, at least I'll have committed it and
won't have to keep the diff in git stash forever.  :)

Clearly this requires a texvc recompile in any event.

RELEASE-NOTES
math/texutil.ml

index bc5c640..edb8d8c 100644 (file)
@@ -235,6 +235,7 @@ The following extensions are migrated into MediaWiki 1.14:
 * Add a 'change block' link to Special:IPBlockList and Special:Log
 * (bug 16459) Use native getElementsByClassName where possible, for better
   performance in modern browsers
+* Enable \cancel and \cancelto in texvc (recompile required)
 
 === Bug fixes in 1.14 ===
 
index e26ecba..7355bd6 100644 (file)
@@ -57,7 +57,7 @@ let get_preface ()  = "\\nonstopmode\n\\documentclass[12pt]{article}\n" ^
               (if !modules_nonascii then get_encoding !modules_encoding else "") ^
               (if !modules_ams then "\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n" else "") ^
               (if !modules_color then "\\usepackage[dvips,usenames]{color}\n" else "") ^
-              "\\pagestyle{empty}\n\\begin{document}\n$$\n"
+              "\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n"
 let get_footer  ()  = "\n$$\n\\end{document}\n"
 
 let set_encoding = function
@@ -507,6 +507,8 @@ let find = function
     | "\\cfrac"            -> (tex_use_ams (); FUN_AR2h ("\\cfrac ", fun num den -> Html.html_render [num], "<hr style=\"{background: black}\">", Html.html_render [den]))
     | "\\over"             -> FUN_INFIXh ("\\over ", fun num den -> Html.html_render num, "<hr style=\"{background: black}\"/>", Html.html_render den)
     | "\\sqrt"             -> FUN_AR1 "\\sqrt "
+    | "\\cancel"           -> FUN_AR1 "\\cancel "
+    | "\\cancelto"         -> FUN_AR2 "\\cancelto "
     | "\\pmod"             -> FUN_AR1hl ("\\pmod ", ("(mod ", ")"))
     | "\\bmod"             -> FUN_AR1hl ("\\bmod ", ("mod ", ""))
     | "\\emph"             -> FUN_AR1 "\\emph "