admin管理员组文章数量:1426123
I have a text editor in which a user can write HTML code. I don't want them to write LaTeX outside of a particular element. It might be something like:
<x-latexmath>...</x-latexmath>
I want it so if they have LaTeX math outside of that tag, it's just displayed as normal text. How might this be possible?
I have a text editor in which a user can write HTML code. I don't want them to write LaTeX outside of a particular element. It might be something like:
<x-latexmath>...</x-latexmath>
I want it so if they have LaTeX math outside of that tag, it's just displayed as normal text. How might this be possible?
Share Improve this question asked Jul 1, 2012 at 22:11 Phlox MidasPhlox Midas 4,3694 gold badges40 silver badges58 bronze badges 1-
3
elements
: mathjax/docs/2.0/options/hub.html – mu is too short Commented Jul 1, 2012 at 22:25
1 Answer
Reset to default 11MathJax doesn't have a way to use user-defined tags to trigger math processing, but you can use MathJax's tex2jax preprocessor's processClass
and ignoreClass
parameters to allow you to control which parts of the page to process. See the text2jax configuration for details, but the idea would be to use
<body class="tex2jax_ignore">
...
<span class="tex2jax_process">...</span>
...
</body>
so that the main part of the page isn't processed, and only the span's (or div's if you prefer) containing the mathematics will be processed by MathJax.
本文标签: javascriptCan MathJax be made to only convert LaTeX if it39s inside a certain tagStack Overflow
版权声明:本文标题:javascript - Can MathJax be made to only convert LaTeX if it's inside a certain tag? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745388823a2656500.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论