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

  • LaTeX
  • Thread starter I like Serena
  • Start date
  • Tags
    Latex
In summary: Since I would still like some way to quickly draw something in a post, I'd like to recommend tikz.In summary, tikz is a latex extension that can be installed as part of the latex engine. It is versatile and easy to use.
  • #1
I like Serena
Homework Helper
MHB
16,336
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,083
Physics news on Phys.org
  • #3
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.
 
  • #4
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.
 
  • #5
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...
 
  • #6
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.
 
  • #7
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.
 
  • #8
That code looks ridiculously complicated to produce such a simple image.
 
  • #9
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.
 

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

1. What is a Latex plug-in for tikzpicture?

A Latex plug-in for tikzpicture is a tool that allows users to create high-quality diagrams and illustrations using the tikzpicture environment in Latex. It provides additional features and customization options for creating complex and professional-looking graphics.

2. How do I install a Latex plug-in for tikzpicture?

The installation process may vary depending on the specific plug-in, but generally, you can download the plug-in files and place them in the appropriate directory in your Latex distribution. You may also need to update your Latex settings to include the plug-in. It is recommended to follow the instructions provided by the plug-in developer for a successful installation.

3. Can I use a Latex plug-in for tikzpicture with any Latex document?

Yes, a Latex plug-in for tikzpicture can be used with any Latex document, as long as the tikzpicture environment is being used to create graphics. However, some plug-ins may have specific requirements or limitations, so it is important to check the documentation before using it.

4. Are there any alternatives to using a Latex plug-in for tikzpicture?

Yes, there are other options for creating graphics in Latex, such as using the built-in tikzpicture environment without a plug-in, or using external programs like Inkscape or Adobe Illustrator and importing the graphics into your Latex document. However, a Latex plug-in for tikzpicture offers more customization options and can save time and effort in creating complex graphics.

5. Are there any free Latex plug-ins for tikzpicture available?

Yes, there are several free Latex plug-ins for tikzpicture available, such as tikz-qtree, tikz-cd, and pgfplots. These plug-ins are open-source and can be easily downloaded and installed for use in your Latex documents.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
701
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
968
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
890
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Replies
1
Views
781
Back
Top