From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8B0B3BCAB for ; Mon, 30 May 2005 12:41:04 +0200 (CEST) Received: from pih-relay04.plus.net (pih-relay04.plus.net [212.159.14.131]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4UAf3ug027235 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 30 May 2005 12:41:04 +0200 Received: from [80.229.56.224] (helo=chetara) by pih-relay04.plus.net with esmtp (Exim) id 1Dchhd-0000hA-DG for caml-list@yquem.inria.fr; Mon, 30 May 2005 11:41:01 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Syntaxe Caml en LaTeX Date: Mon, 30 May 2005 11:40:10 +0100 User-Agent: KMail/1.7.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505301140.11135.jon@ffconsultancy.com> X-Miltered: at concorde with ID 429AEDBF.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syntaxe:01 syntax:01 tuareg:01 emacs:01 ocaml:01 treating:01 snippets:01 ocaml:01 25,:98 2005,:98 ...:98 frog:98 wrote:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Monday 30 May 2005 00:25, Martin Jambon wrote: > On Sun, 29 May 2005, Pierre-Etienne Meunier wrote: > > 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 ? > > 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/). I wrote a little program to color syntax-highlight LyX files by treating anything in typewriter font as code. This has several advantages - no need to annotate by hand, code can be extracted and even tested, easy to alter the document self-consistently and so on. I chose to put all code snippets on their own minipage, to help lay them out aesthetically. However, LaTeX does a poor job of distributing them on the page, so any alterations to the document need to be carefully checked to make sure the LaTeX output hasn't become very ugly (e.g. huge gaps). I think the solution I used works reasonably well but there is plenty of room for improvement. Ideally, I'd like to get rid of LaTeX... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists