Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
vLaTeX - Math parsing with LaTeX Details »
vLaTeX - Math parsing with LaTeX
Mod Version: 0.5.2, by Pod (Coder) Pod is offline
Developer Last Online: Aug 2019 I like it Show Printable Version Email this Page

vB Version: 4.2.x Rating: (13 votes - 4.69 average) Installs: 52
Released: 20 Dec 2009 Last Update: 16 Dec 2012 Downloads: 372
Not Supported Uses Plugins Auto-Template Additional Files Re-usable Code Translations Is in Beta Stage  

vLaTeX allows your users to include mathematical equations written in LaTeX into their posts, rendered in high quality graphic files (either png or gif). Such ability is instrumental in scientific or educational oriented forums. When I started in vb two years ago, there ware a number of solutions available, but none of them suited my needs completely, so I developed my own integration between (a modified version of) Benjamin Zeiss' LatexRender and vBulletin. With the new vBulletin 4.0, I decided to improve some of the features of this product, and to release it with the hope that it turns out to be useful to any of you.


What is LaTeX?

LaTeX is a set of macros for the TeX typesetting system. It is the defacto standard of communication within the scientific and mathematical community. It works pretty much like a programing language: you write a text source file, and the latex executable compiles it in a DeVice Independent file (DVI), which can be later converted to the desired format (postscript, pdf, etc.).

This mod (thanks to a modified version of the LatexRender class) does all this work in the background. It takes the formula code, inserts it in a source file, compiles it and converts the output in a high quality image file (png or gif, depends on your settings) to show in the post.


Requirements

