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
This commit is contained in:
C. Scott Ananian 2014-07-24 15:13:10 -04:00 committed by physikerwelt (Moritz Schubotz)
parent 3d0b787cbe
commit b8161615f4
2 changed files with 5 additions and 5 deletions

View File

@ -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 ", "⊕"))

View File

@ -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 ^ "} " ) )