mathjax / mathjax/MathJax-demos-node

tex2svg-page: error handling non-math symbols

Open
#16 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Accepted
Dominant language
JavaScript
Stars
114
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Running tex2svg-page on the following html file succeeds:

<html>
  <body>
    <div>$$ x^2 $$</div>
  </body>
</html>

However, once you add the copyright symbol, anywhere in the page, it fails:

<html>
  <body>
    <div>$$ x^2 $$</div>
    &copy;
  </body>
</html>

with the following error:

MathJax(?): Can't find handler for document
(node:2116796) UnhandledPromiseRejectionWarning: Error: Cannot find module 'mathjax-full/es5/util/entities/c.js'

This behavior isn't changed even if the symbol is placed inside a footer tag, and the footer tag added to ignore in the mathjax configuration. If my understanding here is correct, this suggests two possible issues:

  1. There are missing files in the node mathjax distribution
  2. Mathjax processes areas of html that it should ignore

My use-case is pre-rendering math for a static website -I'm specifically looking for a script that will output an html file with math rendered in the same way as if the mathjax javascript were included on the page, and tex2svg-page seemed like a perfect fit here. I'd really appreciate any guidance you might have on these issues.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tex2svg-page entry point and reproduce the failure using the HTML examples in the issue. Inspect how the command handles the copyright entity and the MathJax document handler, including the reported mathjax-full/es5/util/entities/c.js module error. Done means the page renders its math without failing when the non-math copyright symbol is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.