(Bug 23397) texvc in html mode should render \sim as ∼ not ˜
[lhc/web/wiklou.git] / math / texutil.ml
index e26ecba..516a96e 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
@@ -119,7 +119,7 @@ let find = function
     | "\\Rho"              -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF,
     "\\mathrm{P}", "Ρ")))
     | "\\varrho"           -> LITERAL (TEX_ONLY "\\varrho ")
-    | "\\sim"              -> LITERAL (HTMLABLEC (FONT_UF,  "\\sim ", "˜"))
+    | "\\sim"              -> LITERAL (HTMLABLEC (FONT_UF,  "\\sim ", "∼"))
     | "\\sigma"            -> LITERAL (HTMLABLEC (FONT_UF,  "\\sigma ", "σ"))
     | "\\Sigma"            -> LITERAL (HTMLABLEC (FONT_UF, "\\Sigma ", "Σ"))
     | "\\varsigma"         -> LITERAL (TEX_ONLY "\\varsigma ")
@@ -481,7 +481,7 @@ let find = function
     | "\\underbrace"       -> LITERAL (TEX_ONLY "\\underbrace ")
     | "\\overleftarrow"    -> LITERAL (TEX_ONLY "\\overleftarrow ")
     | "\\overrightarrow"   -> LITERAL (TEX_ONLY "\\overrightarrow ")
-    | "\\overleftrightarrow"->LITERAL (TEX_ONLY "\\overleftrightarrow ")
+    | "\\overleftrightarrow"-> (tex_use_ams(); LITERAL (TEX_ONLY "\\overleftrightarrow "))
     | "\\check"            -> FUN_AR1 "\\check "
     | "\\acute"            -> FUN_AR1 "\\acute "
     | "\\grave"            -> FUN_AR1 "\\grave "
@@ -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 "
@@ -731,4 +733,6 @@ let find = function
     | "\\vbox"             -> raise (Failure "malformatted \\vbox")
     | "\\hbox"             -> raise (Failure "malformatted \\hbox")
     | "\\color"            -> (tex_use_color (); LITERAL (TEX_ONLY "\\color"))
+    | "\\pagecolor"        -> (tex_use_color (); LITERAL (TEX_ONLY "\\pagecolor"))
+    | "\\definecolor"      -> (tex_use_color (); LITERAL (TEX_ONLY "\\definecolor"))
     | s                    -> raise (Illegal_tex_function s)