bad_coder
bad_coder

Reputation: 12930

Macro URL anchor substitution with MathJax in docstring

I have this docstring with a math directive that has a very long anchor pointing to the same page:

class MyClass:
    r"""Intro text.

    .. math::

        \href{#the_very_long_anchor}{the URL text}
    """

This works! But to satisfy the usual 80 char docstring limit (in the example it's shortened and without nesting) I need to line break the anchor. I tried using the usual Python string techniques but none of them worked because apparently Sphinx/MathJax doesn't correctly join the string in the anchor if I do. I don't want to move the directive to the .rst thus line breaking using reST isn't an option.

So I want to add a Latex macro directly in the math directive block to substitute the the_very_long_anchor. How to do it?

Upvotes: 0

Views: 69

Answers (0)

Related Questions