RUser4512 - 1 year ago 126

LaTeX Question

I would like to include equations in a documentation generated with ocamldoc. I am using a small (bat) script :

`ocamldoc -latex maths.ml`

pdflatex ocamldoc.out

where maths.ml contains the following comments :

`(** "Given a list of indices \\( v \\) and a vector of weights \f$ w \f$, this returns $ sum_iw_{v_i} $"*)`

let dot_product indices weights = [...]

However, the only thing produced in the pdf file is :

`val dot_product : int list -> float array -> float`

"Given a list of indices \\( v \\) and a vector of weights \f$ w \f$, this returns $ sum_iw_

$"

I tried various ways to indicate the equations ($, \f$, \( ) but none of these were identified. Is there a specific way to indicate equations for them to be recognized by ocamldoc ?

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

You can use target specific formatting:

```
{%latex: ... %}
```

Note that in general `ocamldoc`

documentation is rendered to HTML rather than PDFs. So I would not take advantage of that directive and/or care for the HTML output. For sub/super scripts the ocamldoc language supports them directly. For HTML specific output simply do

```
{%html: ... %}
```

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**