# Wrong Latex output for variant types #7488

Closed
opened this issue Feb 18, 2017 · 4 comments
Closed

# Wrong Latex output for variant types#7488

opened this issue Feb 18, 2017 · 4 comments
Assignees
Labels

### vicuna commented Feb 18, 2017

Original bug ID: 7488
Reporter: @xavierleroy
Assigned to: @Octachron
Status: resolved (set by @gasche on 2017-02-19T00:36:08Z)
Resolution: fixed
Priority: high
Severity: minor
Version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: ocamldoc

## Bug description

Consider the following type declaration in a .mli file:

type t =
| A (** This is case A )
| B (
* This is the other case, B *)

ocamldoc -latex produces:

\label{type:Foo.t}\begin{ocamldoccode}
type t =
\end{ocamldoccode}
| A\begin{ocamldoccomment}
This is case A

\end{ocamldoccomment}
| B\begin{ocamldoccomment}
This is the other case, B

\end{ocamldoccomment}

Notice that "| A" and "| B" are outside the ocamldoccode environment, causing LaTeX to render them incorrectly.

(Edited from original report) The problem doesn't happen consistently. For example, running ocamldoc on unix.mli from the 4.05 working sources, the "process_status" type is correctly formatted.
(End edit.)

There are many instances of this problem in the PDF manual for the working sources (4.05-dev), so if it could be solved by the 4.05 release this would be great.

### vicuna commented Feb 18, 2017

 Comment author: @Octachron I can reproduce (and fix) the first failing case, but I am bit worried that I cannot reproduce the second counter-example: the latex output is still incorrect when I look at the generated latex code?

### vicuna commented Feb 18, 2017

 Comment author: @Octachron A possible fix is proposed here: #1053.

### vicuna commented Feb 19, 2017

 Comment author: @gasche Fixed using Octachron's patch.
closed this Feb 19, 2017

### vicuna commented Feb 19, 2017

 Comment author: @xavierleroy Thanks for the super-fast reply! The second part of my report (about comments on their own lines) was completely wrong. I edited it for the record.