1 (* Copyright (C) 2000-2002, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://cs.unibo.it/helm/.
26 (***************************************************************************)
30 (* Andrea Asperti <asperti@cs.unibo.it> *)
34 (***************************************************************************)
38 let mpres_document pres_box =
39 Xml.add_xml_declaration (CicNotationPres.print_box pres_box)
41 let ntxt_of_cic_sequent ~map_unicode_to_tex size status metasenv subst sequent =
42 let content_sequent,ids_to_refs =
43 NTermCicContent.nmap_sequent status ~metasenv ~subst sequent in
45 Sequent2pres.nsequent2pres ids_to_refs subst content_sequent in
46 let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
47 BoxPp.render_to_string ~map_unicode_to_tex
48 (function x::_ -> x | _ -> assert false) size pres_sequent
50 let ntxt_of_cic_object ~map_unicode_to_tex size status obj =
51 let cobj,ids_to_nrefs = NTermCicContent.nmap_obj status obj in
52 let pres_sequent = Content2pres.ncontent2pres ~ids_to_nrefs cobj in
53 let pres_sequent = CicNotationPres.mpres_of_box pres_sequent in
54 BoxPp.render_to_string ~map_unicode_to_tex
55 (function x::_ -> x | _ -> assert false) size pres_sequent