From b8161615f48f435813520a7704e249b28134a88b Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Thu, 24 Jul 2014 15:13:10 -0400 Subject: [PATCH] Switch to text mode before emitting \AA or \textvisiblespace. The \AA and \textvisible space commands aren't valid in math mode. Surround them with \mbox so that we switch to text mode before emitting them. Change-Id: I36c23c80751401be4bbce6aca6c3333912f67add --- math/texutil.ml | 4 ++-- texvccheck/texutil.ml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/math/texutil.ml b/math/texutil.ml index a4c40a5f2..4d66424db 100644 --- a/math/texutil.ml +++ b/math/texutil.ml @@ -248,7 +248,7 @@ let find = function | "\\wr" -> LITERAL (TEX_ONLY "\\wr ") | "\\triangleleft" -> LITERAL (TEX_ONLY "\\triangleleft ") | "\\triangleright" -> LITERAL (TEX_ONLY "\\triangleright ") - | "\\textvisiblespace" -> LITERAL (TEX_ONLY "\\textvisiblespace ") + | "\\textvisiblespace" -> LITERAL (TEX_ONLY "\\mbox{\\textvisiblespace}") | "\\circ" -> LITERAL (TEX_ONLY "\\circ ") | "\\hbar" -> LITERAL (TEX_ONLY "\\hbar ") | "\\imath" -> LITERAL (TEX_ONLY "\\imath ") @@ -330,7 +330,7 @@ let find = function | "\\pm" -> LITERAL (HTMLABLEM(FONT_UFH,"\\pm ", "±")) | "\\plusmn" -> LITERAL (HTMLABLEM(FONT_UFH,"\\pm ", "±")) | "\\cdot" -> LITERAL (HTMLABLE (FONT_UFH,"\\cdot ", "⋅")) - | "\\AA" -> LITERAL (HTMLABLE (FONT_UFH,"\\AA ", "Å")) + | "\\AA" -> LITERAL (HTMLABLE (FONT_UFH,"\\mbox{\\AA}", "Å")) | "\\cdots" -> LITERAL (HTMLABLE (FONT_UFH,"\\cdots ", "⋅⋅⋅")) | "\\sdot" -> LITERAL (HTMLABLE (FONT_UFH,"\\cdot ", "⋅")) | "\\oplus" -> LITERAL (HTMLABLE (FONT_UF, "\\oplus ", "⊕")) diff --git a/texvccheck/texutil.ml b/texvccheck/texutil.ml index d8d9a1f48..21d7987a1 100644 --- a/texvccheck/texutil.ml +++ b/texvccheck/texutil.ml @@ -43,8 +43,7 @@ let rec render_tex = function exception Illegal_tex_function of string let find cmd = match cmd with - "\\AA" - | "\\aleph" + "\\aleph" | "\\alpha" | "\\amalg" | "\\And" @@ -422,7 +421,6 @@ let find cmd = match cmd with | "\\swarrow" | "\\tau" | "\\textstyle" - | "\\textvisiblespace" | "\\therefore" | "\\theta" | "\\Theta" @@ -586,6 +584,7 @@ let find cmd = match cmd with | "\\over" -> FUN_INFIX( cmd ^ " " ) + | "\\AA" | "\\Coppa" | "\\coppa" | "\\Digamma" @@ -600,6 +599,7 @@ let find cmd = match cmd with | "\\sampi" | "\\Stigma" | "\\stigma" + | "\\textvisiblespace" | "\\varstigma" -> LITERAL ( TEX_ONLY( "\\mbox{" ^ cmd ^ "} " ) )