LaTeX Effortlessly Post Math Formulas with a LaTeX Parser/Converter on Your Website

  • Thread starter Thread starter XTTX
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary
SUMMARY

The discussion focuses on implementing a LaTeX parser for posting mathematical formulas on a custom website. The user suggests using PHP to call LaTeX executables for converting documents into various formats, such as .dvi, .png, and .pdf. Alternatives like MimeTeX are mentioned for faster conversions, although they may not support all LaTeX commands. Key resources provided include links to PHP's exec function and LaTeX packages like MiKTeX.

PREREQUISITES
  • Familiarity with PHP programming and its exec() function
  • Understanding of LaTeX syntax and document structure
  • Basic knowledge of HTML for web integration
  • Experience with command-line tools for document conversion
NEXT STEPS
  • Research how to implement LaTeX document conversion using PHP exec() function
  • Explore the MiKTeX package for LaTeX document processing
  • Learn about MimeTeX for direct LaTeX to image conversion
  • Investigate additional LaTeX packages and their command support
USEFUL FOR

This discussion is beneficial for web developers, particularly those looking to integrate mathematical formulae into their websites using LaTeX, as well as anyone interested in optimizing document conversion processes with PHP.

XTTX
Messages
9
Reaction score
0
Long time lurker, first time poster, and I'm embarrassed that my first post is a request. I'm in the process of creating a website which will require being able to post mathematical formulae by the public, and the best solution I've thought of for this is the same LaTeX solution that this forum uses, seeing as it is probably the most user-friendly that I have seen with the LaTeX Reference box. The website doesn't use VBulletin, but it will use a similar, custom made solution. So, I was just wondering if anybody could point me towards the right direction towards either an implementation-ready package that's already been made or how to make a parser myself. I do know PHP and HTML, and I'm learning Java (not JavaScript)
 
Physics news on Phys.org
There are LaTeX packages available for Windows and Linux, in these packages you should find executables for converting a LaTeX doc into a .dvi (print file) and for converting a .dvi to .png, .pdf or ps.

In PHP you can call executables using the exec() function, so you can save the LaTeX document to a file, call the latex executable to generate the dvi, and then call png/pdf/ps converters to generate the desired file type.

This a multi-step process but is actually not that bad in terms of performance. There are some Perl/CGI alternatives (MimeTeX for example) that receive the latex code and convert to image (.gif) directly, so they're faster but they don't usually support all the LaTeX commands and packages (which is ok if you're just looking to use LaTeX for math expressions here and there rather than full-sized documents).

Here's some links:
http://us.php.net/manual/en/function.exec.php
http://www.miktex.org/
http://www.latex-project.org/
http://www.latex-community.org/
http://www.forkosh.com/mimetex.html
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • Sticky
  • · Replies 2 ·
Replies
2
Views
503K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
6K