How to Load Packages in Mathjax - PhysicsForums

  • Thread starter brotherbobby
  • Start date
In summary, MathJax is not a true LaTeX engine and does not support loading packages. Some packages can be implemented with a global extension, but this can cause performance issues and only a few extensions are currently available. Additionally, MathJax's new version is not compatible with old extensions.
  • #1
brotherbobby
579
147
Does anyone know how to load packages here as we do in ##\LaTeX##? I am aware that PhysicsForums uses the mathjax engine, but I don't know much about it.
 
Physics news on Phys.org
  • #2
This answer in Stack Overflow states that you cannot load packages in MathJax:
No. MathJax isn't LaTeX; it processes input that is LaTeX-like (as close as it reasonably can be to true LaTeX), but the way it works under the hood is very different. One difference in particular is that MathJax only implements the math-mode macros, not all the other text-mode or general processing macros and control sequences. So most of the tools used by LaTeX packages aren't there. That means you can not simply drop a LaTeX package into MathJax. The packages that MathJax supports have to be re-implemented in javascript, which is difficult for non-trivial packages (like the one you cite).
Another answer states that you can implement some packages with ##\#\#\verb|\require{\packagename}|\#\# ##, and that will supposedly affect all posts in that page (even other people's posts). But I am not sure whether that actually works.
 
  • Like
Likes Greg Bernhardt
  • #3
We can load extensions globally, but that can be a performance issue unless an extension is highly needed. So far we haven't found many. This along with MathJax released a new version this past summer and old extensions are not compatible.
 
  • Like
Likes PhDeezNutz
  • #4
I am the OP of this thread. Sorry to return here after a long time.

My question's for @Greg Bernhardt for the comment you made up there :
Greg Bernhardt said:
We can load extensions globally, but that can be a performance issue unless an extension is highly needed. So far we haven't found many. This along with MathJax released a new version this past summer and old extensions are not compatible.
Do you know how to load these extensions or packages? I use Google Chrome on 64 bit Windows 11.
 
  • #7
Maybe it is best to back up. What is it you want to display that cannot be done today?
 
  • #8
brotherbobby said:
Does this require going into the Google Chrome console?
Perhaps you could locally inject an extension, but it wouldn't be held over a session. Generally, they are loaded on the server side.
 
  • #9
Vanadium 50 said:
Maybe it is best to back up. What is it you want to display that cannot be done today?
A ##\rm{LaTeX}## package by the name geometry. I believe it doesn't come loaded into MathJax.
 
  • #10
Greg Bernhardt said:
Perhaps you could locally inject an extension
Can you tell me how inject an extension locally? I believe by extension you mean the package itself.
 
  • #11
brotherbobby said:
Can you tell me how inject an extension locally? I believe by extension you mean the package itself.
You'd need to know some javascript and use the Chrome console, but again, it would likely only work for one page load.
 
  • #12
Greg Bernhardt said:
You'd need to know some javascript and use the Chrome console, but again, it would likely only work for one page load.
I understand. Doesn't sound like a feasible idea. Let's put it aside.
 
  • Like
Likes Greg Bernhardt

Similar threads

  • Feedback and Announcements
Replies
2
Views
785
  • Feedback and Announcements
Replies
2
Views
1K
  • Feedback and Announcements
Replies
3
Views
116
  • Feedback and Announcements
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
0
Views
817
  • Feedback and Announcements
Replies
2
Views
868
Replies
17
Views
2K
  • Feedback and Announcements
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Feedback and Announcements
Replies
2
Views
1K
Back
Top