mitya57 / python-markdown-math

Math extension for Python-Markdown
https://pypi.org/project/python-markdown-math/
BSD 3-Clause "New" or "Revised" License
120 stars 27 forks source link

Can I modify the inline tex delimiters? #27

Closed derekahuang closed 4 years ago

derekahuang commented 4 years ago

I tried using tex2jax but it doesn't seem to modify the $$ delimiter, which I want to switch to inline. I also tried upgrading to MathJax3 but that seems to cause no rendered text to display. Is there an effective way to make the $$ an inline delimiter? Thanks!

derekahuang commented 4 years ago

This is what I have used so far, which is not working. The $$ still renders as displayMath

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      extensions: ["MathMenu.js", "MathZoom.js", "tex2jax.js"],
        tex2jax: {
            inlineMath: [ ["$$", "$$"]],
            displayMath: [ ["\\[", "\\]"] ],
            processEscapes: true
        },
        jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
    });
</script>
mitya57 commented 4 years ago

No, currently this extension does not support switching $$ delimiter to inline. The only thing I can suggest is forking this extension and changing the patterns in the code.