X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcontent_pres%2FboxPp.ml;h=0c18475489b076db0fc5aa1feeb262ec83e21ca9;hb=8c4659819a1c1f2e450d9a588ecca37d95ae48e9;hp=b9bb9fbbd5badc06ef55a36ca418471731559db2;hpb=407ff2f7c09ddd90eae6f390006ffe801b683164;p=helm.git diff --git a/helm/software/components/content_pres/boxPp.ml b/helm/software/components/content_pres/boxPp.ml index b9bb9fbbd..0c1847548 100644 --- a/helm/software/components/content_pres/boxPp.ml +++ b/helm/software/components/content_pres/boxPp.ml @@ -93,7 +93,7 @@ let fixed_rendering s = let s_len = String.length s in (fun _ -> s_len, [s]) -let render_to_strings choose_action size markup = +let render_to_strings ~map_unicode_to_tex choose_action size markup = let max_size = max_int in let rec aux_box = function @@ -193,14 +193,17 @@ let render_to_strings choose_action size markup = | Pres.Mgliph (_, s) -> fixed_rendering s | Pres.Mo (_, s) -> let 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 + if map_unicode_to_tex then begin + 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 ^ " " + end else + 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 @@ -237,6 +240,7 @@ let render_to_strings choose_action size markup = in snd (aux_mpres markup size) -let render_to_string choose_action size markup = - String.concat "\n" (render_to_strings choose_action size markup) +let render_to_string ~map_unicode_to_tex choose_action size markup = + String.concat "\n" + (render_to_strings ~map_unicode_to_tex choose_action size markup)