From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 0FE03BC6B for ; Fri, 22 Jun 2007 21:07:05 +0200 (CEST) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5MJ74AA003604 for ; Fri, 22 Jun 2007 21:07:04 +0200 Received: from [192.168.1.111] (vil93-4-82-227-140-227.fbx.proxad.net [82.227.140.227]) by smtp5-g19.free.fr (Postfix) with ESMTP id 938324501B for ; Fri, 22 Jun 2007 21:07:04 +0200 (CEST) Message-ID: <467C1DD6.1050705@philippewang.info> Date: Fri, 22 Jun 2007 21:07:02 +0200 From: Philippe Wang User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509) MIME-Version: 1.0 To: ocaml ml Subject: Caml code listing inside LaTeX Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 467C1DD8.001 on discorde : j-chkmail score : XXXXX : 10/20 0 0.000 -> 5 X-Miltered: at discorde with ID 467C1DD8.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; backslash:01 ocamllex:01 ocaml:01 camlp:01 cheers:01 treatments:98 tea:98 macros:01 strings:01 caml:02 caml:02 color:97 latex:02 latex:02 bugs:03 Hi, If ever you are interested in putting some caml code inside your latex document, *without* using verbatim environment or listings package, the online tool : http://philippewang.info/cs.tools.camltotex.php (*) takes some caml code and returns LaTeX code. The applied treatments are : - colors - nested comments (even with strings such as "*)" inside) are detected - based on LaTeX macros such as \DeclareTextSymbol{\BS}{T1}{92} % backslash \newcommand{\mlkeyword}[1]{\mbox{\color{red}{#1}}} - the code is put in a tabular environment Well, it's very small : 300 lines of code for the moment (about 230 lines of ocamllex and 30 lines of ocaml...). It could have certainly been written in camlp4 or in latex, but well, they are not (yet) my cup of tea. Hopefully, it will be released under a free license next month (if you are interested in this program, which license do you want ?) The main goals are : - no use of verbatim, so that it can be used with beamer without the [fragile] option - no use of the listings package (because it don't like it) It certainly contains bugs, it was never proved or certified, and probably never will be... Cheers, -- Philippe Wang mail[at]philippewang.info (*) I used php because cgi in pure caml is very complicated on the hosting server