This mod relies on your server having available the following external programs. They are pretty standard in most Linux distributions, so hosts can install them easily (if they want to, some don't). Please, check your server meets this requirements (or ask your host to install the programs) before trying to use vLaTeX:

- latex: the LaTeX compiler. Check the TeX live distribution (http://www.tug.org/texlive/).

- dvips: converts the DVI file to PS. Usually included in all latex distributions.

- convert: as it name suggests, converts between a large number of graphic files. Belongs to the ImageMagick package. Needs ghostscript.

- identify: among other things, measures the size of image files. Also belongs to ImageMagick

- Ghostscript: PostScript and PDF language interpreter and previewer. Is called by convert in order to handle ps files.


Features

Creates a new BBcode, usually [TEX] (thought the tag name is configurable via the admin cp), which contents are processed thought LaTeX to generate image files. There are four calling modes:

- [TEX]E= mc^2[/TEX] in-line mode. The image is included in the middle of the text, without line breaks. It tries to adjust the baseline of the formula by adjusting the vertical-align CSS property; the results aren't always perfect, but it does its best.

- [TEX=null]E = m c^2[/TEX] displayed mode: The formula is displayed (usually centered) between two paragraphs.

- [TEX=*]E = m c^2[/TEX] auto-numbering mode: The formula is displayed (usually centered), and numbered.
NOTE: The auto-numbering depends on the CSS counter system, so some old browsers (most notably ie 7 and older) will show these equations untagged, like [TEX=null]. Don't blame me, blame non-standard compilant browsers.

- [TEX=tag]E = m c^2[/TEX] displayed with tag: The formula is displayed (usually centered) between two paragraphs, and tagged with the specific tag.

In the last two modes, the tags are displayed at the right (left if you use RTL) between brackets, in a (configurable) color.

The formulas are compiled by creating a small tex file and running the native LaTeX program throughout it. You can choose to wrap the formula with the standard dollar ($ ... $), the align or gather amsTeX environments. The standard dollar is recommended since the baseline hack works better with it, but the gather environment allows to create multiline equations using the \\ separator.

This mod also introduces a second BBcode, [EQREF]tag[/EQREF], which outputs (tag), with the same style of the equation tags. It's useful to let users make reference their formulas.

A double click on the image of a generated image will open a pop-up displaying the LaTeX source code used to generate the formula.

Menu with Common used LaTeX commands can be shown below the advanced mode editor. The admin can customize the commands of the menu thought the admin control panel.


Admin features

Image files are cached, so every unique formula is only processed once.

Fully configurable via Style Variables and templates. It is also fully phrased.

It doesn't change any vb default template, so upgrading should be easy.

Includes a list of blacklisted latex commands for security (configurable in the admin cp).

The admin can customize the preamble of the latex file in the admin cp. This is useful to define new commands that your community uses often, or to include packages.

Error messages can be customized in the phrase system.

Memory usage of ImageMagick commands (convert and identify) can be limited in the admin control panel.


Installation / Upgrade

1.- Unzip the mod files.

2.- Upload the vLaTeX directory to your forum root. The generated folder structure should look like this:

vLaTeX/
vLaTeX/index.htm
vLaTeX/class_vlatex.php
vLaTeX/functions_vlatex.php
vLaTeX/vlatex.js
vLaTeX/pics/
vLaTeX/pics/index.htm
vLaTeX/temp/
vLaTeX/temp/index.htm

3.- Change the permissions of the pics and temp folders so the web server can write on them.

4.- Import the product XML in your admin control panel. If you're upgrading, set "Allow Overwrite" to yes.

5.- Go to Admin CP > Settings > Options > vLaTeX - Math Parsing

6.- Make sure the path to latex, dvips, convert and identify executables is correct. Those settings default to the most common values in most linux distributions, but every host is a different world.
If you have shell access, you can check the location of the executables with the following commands:
which latex
which dvips
which convert
which identify

7.- Make sure the path to the Images and Temporal directory are correct. You can change them if you don't like the default value, but the directories must exist and the server must have permissions to write on them.
For extra safety, you could move the temp folder out of the public accessible directory three, thought it should not be needed, since files are deleted in matter of milliseconds.

8.- Set the rest of options as you wish.

9.- Test the product in some posts.

10.- If you wish to add a button in the advanced editor tool-bar for this mod, you can add it using the admin cp section Custom BB Codes (write anything you want in Replacement, this mod will overwrite it). You can use any tex icon, for instance http://www.iconfinder.com/icondetails/3780/16/tex_icon


Error messages

The LaTeX parsing can fail for a number of reasons. In such case, an error message is displayed instead of the formula. Here's a list of all possible error messages and their meaning:

- "Image too big {1}, max {2}x{3}", The resulting image is bigger than the allowed dimensions.

- "Blacklisted command", The user attempted to compile a formula with a forbidden command.

- "Can't move image", Image formula could be created, but I could not be moved to the destination folder. Check that the directory exists and has write permissions.

- "Convert failed", Formula could be compiled, but could not be converted to png/gif. Check the convert program path.

- "Compile failed", The formula could not be compiled. Check that the temporal directory has write permissions and that the latex path is correct.

- "Code too long, max. {1} characters", The formula code was too long. The maximum length can be configured in the admincp.

- "Formula not found", The compilation and convert process appeared to not raise any error, but the image was not found on the destination folder. Check for permissions in the destination folder and/or IO errors.

- "Pictures directory unwritable", The destination folder does not exist, or has no write permissions.

- "Temp. dir unwritable", The temporal folder does not exist, or has no write permissions.

- "Unknown error", Any other error condition.


Disclaimer

This mod is in beta phase, if you find bugs, please tell me how to reproduce them so I can improve it. It is distributed as is, with the hope that it is useful for someone, but without any warranty. Nor will I accept any responsibility or liability if it doesn't work as expected, or even if it breaks something.
This mod is mainly developed for personal usage. I will listen to good ideas, but I can't guaranty that I will be implemented requested features.


License

This mod is distributed under the LGPL.(http://www.gnu.org/copyleft/lesser.html). As is, you can freely distribute it or any derivative work provided that: 1) you acknowledge the work of the previous coders (like myself and Zeiss), 2) you release it under the same license (or GPL).



Acknowledgments

This mod (in particular, the class_vlatex.php file) is strongly based on the LatexRender class by Benjamin Zeiss (http://www.mayer.dial.pipex.com/tex.htm).

The baseline hack by the work of Maarten Sneep (http://mactextoolbox.sourceforge.net.../baseline.html).


Compatibility

The last version of this mod (0.5.1) requires vb4.2.0 or higher. It should work on previous CKEditor versions, but it was not tested.

If you wish to use it in a pre-CKEditor vb installation, you can use the previous vLaTeX version (0.4.1). If you want to use it in an older vb4.0.x release, you can download version 0.3 (which is compatible with vb4.0.1 or higher). Take into account that old versions of this hack have less features and might have some issues fixed in later versions.

Support will be given only for the last version of this mod.



History

2009 / 12 / 19 - First (beta) release

2009 / 12 / 20 - version 0.2
Fixed baseline problem of in-line formulas in CMS articles.
Improved error handling.
Included Spanish translation

2010 / 1 / 24 - version 0.3 (requires vb4.0.1)
Fixed extra space after in-line equations.
Won't break down if vb's CSS is stored as files.
New pop-up showing the formula source code upon double-click.

2010 / 7 / 23 - version 0.4 (requires vb4.0.4)
Improved support for CSS stored as files.
Fixed bug of js file not being loaded on certain servers.
Menu with common LaTeX commands under vb's advanced editors.
Equations will no longer be break by preview in blogs or CMS articles.

2010 / 4 / 24 - version 0.4.1 (requires vb4.0.4)
Improved compatibility of the Common Commands quick-menu with IE browser.

2012 / 12 / 07 - version 0.5.1 (requires vb4.2.0)
CKEditor support.
Memory limit for imagemagick commands.
Code pop-up now can overflow postbit boundary.

2012 / 12 / 17 - version 0.5.2 (requires vb4.2.0)
Introduced Formula Wrapper option.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	screenie1.jpg
Views:	1116
Size:	41.2 KB
ID:	107769   Click image for larger version

Name:	screenie2.png
Views:	375
Size:	81.0 KB
ID:	107770   Click image for larger version

Name:	screenie6.jpg
Views:	579
Size:	56.0 KB
ID:	110930   Click image for larger version

Name:	screenie3.png
Views:	208
Size:	74.8 KB
ID:	119933  

Click image for larger version

Name:	screenie0.jpg
Views:	953
Size:	55.1 KB
ID:	120002   Click image for larger version

Name:	screenie4.png
Views:	326
Size:	89.7 KB
ID:	120003  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #91  
Old 30 Jul 2011, 21:34
dukeblue219 dukeblue219 is offline
 
Join Date: Jul 2011
Just wanted to say thanks -- I really like this latex plugin better than the system I had kludged together before (on a different forum software). Yes, everyone, it does work out of the box if you have the required software installed on your server. The quickmenu looks great, can't wait to get it operational with the upcoming fix.
Reply With Quote
  #92  
Old 07 Aug 2011, 19:12
juanma101285 juanma101285 is offline
 
Join Date: Aug 2011
Stuck in Step 4

Hi, thanks for the plugin!

I am new to all this... I have been trying to install vlatex, but I am stuck in step 4. I'd really appreciate it if someone could give me a hand.

Here's what I have done so far:
Step 2 - I have upload the vLaTeX directory to the forum's root (where I have vBulletin installed, I guessed).
Step 3 - I changed the permissions of the pics and temp folders.
Step 4 - The instructions say "Import the product XML in your admin control panel. If you're upgrading, set "Allow Overwrite" to yes.", so I have put the product-pod_vlatex.xml file in the folder "/admincp/".

I then went to AdminCP > Settings > Options, but there is no "vLaTeX - Math Parsing", so I cannot go on.

What have I done wrong? Thanks!
Reply With Quote
  #93  
Old 07 Aug 2011, 20:07
Pod Pod is offline
 
Join Date: Jun 2007
Originally Posted by juanma101285 View Post
Step 4 - The instructions say "Import the product XML in your admin control panel. If you're upgrading, set "Allow Overwrite" to yes.", so I have put the product-pod_vlatex.xml file in the folder "/admincp/".
Go to the admin cp, "Plugins & products" > "Manage products", then click in [Add/Import product]. Select the product product-pod_vlatex.xml in your HDD.
Reply With Quote
  #94  
Old 08 Aug 2011, 00:34
dkikuchi dkikuchi is offline
 
Join Date: Jun 2008
Pod, just wanted to thank you for this mod. Looks and works great so far through my testing. I know that you had posted that the fix was almost ready a couple of weeks ago and I was wondering if there was an estimated release date expected? The forum I will be using this on is scheduled to open soon and I'm really hoping to have full functionality at that time.

Thanks again for the great product!
Reply With Quote
  #95  
Old 08 Aug 2011, 01:03
Pod Pod is offline
 
Join Date: Jun 2007
Originally Posted by dkikuchi View Post
Pod, just wanted to thank you for this mod. Looks and works great so far through my testing. I know that you had posted that the fix was almost ready a couple of weeks ago and I was wondering if there was an estimated release date expected? The forum I will be using this on is scheduled to open soon and I'm really hoping to have full functionality at that time.

Thanks again for the great product!
I do have a fix for the JS side of things (the thing that makes the buttons work), that part is done and reasonably well tested.

But after that, I found that vB changed something in the CMS that completely kills the comments editor with this mod enabled; the quick-menu should not appear in there, as it only appears in full editors, but somehow the method to detect what kind of editor we are dealing with no longer works in the CMS.

I have yet to study vB's code in order to know what to do. In the worse case, I might have to rethink the whole quick-menu system. In the best case there'll be another variable I can check and it'll be easy. So I can't say how much It'll take.

Unfortunately, I have no holidays in august, so I have little time for my hobby projects. Good news is that today I just finished another hobby project, and I promise I won't do any other thing before vlatex is ready to go with the new editor. So can't say a date, but hopefully won't take long.

If you are interested in the forum only version of vb, then this problem should not trouble you at all. I'm attaching to this post the updated JS file that should work for any vb4.x forum-only. Just overwrite the old file whit this one, but be warned to try this in a testing environment, never test it live before confirming it works for you.
Reply With Quote
  #96  
Old 10 Aug 2011, 03:45
dukeblue219 dukeblue219 is offline
 
Join Date: Jul 2011
Originally Posted by Pod View Post
I'm attaching to this post the updated JS file that should work for any vb4.x forum-only. Just overwrite the old file whit this one, but be warned to try this in a testing environment, never test it live before confirming it works for you.
Would like to give the update JS file a shot, but I didn't see an attachment here.
Reply With Quote
  #97  
Old 22 Aug 2011, 19:54
ALBCODERS ALBCODERS is offline
 
Join Date: Apr 2009
after i installed

i tried [TEX]E = m c^2[/TEX] and i got this on my post >>> [LaTeX ERROR: Compile failed]

also icons not appear , look at the attachment in botom of this post.
If there is any problem with my hosting, what kind of files do they have to install to get this working,
i am with hostgator , is there any hostgator member who have same problem,

Please guys let me know , i really need this product


Regards
Attached Images
File Type: jpg untitled.jpg (67.6 KB, 12 views)

Last edited by ALBCODERS; 22 Aug 2011 at 22:30.
Reply With Quote
  #98  
Old 22 Aug 2011, 22:55
ALBCODERS ALBCODERS is offline
 
Join Date: Apr 2009
Requirements

This mod relies on your server having available the following external programs. They are pretty standard in most linux distributions, so hosts can install them easily (if they want to, some don't). Please, check your server meets this requirements (or ask your host to install the programs) before trying to use vLaTeX:

- latex: the LaTeX compiler. Check the TeXlive distribution (http://www.tug.org/texlive/).

- dvips: converts the DVI file to PS. Usually included in all latex distributions.

- convert: as it name suggests, converts between a large number of graphic files. Belongs to the ImageMagick package. Needs ghostscript.

- identify: among other things, measures the size of image files. Also belongs to ImageMagick

- Ghostscript: PostScript and PDF language interpreter and previewer. Is called by convert in order to handle ps files.




can u be more specific what kind of scripts they have to install , because hostgator admins are givin me hard time on this.

Last edited by ALBCODERS; 22 Aug 2011 at 23:11.
Reply With Quote
  #99  
Old 27 Aug 2011, 18:58
dukeblue219 dukeblue219 is offline
 
Join Date: Jul 2011
These are not "scripts" per se. They are compiled programs that must be installed on the server. I suspect that many shared hosts, such as hostgator, will not have them all installed, even though none of them are particularly uncommon.

That said, any remotely competent admin should know what those programs are, and they should be able to give you a simple yes or no if they're available. If they're not, I would seriously doubt that they're going to install a new program on the server just for one customer, and it might be against their rules for security reasons.
Reply With Quote
  #100  
Old 31 Aug 2011, 14:10
tommac3 tommac3 is offline
 
Join Date: Jun 2008
I upgraded to the latest version of VBulletin and the quick menu no longer works
Reply With Quote
  #101  
Old 31 Aug 2011, 17:09
tommac3 tommac3 is offline
 
Join Date: Jun 2008
I think the quick menu is no longer working because of the new text box that vbulletin uses.
Reply With Quote
  #102  
Old 14 Oct 2011, 06:26
CvP's Avatar
CvP CvP is offline
 
Join Date: Aug 2006
looking forward to next update
Reply With Quote
  #103  
Old 31 Oct 2011, 18:58
linuxwhy's Avatar
linuxwhy linuxwhy is offline
 
Join Date: Aug 2010
looking for waiting...
Reply With Quote
  #104  
Old 11 Jan 2012, 20:52
caciocode caciocode is offline
 
Join Date: Apr 2010
Is there a latest version for this.
__________________
Mathematics forum
Reply With Quote
  #105  
Old 13 Apr 2012, 22:51
Beckenbauer Beckenbauer is offline
 
Join Date: Mar 2012
I have all five programs on the server, but this error when I will write a post.

exec() has been disabled for security reasons in [path]/vlatex/class_vlatex.php (line 292)

Don't work in 4.1.11 or 4.1.12?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:33.

Layout Options | Width: Wide Color: