sphinx-extensions2 / sphinx-tippy

Get rich tool tips in your sphinx documentation!
https://sphinx-tippy.readthedocs.io
MIT License
33 stars 5 forks source link

Math Not Rendering in sphinx-tippy Tooltips for Admonition References #22

Closed mscharling closed 4 months ago

mscharling commented 4 months ago

Environment: Python Version: 3.8.10 Sphinx Version: 4.5 sphinx-tippy Version: 0.4.3 Jupyter Book Version: 0.15.1

Expected Behavior: I would expect that LaTeX or MathJax formatted mathematics within sphinx-tippy tooltips, especially when these tooltips reference content from sphinx-proof admonitions, should render correctly, similar to other parts of my Jupyter Book documentation.

Actual Behavior: Unfortunately, I've noticed that mathematical expressions within sphinx-tippy tooltips that reference sphinx-proof admonitions do not render as expected. Instead of seeing formatted mathematics, the raw LaTeX strings are displayed.

Steps to Reproduce:

  1. Set up sphinx-tippy in a Jupyter Book project incorporating sphinx-proof for creating structured content like theorems.
  2. Include a LaTeX expression in a tooltip that references a theorem or an admonition.
  3. Build the Jupyter Book and hover over the referenced tooltip.
  4. Note that the tooltip displays the raw LaTeX markup instead of the expected formatted mathematical expression.
mscharling commented 4 months ago

Closing this, since I found the solution. The solution is a combination of #6 and the fact tippy_enable_mathjax: false by default. Adding the following to my _config.yml file did the trick:

sphinx:
  config:
    tippy_enable_mathjax: true
    tippy_tip_selector: 'figure, table, img, p, aside, div.admonition, div.math'