Can tikzpicture be Used as a Plug-in for vBulletin?

  • Context: LaTeX 
  • Thread starter Thread starter I like Serena
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary
SUMMARY

The discussion centers on the feasibility of integrating TikZ, a LaTeX extension for creating graphics, as a plug-in for vBulletin. Users express that while TikZ can be rendered using MikTeX on Windows, its compatibility with MathJax, the current rendering engine used by vBulletin, is limited. MathJax primarily supports MathML, which does not accommodate complex graphics like those produced by TikZ. Alternatives such as XyJax are mentioned, but they have received negative feedback due to their complicated syntax. The conversation highlights the challenges of rendering TikZ graphics in a forum environment while considering server storage limitations.

PREREQUISITES
  • Understanding of TikZ for LaTeX graphics creation
  • Familiarity with MikTeX installation and usage on Windows
  • Knowledge of MathJax and its limitations regarding graphics rendering
  • Basic understanding of vBulletin's plug-in architecture
NEXT STEPS
  • Research TikZ documentation for advanced graphics capabilities
  • Explore alternatives to MathJax for rendering LaTeX graphics
  • Investigate the XyJax extension and its compatibility with MathJax
  • Learn about caching strategies for LaTeX-generated images in web applications
USEFUL FOR

This discussion is beneficial for web developers, forum administrators, and educators looking to enhance their vBulletin forums with LaTeX graphics, particularly those interested in integrating TikZ for visual content creation.

I like Serena
Science Advisor
Homework Helper
MHB
Messages
16,335
Reaction score
258
Lately I've been interested in tikz, which is a latex extension.
Since I would still like some way to quickly draw something in a post, I'd like to recommend tikz.
It is a latex extension of which I hope it can be installed as part of the latex engine.
I have no clue however if it can be installed as a plug-in in vBulletin.

Let me give an example.
The following latex code:
Code:
\begin{tikzpicture}
\draw (-4,0) -- (4,0);
\draw (-4,0) circle (1.5);
\draw (-4,-1.5) -- (4,-.2);
\fill[draw=black!50,top color=blue!80,bottom color=black!40] 
    (-4,0) circle (.5) node {Earth};
\fill[draw=black!50,top color=orange!80,bottom color=black!40] 
    (4,0) circle (1) node {Sun};
\fill[draw=black!50,top color=gray,bottom color=black!20]
    (-4,-1.5) circle (.1) node[below = 1pt] {Satellite};
\end{tikzpicture}

yields this picture:
attachment.php?attachmentid=56711&stc=1&d=1363272283.png


To get this picture to work, it suffices to install MikTEX in Windows and simply try to render the latex code (in a document wrapper that includes \usepackage{tikz}).
 

Attachments

  • earth_satelite.png
    earth_satelite.png
    2.9 KB · Views: 1,153
Physics news on Phys.org
MathJax's underlying structure is MathML. I'm afraid "complex" drawing is outside the scope of MathML. However there is an obscure extension for MathJax that may allow the design of some basic diagrams which I am testing. I'll update when I have anything concrete.
 
The first problem is that MathJax ##\ne## TeX. It's a different system, where the input just happens to be very similar to a subset of TeX.

The second problem is that the code that actually renders the OP's graphics isn't really part of TeX either. It's a separate back-end -program that converts the TeX output into a PDF, or PostScript, or other graphics formats. Different implementations of TeX, and different back-end programs, don't all work the same way.
 
Greg Bernhardt said:
MathJax's underlying structure is MathML. I'm afraid "complex" drawing is outside the scope of MathML. However there is an obscure extension for MathJax that may allow the design of some basic diagrams which I am testing. I'll update when I have anything concrete.

Sounds good!

Btw, I remember a time when we didn't use MathJax yet.
At that time latex was rendered server side in the form of pictures...
 
Greg Bernhardt said:
MathJax's underlying structure is MathML. I'm afraid "complex" drawing is outside the scope of MathML. However there is an obscure extension for MathJax that may allow the design of some basic diagrams which I am testing. I'll update when I have anything concrete.

