From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 72021BCAC for ; Mon, 30 May 2005 01:26:16 +0200 (CEST) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j4TNQFKd020869 for ; Mon, 30 May 2005 01:26:16 +0200 Received: from frontend2.messagingengine.com (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id 3648DC94C40; Sun, 29 May 2005 19:26:14 -0400 (EDT) X-Sasl-enc: iV+M5Or2FdTuZKzLq58CJ9OxtwguoKFmRA204Lgi0BDOZiRDYzeCfRGCRWwM 1117409171 Received: from [172.16.13.147] (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id 2A83957030B; Sun, 29 May 2005 19:26:10 -0400 (EDT) Date: Sun, 29 May 2005 16:25:58 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@localhost To: Pierre-Etienne Meunier Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Syntaxe Caml en LaTeX In-Reply-To: <4299ACEA.5050901@free.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Miltered: at nez-perce with ID 429A4F97.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syntaxe:01 d'integrer:01 syntaxe:01 tuareg:01 emacs:01 amicalement:01 syntax:01 tuareg:01 emacs:01 ocaml:01 reuse:01 ocaml:01 parser:01 2005,:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On Sun, 29 May 2005, Pierre-Etienne Meunier wrote: > Bonjour, > > Je voudrais savoir s'il y a un moyen d'intégrer les couleurs de syntaxe > Caml (comme avec tuareg dans emacs) dans une page LaTeX, pour rendre le > code présentable. > Amicalement, > Pierre-Etienne Meunier (meunier.pe@free.fr) > > Here comes the english version : > > I'd like to include Caml code in a LaTeX file, but since it is pretty > big, I want it to be easily readable. Then I want to keep the colored > syntax, like in tuareg for emacs. Do you know how to do it ? > Best regards, > Pierre-Etienne Meunier (meunier.pe@free.fr) I don't know what people have used so far (you can ask Jon Harrop what he used for his book http://www.ffconsultancy.com/products/ocaml_for_scientists/). One solution would be to adapt Caml2html (http://martin.jambon.free.fr/caml2html.html). You can either (1) start an independent Caml2latex library/executable and reuse some code from Caml2html, or (2) make Caml2html polyglot. IMO solution (1) is better than (2) since the OCaml parser does not require a lot of maintenance as opposed to the formatting options which are not really reusable anyway. Otherwise, you can convert your program to colorized PostScript with enscript (ask Janne Hellsten, google for "ocaml and enscript") or directly from emacs. Martin -- Martin Jambon, PhD http://martin.jambon.free.fr