]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/boxPp.ml
1. bug fixed: Unicode characters that are not mapped to TeX macros used to
[helm.git] / helm / software / components / content_pres / boxPp.ml
index 53149877ea73a1eb71e3c5b2f75ec4f7f78df552..b9bb9fbbd5badc06ef55a36ca418471731559db2 100644 (file)
@@ -193,13 +193,14 @@ let render_to_strings choose_action size markup =
     | Pres.Mgliph (_, s) -> fixed_rendering s
     | Pres.Mo (_, s) ->
         let s =
-          if String.length s > 1 then
-            (* heuristic to guess which operators need to be expanded in their
-             * TeX like format *)
-            Utf8Macro.tex_of_unicode s ^ " "
-          else s
+         if String.length s = 1 && Char.code s.[0] < 128 then
+          s
+         else
+          match Utf8Macro.tex_of_unicode s with
+             Some s -> s ^ " "
+           | None -> s
         in
-        fixed_rendering s
+         fixed_rendering s
     | Pres.Mspace _ -> fixed_rendering string_space
     | Pres.Mrow (attrs, children) ->
         let children' = List.map aux_mpres children in