We are looking into the same thing at our site too, Greg. The only program/extention I've found that is compatible with Mathjax is XyJax but the the feedback has been negative due to the strange syntax structure of it. I look forward to seeing what you come up with.
 
Jameson said:
We are looking into the same thing at our site too, Greg. The only program/extention I've found that is compatible with Mathjax is XyJax but the the feedback has been negative due to the strange syntax structure of it. I look forward to seeing what you come up with.

XyJax is what I am testing. It also has a very large overhead.
 
That code looks ridiculously complicated to produce such a simple image.
 
I remember before MathJax, Physics Forums used a standard LaTeX renderer to render images server-side. It was very snappy, and easy to extend by just installing LaTeX packages on the server. Whatever happened to that? What was wrong with it that made you decide to switch to MathJax?
 
  • #10
Ben Niehoff said:
I remember before MathJax, Physics Forums used a standard LaTeX renderer to render images server-side. It was very snappy, and easy to extend by just installing LaTeX packages on the server. Whatever happened to that? What was wrong with it that made you decide to switch to MathJax?

Hosting several millions images was not what the server liked.
 
  • #11
I'm wondering if it's possible to support both.

Latex can default to MathJax, unless it contains a tikzpicture.
Or perhaps with for instance [TIKZ] tags generating a tikz picture.

It seems unlikely that the site will be flooded with tikz pictures any time soon.

Of course this may be near impossible to do, but I do not know this.
 
  • #12
Borek said:
Hosting several millions images was not what the server liked.

You mean you never deleted the old ones? It's not hard to write a caching script that deletes, say, any LaTeX image that hasn't been viewed in the last 3 days. Then on the off-chance someone looks at an old thread in the future, it can be regenerated. You shouldn't have to store millions of images...I'd say more like thousands, or maybe tens of thousands. There's a tradeoff between storage space and computation time needed to regenerate deleted images...it would probably take some experimentation to find the sweet spot.
 
  • #13
Ben Niehoff said:
You mean you never deleted the old ones? It's not hard to write a caching script that deletes, say, any LaTeX image that hasn't been viewed in the last 3 days. Then on the off-chance someone looks at an old thread in the future, it can be regenerated. You shouldn't have to store millions of images...I'd say more like thousands, or maybe tens of thousands. There's a tradeoff between storage space and computation time needed to regenerate deleted images...it would probably take some experimentation to find the sweet spot.

You may need to wait for Greg to comment as I was not involved. My understanding is that old system was implemented many years ago by Chroot using tools available at the time (I believe LaTeX was converted to postscript and then to png) - and was not easy to modify, it was easier to implement it from scratch. Switching to MathJax was the simplest and the safest solution.
 
  • #14
I've actually written a PHP script that handles the caching, and generates images using dvipng (i.e., no intermediate Postscript). This needs to be coupled with a cron job that removes old images. I wrote this up because a few years ago I was planning on starting a site with LaTeX enabled.

I am only vaguely familiar with vBulletin code, though. They've gone through a lot of versions since the last time I looked at it. So I don't know exactly where such code should hook into the plugin system. I also don't know if I would have the time to figure it out; I'm trying to finish my PhD.
 
  • #15
Ben Niehoff said:
You mean you never deleted the old ones? It's not hard to write a caching script that deletes, say, any LaTeX image that hasn't been viewed in the last 3 days. Then on the off-chance someone looks at an old thread in the future, it can be regenerated. You shouldn't have to store millions of images...I'd say more like thousands, or maybe tens of thousands. There's a tradeoff between storage space and computation time needed to regenerate deleted images...it would probably take some experimentation to find the sweet spot.

Yes and I don't doubt it. Chroot wrote the old program, but wasn't interested in "maintaining" or "extending" it. I don't have the expertise or time to write something proper. MathJax is nice because it's good enough for 90% of our needs, is professionally developed and processing is nearly done all on the client side. No mess. I am looking forward to future versions of MathJax.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
6K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K