-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
tikz support [was: mathjax graphics] #41
Comments
Support for tikz, even partial, would be a great addition indeed! It would be particularly useful for viewing graphs (in combination We would be happy to provide code samples and to participate to
|
Vote for this one. |
👍 |
Thanks for the interest. We would love to have something like that but it would be a huge endeavor and really a separate library b/c tikz is very different from math-mode TeX/LaTeX. There is a third party extension implementing much of xypic which you can access from the CDN. |
If I remember correctly, Tikz has a system layer (in TeX) and most high level stuff is implemented as another layer on top of that, with different drivers for output. With the level of TeX support mathJax has, would it be a huge endeavor to support Tikz's system layer for the svg driver ? |
Yes.
I'm not sure I understand the question. |
I been doing some digging because of my own hypothetical use case and found some info possibly relevant to this thread, along with a few brainstorm ideas to add. If any parts are not seen as so relevant, my apologies in advance, this just seemed a likely appropriate place to brain dump some of my research results on this subject: If I understand correctly from looking here: (https://www.ctan.org/pkg/pgf?lang=en) Tikz is built on PGF, and both are largely built with LaTeX macros. It looks like there is some C/C++ code and some LUA in the project source (https://www.ctan.org/tex-archive/graphics/pgf/base) but most of it looks to be tons of TeX files containing macros (https://www.ctan.org/tex-archive/graphics/pgf/base/tex). If my admittedly limited understanding is correct (LaTeX, PSTricks, PGF and TIKS are all new to me as of about 48 hours ago) maybe all that would be needed is porting some of the LUA and C/C++ code to javascript (or maybe compiling them 'as is' for a Nodejs plugin?) and then the functionality could just be lifted from the TeX files in the original project. Issues with this I can currently guess at are:
Just brainstorming here, but maybe some javascript regex could easily convert <LaTeX/PGF/TIKS/other...> scripts to a JSON parsable object array of interpret-able commands describing render calls to Canvas and/or WebGL. That might be relatively fast and get an initial implementation working. However it will not solve the obvious optimization problems when using existing macros for rendering 3D via 2D TeX/PGF that exist from the old-school packages. On the other hand, once the common existing Macros/Packages were identified, a WebGL implementation of them could come with the system or be plug-able side project spin-offs for the main system. Anyway, just some thoughts after a couple days of pondering and researching the subject. Hopefully they help somebody or strike a new idea/approach for somebody reading. |
Thanks for sharing your thoughts on this. Just a few points form our end, kind of a summary of what we (the MathJax team's) have encountered in discussions around this.
In any case, we're happy to help and share our knowledge. But MathJax does not have any plans (or resources) to pursue graphics at this time. |
What about setting up a mathjax-based tikzjax? |
In the <script src="https://tikzwolke.com/v1/tikzwolke.js"></script> Then in the <script type="text/tikz">
\begin{tikzpicture}
\draw (0,0) circle (1in);
\end{tikzpicture}
</script> Ultimately the TikZ is compiled in the cloud, but the TikZ source is hashed and Amazon S3 is used as a cache. |
The code at https://github.com/kisonecat/tikzjax now provides TikZ running entirely in the browser. (With web2js, the Pascal source for e-TeX is compiled to WebAssembly; it's run under node and interrupted after loading the LaTeX format and TikZ, and the resulting core dump is shipped to the browser to very quickly get the browser to a place where TikZ is running. With dvi2html the DVI is converted to SVG.) |
mathjax should support tikz graphics and animations!
tikz animations are javascript!!
The text was updated successfully, but these errors were encountered: