<entities-table>
<entity name="def" value="≝"/> <!-- ≝ -->
+ <entity name="neq" value="≠"/> <!-- ≠ -->
</entities-table>
Hashtbl.find Utf8MacroTable.macro2utf8 macro
with Not_found -> raise (Macro_not_found macro)
+let unicode_of_tex s =
+ try
+ if s.[0] = '\\' then
+ expand (String.sub s 1 (String.length s - 1))
+ else s
+ with Macro_not_found _ -> s
+
exception Macro_not_found of string
exception Utf8_not_found of string
- (* @param macro name
+ (** @param macro name
@return utf8 string *)
val expand: string -> string
+ (** @param tex TeX like command (e.g. \forall, \lnot, ...)
+ * @return unicode character corresponding to the command if it exists, or the
+ * unchanged command if not *)
+val unicode_of_tex: string -> string
+
let _ = Hashtbl.add macro2utf8 "auml" "\195\164"
let _ = Hashtbl.add macro2utf8 "bmod" "mod"
let _ = Hashtbl.add macro2utf8 "SquareSuperset" "\226\138\144"
+let _ = Hashtbl.add macro2utf8 "neq" "\226\137\160"
let _ = Hashtbl.add macro2utf8 "circleddash" "\226\138\157"
let _ = Hashtbl.add macro2utf8 "xrarr" "\239\149\183"
let _ = Hashtbl.add macro2utf8 "barwed" "\226\138\188"