]> 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 2957a3975446f48c3c0c69e763d3ba45eccd43cc..b9bb9fbbd5badc06ef55a36ca418471731559db2 100644 (file)
@@ -31,7 +31,7 @@ module Pres = Mpresentation
 
 let string_space = " "
 let string_space_len = String.length string_space
-let string_indent = string_space
+let string_indent = (* string_space *) ""
 let string_indent_len = String.length string_indent
 let string_ink = "##"
 let string_ink_len = String.length string_ink
@@ -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