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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B1028BB84 for ; Sun, 1 Jun 2008 11:46:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwAADoNQkjAXQIno2dsb2JhbACSCwEBAQEBCAUIBxGZMA X-IronPort-AV: E=Sophos;i="4.27,573,1204498800"; d="scan'208";a="11399941" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 01 Jun 2008 11:46:29 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m519kOpp007222 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 1 Jun 2008 11:46:29 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABADoNQkjC2fJYb2dsb2JhbACSCwEMBQIGBRMDmS0 X-IronPort-AV: E=Sophos;i="4.27,573,1204498800"; d="scan'208";a="13041599" Received: from anchor-post-30.mail.demon.net ([194.217.242.88]) by mail1-smtp-roc.national.inria.fr with ESMTP; 01 Jun 2008 11:46:24 +0200 Received: from orion.metastack.com ([80.177.38.218]) by anchor-post-30.mail.demon.net with esmtp (Exim 4.67) id 1K2k8u-000DZv-0m for caml-list@inria.fr; Sun, 01 Jun 2008 09:46:24 +0000 Received: from countertenor (156-32-32-212.diowest-ll.ll.ftech.net [212.32.32.156] (may be forged)) (authenticated bits=0) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id m519c4iV030105 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sun, 1 Jun 2008 10:38:05 +0100 From: "David Allsopp" To: References: <4841A6FF.6050203@gushee.net> Subject: RE: [Caml-list] ocamldoc-latex error Date: Sun, 1 Jun 2008 10:46:09 +0100 Organization: MetaStack Solutions Ltd. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4841A6FF.6050203@gushee.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Thread-Index: AcjDU30v0Ju2ayrGSmyDdPGrUjXytQAdtrMg X-Scanned-By: MIMEDefang 2.63 on 172.16.28.218 X-Miltered: at concorde with ID 48426FF1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camomile:01 'make:01 bug:01 bug:01 ocamldoc:01 ocamldoc:01 odoc:01 def:01 ned:98 verb:01 verb:01 caml-list:01 tex:01 tex:01 argument:02 > I just compiled Camomile 0.7.1, and generated the latex documentation > with 'make doclatex'. Much to my surprise, when I attempt to process the > LaTeX file with either the 'latex' or 'pdflatex' program, I get the > following error: > > ! You can't use `macro parameter character #' in horizontal mode. > ...n Unicode Technical Report \verb `## > `21 > l.9 ...ned in Unicode Technical Report \verb`#`21} This is not a TeX bug, as you correctly surmised... > I am using TeXLive 2007.2 ... given the caution with which TeX is > developed, it's hard to believe this is a bug in the TeX distribution. > On the other hand, it's hard to believe that OCamlDoc is generating > incorrect LaTeX code. Maybe some misconfiguration in my TeX > installation? Any hints appreciated. > > BTW, if I edit the generated LaTeX file, replacing every instance of > \verb`#` with \#{}, it runs fine. ocamldoc should be doing this -- the \catcode value for # is 6 (The TeXbook, pp. 37, 343) which means that it cannot be used as a basic character. Note that # only needs to be written \# -- the braces are unnecessary as \# is a parameter-less macro (in fact, it's a \chardef). From what I can see, the bug is on line 89 of ocamldoc/odoc_latex.ml. Without seeing the faulty TeX file, I can't confirm it for certain, but I would imagine that the problem is that \verb is being used inside a \def or \newcommand which won't work without a lot of (unnecessary) \catcode trickery surrounding the macro definition. You could possibly say that it's a bug in LaTeX because \verb should really be declared \outer in the LaTeX sources but that's a bit off-topic for this list... David