Hyperlink in Sphinx math mode

45 views Asked by At

I'm trying to write some large set of formula in sphinx. Since there are a lot of variables depending on each other, I want to reference them in the formula. I treed several approaches but don't have any clue on how to proceed.

Here is a small example that should show what I'm aiming for (conf.py is taken directly from sphinx-quickstart)


..    _target:

Target Header
-------------

This is a link :ref:`target`

.. math::

   :ref:`target` = \hyperlink{target}{target} + \hyperref[target]{target}

Neither the sphinx-role nor the latex hyperref/link are resolved to a proper linked text. Instead, they are used as plain text in the equation. This applies to both building a html as well as a latex->pdf.

I'd appreciate any clue on what's the cause for this and possibly how to achieve links in math environments.

0

There are 0 answers