1

I'm using sphinx autodoc to translate my docstring to a nice documentation page. In the docstring I'm following numpy's docstring guideline by using the sphinx napoleon extension. I'm wondering about the following: If I have an equation like

"""
This is a very important equation which is used in the code

.. math::

     a+b=c
   :label: important_eq
"""

the autodoc doesn't recognize the :label:. Do I have a wrong formatting or can't autodoc / mathjax / napoleon deal with labels in equations?

barryhunter
  • 20,886
  • 3
  • 30
  • 43
math
  • 1,868
  • 4
  • 26
  • 60

1 Answers1

1

Be careful with whitespace and indentation. This works:

.. math::
   :label: important_eq

   a+b=c

This works too (when the math content is only one line of text, it can be given as a directive argument):

.. math:: a+b=c
   :label: important_eq
mzjn
  • 48,958
  • 13
  • 128
  • 248