在 ocamldoc 中包含数学方程式
Include math equation with ocamldoc
我想在用 ocamldoc 生成的文档中包含方程式。我正在使用一个小的 (bat) 脚本:
ocamldoc -latex maths.ml
pdflatex ocamldoc.out
其中 maths.ml 包含以下注释:
(** "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 = [...]
然而,pdf文件中唯一产生的是:
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_
$"
我尝试了各种方式来表示方程式 ($, \f$, \( ) 但其中 none 被识别出来了。是否有一种特定的方式来表示方程式以供 ocamldoc 识别?
您可以使用 target specific formatting:
{%latex: ... %}
请注意,通常 ocamldoc
文档会呈现为 HTML 而不是 PDF。所以我不会利用该指令 and/or 关心 HTML 输出。对于 sub/super 脚本,ocamldoc language 直接支持它们。对于 HTML 特定输出只需执行
{%html: ... %}
我想在用 ocamldoc 生成的文档中包含方程式。我正在使用一个小的 (bat) 脚本:
ocamldoc -latex maths.ml
pdflatex ocamldoc.out
其中 maths.ml 包含以下注释:
(** "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 = [...]
然而,pdf文件中唯一产生的是:
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_
$"
我尝试了各种方式来表示方程式 ($, \f$, \( ) 但其中 none 被识别出来了。是否有一种特定的方式来表示方程式以供 ocamldoc 识别?
您可以使用 target specific formatting:
{%latex: ... %}
请注意,通常 ocamldoc
文档会呈现为 HTML 而不是 PDF。所以我不会利用该指令 and/or 关心 HTML 输出。对于 sub/super 脚本,ocamldoc language 直接支持它们。对于 HTML 特定输出只需执行
{%html: ... %}