From e9f24f5264e2059a564e3e40dce2fb0eacc1b5fc Mon Sep 17 00:00:00 2001 From: Nicholas Longo Date: Fri, 13 May 2011 00:01:44 +0000 Subject: [PATCH] A change to fix a bug in LaTeX rendering of function names. An additional space was necessary in the LaTeX code when rendering functions such as \sin foo32. Also a few lines of code were removed from texutil.ml that are now handled by lexer.mll. --- math/lexer.mll | 4 ++-- math/texutil.ml | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/math/lexer.mll b/math/lexer.mll index 56c166d..db2cbda 100644 --- a/math/lexer.mll +++ b/math/lexer.mll @@ -66,7 +66,7 @@ rule token = parse | "\\" (latex_function_names as name) space * "\\{" { LITERAL (MHTMLABLEFC(FONT_UFH, "\\" ^ name ^ "\\{", name ^ "{", MF, name, "{")) } | "\\" (latex_function_names as name) space * - { LITERAL (MHTMLABLEC(FONT_UFH,"\\" ^ name, name ^ " ", MF, name)) } + { LITERAL (MHTMLABLEC(FONT_UFH,"\\" ^ name ^ " ", name ^ " ", MF, name)) } | "\\" (mediawiki_function_names as name) space * "(" { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEFC(FONT_UFH, "\\operatorname{" ^ name ^ "}(", name ^ "(", MF, name, "("))) } @@ -77,7 +77,7 @@ rule token = parse { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEFC(FONT_UFH, "\\operatorname{" ^ name ^ "}\\{", name ^ "{", MF, name, "{"))) } | "\\" (mediawiki_function_names as name) space * - { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "}", name ^ " ", MF, name))) } + { (Texutil.tex_use_ams(); LITERAL (MHTMLABLEC(FONT_UFH,"\\operatorname{" ^ name ^ "} ", name ^ " ", MF, name))) } | "\\" alpha + { Texutil.find (Lexing.lexeme lexbuf) } | "\\," { LITERAL (HTMLABLE (FONT_UF, "\\,"," ")) } | "\\ " { LITERAL (HTMLABLE (FONT_UF, "\\ "," ")) } diff --git a/math/texutil.ml b/math/texutil.ml index efbf6a3..c9c89e5 100644 --- a/math/texutil.ml +++ b/math/texutil.ml @@ -269,10 +269,6 @@ let find = function | "\\limits" -> LITERAL (TEX_ONLY "\\limits ") | "\\nolimits" -> LITERAL (TEX_ONLY "\\nolimits ") | "\\top" -> LITERAL (TEX_ONLY "\\top ") - | "\\arccot" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccot}}","arccot"))) - | "\\arcsec" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arcsec}}","arcsec"))) - | "\\arccsc" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{arccsc}}","arccsc"))) - | "\\sgn" -> (tex_use_ams (); LITERAL (HTMLABLEC(FONT_UFH,"\\mathop{\\mathrm{sgn}}","sgn"))) | "\\bullet" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•")) | "\\bull" -> LITERAL (HTMLABLE (FONT_UFH, "\\bullet ", "•")) | "\\angle" -> (tex_use_ams (); LITERAL (HTMLABLE (FONT_UF, "\\angle ", "∠")))