X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/a4b52d2fe555a507c376e78ee624898c55968364..737c6123d1467d8dbb903d72b19414a4345a5b69:/math/texutil.ml diff --git a/math/texutil.ml b/math/texutil.ml index be49e342..ad4fce10 100644 --- a/math/texutil.ml +++ b/math/texutil.ml @@ -14,12 +14,16 @@ let rec render_tex = function TEX_FQ (a,b,c) -> (render_tex a) ^ "_{" ^ (render_tex b) ^ "}^{" ^ (render_tex c) ^ "}" | TEX_DQ (a,b) -> (render_tex a) ^ "_{" ^ (render_tex b) ^ "}" | TEX_UQ (a,b) -> (render_tex a) ^ "^{" ^ (render_tex b) ^ "}" + | TEX_FQN (a,b) -> "_{" ^ (render_tex a) ^ "}^{" ^ (render_tex b) ^ "}" + | TEX_DQN (a) -> "_{" ^ (render_tex a) ^ "}" + | TEX_UQN (a) -> "^{" ^ (render_tex a) ^ "}" | TEX_LITERAL s -> tex_part s | TEX_FUN1 (f,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" | TEX_FUN1hl (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" | TEX_FUN1hf (f,_,a) -> "{" ^ f ^ " " ^ (render_tex a) ^ "}" | TEX_DECLh (f,_,a) -> "{" ^ f ^ "{" ^ (mapjoin render_tex a) ^ "}}" | TEX_FUN2 (f,a,b) -> "{" ^ f ^ " " ^ (render_tex a) ^ (render_tex b) ^ "}" + | TEX_FUN2nb (f,a,b) -> f ^ (render_tex a) ^ (render_tex b) | TEX_FUN2h (f,_,a,b) -> "{" ^ f ^ " " ^ (render_tex a) ^ (render_tex b) ^ "}" | TEX_FUN2sq (f,a,b) -> "{" ^ f ^ "[ " ^ (render_tex a) ^ "]" ^ (render_tex b) ^ "}" | TEX_CURLY (tl) -> "{" ^ (mapjoin render_tex tl) ^ "}" @@ -30,16 +34,19 @@ let rec render_tex = function | TEX_MATRIX (t,rows) -> "{\\begin{"^t^"}"^(mapjoine "\\\\" (mapjoine "&" (mapjoin render_tex)) rows)^"\\end{"^t^"}}" | TEX_LR (l,r,tl) -> "\\left "^(tex_part l)^(mapjoin render_tex tl)^"\\right "^(tex_part r) + (* Dynamic loading*) type encoding_t = LATIN1 | LATIN2 | UTF8 let modules_ams = ref false let modules_nonascii = ref false let modules_encoding = ref UTF8 +let modules_color = ref false let tex_use_ams () = modules_ams := true let tex_use_nonascii () = modules_nonascii := true -let tex_mod_reset () = (modules_ams := false; modules_nonascii := false; modules_encoding := UTF8) +let tex_use_color () = modules_color := true +let tex_mod_reset () = (modules_ams := false; modules_nonascii := false; modules_encoding := UTF8; modules_color := false) let get_encoding = function UTF8 -> "\\usepackage{ucs}\n\\usepackage[utf8]{inputenc}\n" @@ -49,7 +56,8 @@ let get_encoding = function 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 "") ^ - "\\pagestyle{empty}\n\\begin{document}\n$$\n" + (if !modules_color then "\\usepackage[dvips,usenames]{color}\n" else "") ^ + "\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n" let get_footer () = "\n$$\n\\end{document}\n" let set_encoding = function @@ -63,58 +71,75 @@ exception Illegal_tex_function of string let find = function "\\alpha" -> LITERAL (HTMLABLEC (FONT_UF, "\\alpha ", "α")) - | "\\Alpha" -> LITERAL (HTMLABLEC (FONT_RTI, "A", "Α")) + | "\\Alpha" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{A}", "Α"))) | "\\beta" -> LITERAL (HTMLABLEC (FONT_UF, "\\beta ", "β")) - | "\\Beta" -> LITERAL (HTMLABLEC (FONT_RTI, "B", "Β")) + | "\\Beta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{B}", "Β"))) | "\\gamma" -> LITERAL (HTMLABLEC (FONT_UF, "\\gamma ", "γ")) - | "\\Gamma" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Gamma ", "Γ")) + | "\\Gamma" -> LITERAL (HTMLABLEC (FONT_UF, "\\Gamma ", "Γ")) | "\\delta" -> LITERAL (HTMLABLEC (FONT_UF, "\\delta ", "δ")) - | "\\Delta" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Delta ", "Δ")) + | "\\Delta" -> LITERAL (HTMLABLEC (FONT_UF, "\\Delta ", "Δ")) | "\\epsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\epsilon ", "ε")) - | "\\Epsilon" -> LITERAL (HTMLABLEC (FONT_RTI, "E", "Ε")) + | "\\Epsilon" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{E}", "Ε"))) | "\\varepsilon" -> LITERAL (TEX_ONLY "\\varepsilon ") | "\\zeta" -> LITERAL (HTMLABLEC (FONT_UF, "\\zeta ", "ζ")) - | "\\Zeta" -> LITERAL (HTMLABLEC (FONT_RTI, "Z", "Ζ")) + | "\\Zeta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{Z}", "Ζ"))) | "\\eta" -> LITERAL (HTMLABLEC (FONT_UF, "\\eta ", "η")) - | "\\Eta" -> LITERAL (HTMLABLEC (FONT_RTI, "H", "Η")) + | "\\Eta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{H}", "Η"))) | "\\theta" -> LITERAL (HTMLABLEC (FONT_UF, "\\theta ", "θ")) - | "\\Theta" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Theta ", "Θ")) + | "\\Theta" -> LITERAL (HTMLABLEC (FONT_UF, "\\Theta ", "Θ")) | "\\vartheta" -> LITERAL (HTMLABLE (FONT_UF, "\\vartheta ", "ϑ")) | "\\thetasym" -> LITERAL (HTMLABLE (FONT_UF, "\\vartheta ", "ϑ")) | "\\iota" -> LITERAL (HTMLABLEC (FONT_UF, "\\iota ", "ι")) - | "\\Iota" -> LITERAL (HTMLABLEC (FONT_RTI, "I", "Ι")) + | "\\Iota" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{I}", "Ι"))) | "\\kappa" -> LITERAL (HTMLABLEC (FONT_UF, "\\kappa ", "κ")) - | "\\Kappa" -> LITERAL (HTMLABLEC (FONT_RTI, "K", "Κ")) + | "\\Kappa" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{K}", "Κ"))) | "\\lambda" -> LITERAL (HTMLABLEC (FONT_UF, "\\lambda ", "λ")) - | "\\Lambda" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Lambda ", "Λ")) + | "\\Lambda" -> LITERAL (HTMLABLEC (FONT_UF, "\\Lambda ", "Λ")) | "\\mu" -> LITERAL (HTMLABLEC (FONT_UF, "\\mu ", "μ")) - | "\\Mu" -> LITERAL (HTMLABLEC (FONT_RTI, "M", "Μ")) + | "\\Mu" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{M}", "Μ"))) | "\\nu" -> LITERAL (HTMLABLEC (FONT_UF, "\\nu ", "ν")) - | "\\Nu" -> LITERAL (HTMLABLEC (FONT_RTI, "N", "Ν")) + | "\\Nu" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{N}", "Ν"))) + | "\\omicron" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{o}", "ο"))) + | "\\Omicron" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{O}", "Ο"))) | "\\pi" -> LITERAL (HTMLABLEC (FONT_UF, "\\pi ", "π")) - | "\\Pi" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Pi ", "Π")) + | "\\Pi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Pi ", "Π")) | "\\varpi" -> LITERAL (TEX_ONLY "\\varpi ") | "\\rho" -> LITERAL (HTMLABLEC (FONT_UF, "\\rho ", "ρ")) - | "\\Rho" -> LITERAL (HTMLABLEC (FONT_RTI, "P", "Ρ")) + | "\\Rho" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{P}", "Ρ"))) | "\\varrho" -> LITERAL (TEX_ONLY "\\varrho ") + | "\\sim" -> LITERAL (HTMLABLEC (FONT_UF, "\\sim ", "˜")) | "\\sigma" -> LITERAL (HTMLABLEC (FONT_UF, "\\sigma ", "σ")) - | "\\Sigma" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Sigma ", "Σ")) + | "\\Sigma" -> LITERAL (HTMLABLEC (FONT_UF, "\\Sigma ", "Σ")) | "\\varsigma" -> LITERAL (TEX_ONLY "\\varsigma ") | "\\tau" -> LITERAL (HTMLABLEC (FONT_UF, "\\tau ", "τ")) - | "\\Tau" -> LITERAL (HTMLABLEC (FONT_RTI, "T", "Τ")) + | "\\Tau" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{T}", "Τ"))) | "\\upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\upsilon ", "υ")) - | "\\Upsilon" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Upsilon ", "Υ")) + | "\\Upsilon" -> LITERAL (HTMLABLEC (FONT_UF, "\\Upsilon ", "Υ")) | "\\phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\phi ", "φ")) - | "\\Phi" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Phi ", "Φ")) + | "\\Phi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Phi ", "Φ")) | "\\varphi" -> LITERAL (TEX_ONLY "\\varphi ") | "\\chi" -> LITERAL (HTMLABLEC (FONT_UF, "\\chi ", "χ")) - | "\\Chi" -> LITERAL (HTMLABLEC (FONT_RTI, "X", "Χ")) + | "\\Chi" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF, + "\\mathrm{X}", "Χ"))) | "\\psi" -> LITERAL (HTMLABLEC (FONT_UF, "\\psi ", "ψ")) - | "\\Psi" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Psi ", "Ψ")) + | "\\Psi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Psi ", "Ψ")) | "\\omega" -> LITERAL (HTMLABLEC (FONT_UF, "\\omega ", "ω")) - | "\\Omega" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Omega ", "Ω")) + | "\\Omega" -> LITERAL (HTMLABLEC (FONT_UF, "\\Omega ", "Ω")) | "\\xi" -> LITERAL (HTMLABLEC (FONT_UF, "\\xi ", "ξ")) - | "\\Xi" -> LITERAL (HTMLABLEC (FONT_RTI, "\\Xi ", "Ξ")) + | "\\Xi" -> LITERAL (HTMLABLEC (FONT_UF, "\\Xi ", "Ξ")) | "\\aleph" -> LITERAL (HTMLABLE (FONT_UF, "\\aleph ", "ℵ")) | "\\alef" -> LITERAL (HTMLABLE (FONT_UF, "\\aleph ", "ℵ")) | "\\alefsym" -> LITERAL (HTMLABLE (FONT_UF, "\\aleph ", "ℵ")) @@ -148,6 +173,15 @@ let find = function | "\\Downarrow" -> DELIMITER (HTMLABLE (FONT_UF, "\\Downarrow ", "⇓")) | "\\updownarrow" -> DELIMITER (TEX_ONLY "\\updownarrow ") | "\\Updownarrow" -> DELIMITER (TEX_ONLY "\\Updownarrow ") + | "\\ulcorner" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\ulcorner ")) + | "\\urcorner" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\urcorner ")) + | "\\llcorner" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\llcorner ")) + | "\\lrcorner" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\lrcorner ")) + | "\\twoheadleftarrow" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\twoheadleftarrow ")) + | "\\twoheadrightarrow" -> (tex_use_ams (); DELIMITER (TEX_ONLY "\\twoheadrightarrow ")) + | "\\xleftarrow" -> (tex_use_ams (); FUN_AR1 "\\xleftarrow ") + | "\\xrightarrow" -> (tex_use_ams (); FUN_AR1 "\\xrightarrow ") + | "\\rightleftharpoons" -> DELIMITER (TEX_ONLY "\\rightleftharpoons ") | "\\leftrightarrow" -> LITERAL (HTMLABLE (FONT_UF, "\\leftrightarrow ", "↔")) | "\\lrarr" -> LITERAL (HTMLABLE (FONT_UF, "\\leftrightarrow ", "↔")) | "\\harr" -> LITERAL (HTMLABLE (FONT_UF, "\\leftrightarrow ", "↔")) @@ -156,6 +190,7 @@ let find = function | "\\Harr" -> LITERAL (HTMLABLE (FONT_UF, "\\Leftrightarrow ", "⇔")) | "\\lrArr" -> LITERAL (HTMLABLE (FONT_UF, "\\Leftrightarrow ", "⇔")) | "\\hAar" -> LITERAL (HTMLABLE (FONT_UF, "\\Leftrightarrow ", "⇔")) + | "\\longleftrightarrow"->LITERAL (HTMLABLE (FONT_UF, "\\longleftrightarrow ", "↔")) | "\\Longleftrightarrow"->LITERAL (HTMLABLE (FONT_UF, "\\Longleftrightarrow ", "↔")) | "\\iff" -> LITERAL (HTMLABLE (FONT_UF, "\\iff ", "↔")) | "\\ll" -> LITERAL (TEX_ONLY "\\ll ") @@ -165,8 +200,8 @@ let find = function | "\\nearrow" -> LITERAL (TEX_ONLY "\\nearrow ") | "\\swarrow" -> LITERAL (TEX_ONLY "\\swarrow ") | "\\nwarrow" -> LITERAL (TEX_ONLY "\\nwarrow ") - | "\\sim" -> LITERAL (TEX_ONLY "\\sim ") | "\\simeq" -> LITERAL (TEX_ONLY "\\simeq ") + | "\\ast" -> LITERAL (TEX_ONLY "\\ast ") | "\\star" -> LITERAL (TEX_ONLY "\\star ") | "\\ell" -> LITERAL (TEX_ONLY "\\ell ") | "\\P" -> LITERAL (TEX_ONLY "\\P ") @@ -186,28 +221,30 @@ let find = function | "\\models" -> LITERAL (TEX_ONLY "\\models ") | "\\vdash" -> LITERAL (TEX_ONLY "\\vdash ") | "\\triangle" -> LITERAL (TEX_ONLY "\\triangle ") + | "\\bowtie" -> LITERAL (TEX_ONLY "\\bowtie ") | "\\wr" -> LITERAL (TEX_ONLY "\\wr ") | "\\triangleleft" -> LITERAL (TEX_ONLY "\\triangleleft ") | "\\triangleright" -> LITERAL (TEX_ONLY "\\triangleright ") | "\\textvisiblespace" -> LITERAL (TEX_ONLY "\\textvisiblespace ") - | "\\ker" -> LITERAL (TEX_ONLY "\\ker ") + | "\\ker" -> LITERAL (HTMLABLEC(FONT_UFH,"\\ker ","ker")) | "\\lim" -> LITERAL (TEX_ONLY "\\lim ") | "\\limsup" -> LITERAL (TEX_ONLY "\\limsup ") | "\\liminf" -> LITERAL (TEX_ONLY "\\liminf ") | "\\sup" -> LITERAL (TEX_ONLY "\\sup ") | "\\Pr" -> LITERAL (TEX_ONLY "\\Pr ") - | "\\hom" -> LITERAL (TEX_ONLY "\\hom ") - | "\\arg" -> LITERAL (TEX_ONLY "\\arg ") - | "\\dim" -> LITERAL (TEX_ONLY "\\dim ") + | "\\hom" -> LITERAL (HTMLABLEC(FONT_UFH,"\\hom ","hom")) + | "\\arg" -> LITERAL (HTMLABLEC(FONT_UFH,"\\arg ","arg")) + | "\\dim" -> LITERAL (HTMLABLEC(FONT_UFH,"\\dim ","dim")) | "\\inf" -> LITERAL (TEX_ONLY "\\inf ") | "\\circ" -> LITERAL (TEX_ONLY "\\circ ") | "\\hbar" -> LITERAL (TEX_ONLY "\\hbar ") | "\\imath" -> LITERAL (TEX_ONLY "\\imath ") + | "\\jmath" -> LITERAL (TEX_ONLY "\\jmath ") | "\\lnot" -> LITERAL (TEX_ONLY "\\lnot ") | "\\hookrightarrow" -> LITERAL (TEX_ONLY "\\hookrightarrow ") | "\\hookleftarrow" -> LITERAL (TEX_ONLY "\\hookleftarrow ") | "\\mp" -> LITERAL (TEX_ONLY "\\mp ") - | "\\approx" -> LITERAL (TEX_ONLY "\\approx ") + | "\\approx" -> LITERAL (HTMLABLE (FONT_UF, "\\approx ", "≈")) | "\\propto" -> LITERAL (TEX_ONLY "\\propto ") | "\\flat" -> LITERAL (TEX_ONLY "\\flat ") | "\\sharp" -> LITERAL (TEX_ONLY "\\sharp ") @@ -313,6 +350,7 @@ let find = function | "\\otimes" -> LITERAL (HTMLABLE (FONT_UF, "\\otimes ", "⊗")) | "\\cap" -> LITERAL (HTMLABLEM(FONT_UF, "\\cap ", "∩")) | "\\cup" -> LITERAL (HTMLABLE (FONT_UF, "\\cup ", "∪")) + | "\\uplus" -> LITERAL (TEX_ONLY "\\uplus ") | "\\sqcap" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\sqcap ")) | "\\sqcup" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\sqcup ")) | "\\empty" -> LITERAL (HTMLABLE (FONT_UF, "\\emptyset ", "∅")) @@ -341,6 +379,7 @@ let find = function | "\\rang" -> DELIMITER (HTMLABLE (FONT_UFH,"\\rangle ","〉")) | "\\lbrack" -> DELIMITER (HTMLABLEC(FONT_UFH,"[","[")) | "\\rbrack" -> DELIMITER (HTMLABLEC(FONT_UFH,"]","]")) + | "\\surd" -> LITERAL (TEX_ONLY "\\surd ") | "\\ddots" -> LITERAL (TEX_ONLY "\\ddots ") | "\\clubs" -> LITERAL (TEX_ONLY "\\clubsuit ") | "\\clubsuit" -> LITERAL (TEX_ONLY "\\clubsuit ") @@ -349,7 +388,23 @@ let find = function | "\\hearts" -> LITERAL (TEX_ONLY "\\heartsuit ") | "\\heartsuit" -> LITERAL (TEX_ONLY "\\heartsuit ") | "\\diamonds" -> LITERAL (TEX_ONLY "\\diamondsuit ") + | "\\diamond" -> LITERAL (TEX_ONLY "\\diamond ") + | "\\bigtriangleup" -> LITERAL (TEX_ONLY "\\bigtriangleup ") + | "\\bigtriangledown" -> LITERAL (TEX_ONLY "\\bigtriangledown ") | "\\diamondsuit" -> LITERAL (TEX_ONLY "\\diamondsuit ") + | "\\ominus" -> LITERAL (TEX_ONLY "\\ominus ") + | "\\oslash" -> LITERAL (TEX_ONLY "\\oslash ") + | "\\odot" -> LITERAL (TEX_ONLY "\\odot ") + | "\\bigcirc" -> LITERAL (TEX_ONLY "\\bigcirc ") + | "\\amalg" -> LITERAL (TEX_ONLY "\\amalg ") + | "\\prec" -> LITERAL (TEX_ONLY "\\prec ") + | "\\succ" -> LITERAL (TEX_ONLY "\\succ ") + | "\\preceq" -> LITERAL (TEX_ONLY "\\preceq ") + | "\\succeq" -> LITERAL (TEX_ONLY "\\succeq ") + | "\\dashv" -> LITERAL (TEX_ONLY "\\dashv ") + | "\\asymp" -> LITERAL (TEX_ONLY "\\asymp ") + | "\\doteq" -> LITERAL (TEX_ONLY "\\doteq ") + | "\\parallel" -> LITERAL (TEX_ONLY "\\parallel ") | "\\implies" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\implies ", "⇒"))) | "\\mod" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mod ", "mod"))) | "\\Diamond" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\Diamond ", "◊"))) @@ -357,11 +412,13 @@ let find = function | "\\reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "R"))) | "\\Reals" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "R"))) | "\\R" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{R}", "R"))) + | "\\C" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "C"))) | "\\cnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "C"))) | "\\Complex" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{C}", "C"))) | "\\Z" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Z}", "Z"))) | "\\natnums" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "N"))) | "\\N" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{N}", "N"))) + | "\\Q" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\mathbb{Q}", "Q"))) | "\\lVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\lVert ", "||"))) | "\\rVert" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UFH,"\\rVert ", "||"))) | "\\nmid" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\nmid ")) @@ -380,6 +437,7 @@ let find = function | "\\Box" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\Box ")) | "\\nleq" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\nleq ")) | "\\upharpoonright" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\upharpoonright ")) + | "\\restriction" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\upharpoonright ")) | "\\upharpoonleft" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\upharpoonleft ")) | "\\downharpoonright" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\downharpoonright ")) | "\\downharpoonleft" -> (tex_use_ams (); LITERAL (TEX_ONLY "\\downharpoonleft ")) @@ -414,14 +472,16 @@ let find = function | "\\left" -> LEFT | "\\right" -> RIGHT | "\\hat" -> FUN_AR1 "\\hat " - | "\\widehat" -> FUN_AR1 "\\widehat " - | "\\overline" -> FUN_AR1 "\\overline " - | "\\overbrace" -> FUN_AR1 "\\overbrace " - | "\\underline" -> FUN_AR1 "\\underline " - | "\\underbrace" -> FUN_AR1 "\\underbrace " - | "\\overleftarrow" -> FUN_AR1 "\\overleftarrow " - | "\\overrightarrow" -> FUN_AR1 "\\overrightarrow " - | "\\overleftrightarrow"->FUN_AR1 "\\overleftrightarrow " + | "\\hline" -> LITERAL (TEX_ONLY "\\hline ") + | "\\vline" -> LITERAL (TEX_ONLY "\\vline ") + | "\\widehat" -> LITERAL (TEX_ONLY "\\widehat ") + | "\\overline" -> LITERAL (TEX_ONLY "\\overline ") + | "\\overbrace" -> LITERAL (TEX_ONLY "\\overbrace ") + | "\\underline" -> LITERAL (TEX_ONLY "\\underline ") + | "\\underbrace" -> LITERAL (TEX_ONLY "\\underbrace ") + | "\\overleftarrow" -> LITERAL (TEX_ONLY "\\overleftarrow ") + | "\\overrightarrow" -> LITERAL (TEX_ONLY "\\overrightarrow ") + | "\\overleftrightarrow"-> (tex_use_ams(); LITERAL (TEX_ONLY "\\overleftrightarrow ")) | "\\check" -> FUN_AR1 "\\check " | "\\acute" -> FUN_AR1 "\\acute " | "\\grave" -> FUN_AR1 "\\grave " @@ -431,14 +491,24 @@ let find = function | "\\ddot" -> FUN_AR1 "\\ddot " | "\\breve" -> FUN_AR1 "\\breve " | "\\tilde" -> FUN_AR1 "\\tilde " - | "\\not" -> FUN_AR1 "\\not " + | "\\not" -> LITERAL (TEX_ONLY "\\not ") | "\\choose" -> FUN_INFIX "\\choose " | "\\atop" -> FUN_INFIX "\\atop " - | "\\binom" -> FUN_AR2 "\\binom " + | "\\binom" -> (tex_use_ams (); FUN_AR2 "\\binom ") + | "\\dbinom" -> (tex_use_ams (); FUN_AR2 "\\dbinom ") + | "\\tbinom" -> (tex_use_ams (); FUN_AR2 "\\tbinom ") + | "\\stackrel" -> FUN_AR2 "\\stackrel " + | "\\sideset" -> (tex_use_ams (); FUN_AR2nb "\\sideset ") + | "\\underset" -> (tex_use_ams (); FUN_AR2 "\\underset ") + | "\\overset" -> (tex_use_ams (); FUN_AR2 "\\overset ") | "\\frac" -> FUN_AR2h ("\\frac ", fun num den -> Html.html_render [num], "