Conversation
| import sphinxcontrib.katex as katex | ||
|
|
||
| sys.path.insert(0, os.path.abspath('.')) | ||
| from math_definitions import latex_macros |
There was a problem hiding this comment.
This is a little bit ugly, but we could also do the latex_macros definition directly in conf.py.
|
Thanks! AFAIK, KaTeX still doesn't support environments like As long as that's not the case, I'm hesitating to switch.
I don't think that's true. It's also possible in MathJax: https://docs.mathjax.org/en/latest/tex.html#defining-tex-macros We would just have to write some conversion code like you did in https://github.com/hagenw/sphinxcontrib-katex/blob/52e235b93a2471df9a7477e04b697e4274399623/sphinxcontrib/katex.py#L32-L68. I've just create #82 for yet another alternative. |
|
That's correct, I never needed the equation environment with rst so far, but I guess it might be of interest for Jupyter notebooks? If it should be just interpreted as a math limiter it could easily been added to But it's totally fine with me if we go with #82 for now. |
Exactly. I've created yet another alternatve: #90. I do like the explicit use of .. include:: math-definitions.rstI think defining the stuff in And if my PR jupyterlab/jupyterlab#5997 is accepted, a similar method will be available for Jupyter notebooks. My PR #90 doesn't preclude switching to KaTeX at some point, because AFAIK |
|
I've merged #90 which solves the original problem. We can still discuss switching to KaTeX at some point in the future. |
|
Yes, don't worry, there is no urgent need. |
This is an alternative to #80.
LaTeX definitions can be easier integrated by using KaTeX instead of mathjax.
This avoids including the LaTeX definitions several times as they are just passed once to the LaTeX preamble.