mathjax / mathjax/MathJax-demos-node
Unable to add contextual menus when using component/tex2svg-page
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 114
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
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).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with component/tex2svg-page and the menu-component documentation linked in the issue, then run the shown node command with the reported configuration. Trace why enableMenu is rejected and why the contextual menu is absent; done means the page renders with a working contextual menu without the invalid-option error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100