-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Allow LaTeX in text3d #30226
Comments
comment:1
Attachment: mathjax2canvas_threejs.html.gz I've attached a proof of concept of rendering MathJax output inside a Three.js scene. It would correspond to Sage code like:
It's got some clipping issues in Chrome that don't appear in FireFox, and it takes awhile to generate the images. I'm not sure how much I could speed that up, but it does seem like it would be feasible to support LaTeX in the viewer. This example renders every piece of text as LaTeX. I imagine we'd want to add an additional parameter to |
comment:2
Replying to @jcamp0x2a:
Maybe mimic how |
comment:3
Replying to @slel:
The is no detection of LaTeX in Sage proper that I can see. That all occurs in matplotlib. |
comment:4
Replying to @jcamp0x2a:
The slow rendering probably comes from explicitly calling the MathJax queue. For one of my VR projects I figured out how to render an entire Another thing to think about is how to make this work offline. I've had plenty of negative feedback about defaulting to the CDN: quite a number of developers consider that an invasion of privacy. That's why Three.js was made a standard package to begin with. Are we planning to add MathJax as a standard package or just declare that this feature only works in a notebook?
We probably should do some auto-detection on I'm not in favor of applying these changes to axes labels, since one can already include characters as Unicode either by copying from a character map or using P.S. you can avoid the weird appearance of names with internal capital letters by prefacing them with an exclamation point. |
comment:5
Getting math to display in 2D plots requires dollar signs around the LaTeX. Should do the same here for consistency. That way could assume every string starting with dollar sign should be rendered with MathJax. |
comment:6
MathJax is already a standard package... |
comment:7
Replying to @paulmasson:
Cool stuff! Yea, I'm pretty sure my approach is not the ideal and would love an alternative. (Off-topic, but any chance of VR support in the viewer at some point?)
As you mentioned in a follow-up comment, MathJax seems to already be a standard package. In the proof of concept, I used the same version from the CDN that's currently in Sage, 2.7.4 I think.
True, but it may seem awkward/inconsistent from the user's perspective. I think a common use case would be displaying an equation adjacent to its plot so one may end up having to represent the same character in two different ways. As a user with no knowledge of the internals, I'd be perplexed as to why.
Thanks! |
comment:8
Replying to @jcamp0x2a:
The changes needed to get WebXR working are rather simple. The real problem is that the files require a secure server, i.e. https, in order to enter VR. Even local files needed to be served through Chrome in order to be viewed. Making something like that work for a diverse crowd would be a challenge... |
comment:11
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
From #29758-comment:13.
CC: @jcamp0x2a @paulmasson @slel @egourgoulhon
Component: graphics
Issue created by migration from https://trac.sagemath.org/ticket/30226
The text was updated successfully, but these errors were encountered: