How to use mathjax tex2svg-page without separate components?
brunobmello25 opened this issue · 1 comments
Looking at this repository it mentions how to use mathjax separate components to customize the way I want, but it doesn't mention what package I need to import if I want to use just the basics of tex2svg-page.
Additionally, it doesn't specify how can I setup a custom inline math selector, like the way we do on the client side:
window.MathJax = {
tex: {
inlineMath: [
[
'$', '$'
]
],
};
The code for all the examples are available in this repository. But since there are several different ways to include MathJax, depending on your needs, the examples are broken down by the mechanism used. You probably want to component-based examples, such as tex2svg-page
. You may not need all the command-line processing, so some simplification is possible. See the main README for the high-level description of how all the examples in the components directory work.
The key lines are
MathJax-demos-node/component/tex2svg-page
Lines 92 to 110 in 6ffe557
Line 95 could be simplified to
require('mathjax-full/es5/tex-svg.js');
and
MathJax-demos-node/component/tex2svg-page
Lines 103 to 107 in 6ffe557
are just to handle case where the page has no math in it (so that the unneeded CSS styles aren't included), so you might be able to remove those as well. What's left, together with the configuration, is the code you need to have MathJax process a page for you. Be sure to read about the configuration in the README linked above.