Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MathJax version (3.2.0 -> 3.2.2) #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

matssson
Copy link

Updates mathjax-full to 3.2.2 and fixes a rendering error in the test files.

I've tested it and it works the same as before, the only "issue" is that there is the following warning when using MathJax 3.2.1+
No version information available for component xypic.js
which ideally should've gone away by uplifting and building with a newer version of MathJax.

I've been trying to get the version info into the component when packing and have looked through the following issues trying to figure it out.
mathjax/MathJax-src#738
mathjax/MathJax-src#818

A workaround would be to just suppress the version warnings, but I guess it's an easy fix if you know where the version-info should go.

@dpvc
Copy link

dpvc commented Jan 20, 2025

I guess it's an easy fix if you know where the version-info should go.

This is normally inserted automatically when you have a build.json file and use MathJax's components/bin/makeAll (or components/bin/build) command. This is what makes your exported variables available in the MathJax._ hierarchy so that other packages can build against yours, like you are building against the tex-base, core, chtml, and svg packages. It's not strictly necessary, but it does make it possible to share code with other packages.

To do it by hand, you would need to add

import {VERSION} from 'mathjax-full/js/components/version.js';

if (MathJax.loader) {
  MathJax.loader.checkVersion('[custom]/xypic.js', VERSION, 'tex-extension');
}

to your components/xypic/xypic.js file, where '[custom]/xypic.js' is the exact string that you are asking people to use to load your package. I'd actually recommend leaving off the .js, as that is added automatically by MathJax, and that makes it more consistent with how other TeX packages are referenced. it might also be better to use xypic rather than custom, since people may need to load packages from several different locations, and if they all use custom, that would be a problem. It is even possible to just use '[xypic]' by itself and include the xypic.js in the path itself. That might be the easiest way.

load: ['[custom]/xypic.js'],
paths: {custom: 'https://cdn.jsdelivr.net/gh/sonoisa/[email protected]/build/'}
load: ['[xypic]'],
paths: {xypic: 'https://cdn.jsdelivr.net/gh/sonoisa/[email protected]/build/xypic'}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is not necessary to have the .js in the load references, you probably do want to include the '.js' here, however, as this is an actual file reference. It probably works without it, but it feels wrong to leave it off here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it looks a bit silly, but with a naked '[xypic]', which I agree is the best option, it adds a .js extension no matter what - so you get a reference to xypic.js.js which doesn't load.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOPS! Sorry, my bad. I guess the filters that add the .js and that resolve the [...] are in the wrong order. I'll look into that. Thanks for letting me know.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! I should thank you for coming with the perfect build answer, you really made my day

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to help.

paths: {custom: '.'} // specify the path where xypic.js is located.
// This example assumes that xypic.js is in the same place as html.
load: ['[xypic]'],
paths: {xypic: './xypic'} // specify the path where xypic.js is located (without .js).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants