caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamldoc-latex error
@ 2008-05-31 19:29 Matt Gushee
  2008-06-01  9:46 ` [Caml-list] " David Allsopp
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Gushee @ 2008-05-31 19:29 UTC (permalink / raw)
  To: caml-list

Hello, all--

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.
   <argument> ...n Unicode Technical Report \verb `##
                                                   `21
   l.9 ...ned in Unicode Technical Report \verb`#`21}

   ?
   ! Emergency stop.
   <argument> ...n Unicode Technical Report \verb `##
                                                   `21
   l.9 ...ned in Unicode Technical Report \verb`#`21}


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.

-- 
Matt Gushee
: Bantam - lightweight file manager : matt.gushee.net/software/bantam/ :
: RASCL's A Simple Configuration Language :     matt.gushee.net/rascl/ :


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [Caml-list] ocamldoc-latex error
  2008-05-31 19:29 ocamldoc-latex error Matt Gushee
@ 2008-06-01  9:46 ` David Allsopp
  0 siblings, 0 replies; 2+ messages in thread
From: David Allsopp @ 2008-06-01  9:46 UTC (permalink / raw)
  To: caml-list

> 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.
>    <argument> ...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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-01  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-31 19:29 ocamldoc-latex error Matt Gushee
2008-06-01  9:46 ` [Caml-list] " David Allsopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).