Avatar

mathjax for tex support (General)

by Auge ⌂ @, Monday, May 14, 2018, 07:26 (187 days ago) @ Milo

Hello

here an example of how it (could) work

<html>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<script type="text/x-mathjax-config">/*<![CDATA[*/MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ["$","$"], ["\\(","\\)"] ],
displayMath: [ ["$$","$$"], ["\\[","\\]"] ],
ignoreClass: "tex2jax_ignore",
processClass: "tex2jax_process",
processEscapes: true
},
TeX: {
equationNumbers: { autoNumber: "AMS" }
}
});
/*!]]>*/</script>
 
 
<body class="tex2jax_ignore">
 
<p>Some Text with TeX <span class="tex2jax_process">\sin{x} = y</span></p>
<p>Some Text with TeX <span class="tex2jax_process">$\sin{x} = y$</span></p>
<p>Some Text with TeX <span class="tex2jax_process">$$\sin{x} = y$$</span></p>
 
</body>
 
</html>

Deactivating the parsing globally and activating it locally. Looks interesting.

We need to define two classes e.g. tex2jax_ignore for ignoring TeX and tex2jax_process for parsing equations. Thus, the [tex]-Tag must replaced by (in my example) <span class="tex2jax_process">...</span> or, to be downwards compatible with the current solution, by <span class="tex2jax_process">$...$</span>.

This would be a parallel way beside the old image-replacement-with-URL-to-a-external-service? If so, the setting bbcode_tex, currently storing the URL to the external service should be an on-off-switcher instead like the other bbcode_*-settings, and the URL should move to a different setting (IMHO).

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread

powered by my little forum