latex - Mathjax expression in sphinx python not rendering correclty -
i've been trying figure out what's wrong expression in docstring. i'm using sphinx.ext.mathjax
extension in python sphinx v1.2b. docstring:
.. math:: w_k^* = \min_{w_k} \ell_k(w_k) + \lambda\left(\alpha||w_k||_1 + \frac{1}{2}(1-\alpha) ||w_k||^2\right)
this appears:
but continues generate strange warning , not render expression @ all:
warning: block quote ends without blank line; unexpected unindent.
strangely enough, if remove \alpha
, \left
, \right
, \frac
symbols, expression renders fine without warnings. not sure why \lambda
supported , not \alpha
.
from sphinx documentation:
keep in mind when put math markup in python docstrings read autodoc, either have double backslashes, or use python raw strings (
r"raw"
).
this needed latex commands, such \alpha
, interpreted correctly (\a
, few other sequences have special meaning in string literal).
Comments
Post a Comment