-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
This is more of a question than a bug, but I am trying to add contextual menus when using component/tex2svg-page, but it is not working. From what I can tell, it should be using the combined component, tex-svg.js and this should "just work", but I don't see the contextual menu. I've tried manually loading ui/menu and setting enableMenu: true, as per the docs:
https://docs.mathjax.org/en/latest/web/components/misc.html#menu-component
diff --git a/component/tex2svg-page b/component/tex2svg-page
index ef17c7d..1667847 100755
--- a/component/tex2svg-page
+++ b/component/tex2svg-page
@@ -68,14 +68,18 @@ const htmlfile = require('fs').readFileSync(argv._[0], 'utf8');
// Configure MathJax
//
MathJax = {
+ options: {
+ enableMenu: true
+ },
loader: {
paths: {mathjax: 'mathjax-full/es5'},
source: (argv.dist ? {} : require('mathjax-full/components/src/source.js').source),
require: require,
- load: ['adaptors/liteDOM']
+ load: ['adaptors/liteDOM', 'ui/menu']
},
tex: {
- packages: argv.packages.replace('\*', PACKAGES).split(/\s*,\s*/)
+ packages: argv.packages.replace('\*', PACKAGES).split(/\s*,\s*/),
+ inlineMath: [['\\$', '\\$'], ['\\(', '\\)']]
},
svg: {
fontCache: argv.fontCache,
But then I get:
> node ./tex2svg-page --dist /tmp/mathjax.html > /tmp/mathjax-svg.html
MathJax: Invalid option "enableMenu" (no default value).