openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
141 stars 164 forks source link

using a third party MathJax extension #2356

Open Alex-Jordan opened 4 months ago

Alex-Jordan commented 4 months ago

I'd like to use a third party MathJax extension js file. I know how to alter mathjax-config.js so that it wants to load the extension. The problem is I don't know where to put the actual extension js file. If I put it in htdocs/js/SomeFolder then npm ci creates a minimized, tagged, js file for it, and serves that minimized file. But MathJax is looking for the unminimized, untagged js file because that's what I put in mathjax-config.js. Of course I do not know the tag ahead of npm ci, so I can't (and wouldn't want to) declare the minimized, tagged js file in mathjax-config.js. Do we have a way to do this?

drgrice1 commented 4 months ago

Is the extension file available via npm by chance?

There isn't a mechanism at this point to do what you are asking with a file in htdocs/js.

Alex-Jordan commented 4 months ago

It is not. Here is the project I am trying to test out. It is by one of our chemistry faculty and has had some collaboration with Davide.

https://github.com/limefrogyank/siunitx-pcc/

drgrice1 commented 4 months ago

Since this is on Github and has a compiled file in the distribution, you do the same thing that we do with MathQuill. From the htdocs directory run npm install github:limefrogyank/siunitx-pcc. Then the file will be at node_modules/siunitx/siunitx.js.