LaTeX My Latex Converter: Convert Latex to Image/HTML

  • Thread starter Thread starter -Job-
  • Start date Start date
  • Tags Tags
    Converter Latex
Click For Summary
SUMMARY

The discussion centers on a web-based converter that transforms LaTeX code into images and HTML, utilizing MikTeX executables for LaTeX to PNG conversion and Ian Hutchinson's TTH C source code for HTML conversion. Users noted limitations in the HTML output, particularly with certain LaTeX tags and integrals. The conversation also explored potential enhancements, such as using XMLRPC for real-time updates and the feasibility of porting TTH to languages like C++ or JavaScript. Additionally, participants discussed the integration of MathML and the need for a robust LaTeX editor with syntax error detection.

PREREQUISITES
  • Familiarity with LaTeX syntax and commands
  • Understanding of MikTeX and its executables
  • Knowledge of XMLRPC and its application in web services
  • Experience with Flex for code generation and parsing
NEXT STEPS
  • Research the implementation of XMLRPC for real-time LaTeX graphic updates
  • Explore the development of a LaTeX editor using JavaScript for client-side processing
  • Investigate the integration of MathML and its conversion capabilities
  • Learn about building a Lexical Analyzer for LaTeX to detect syntax errors
USEFUL FOR

This discussion is beneficial for web developers, software engineers, and anyone interested in creating or enhancing LaTeX conversion tools and editors.

-Job-
Science Advisor
Messages
1,152
Reaction score
4
I've playing around with Latex lately and put together a webbased converter that can convert Latex code into either an image (like in these forums) or HTML. I think there's some Latex tags that aren't supported very well, particularly in the hml conversion.
For the Latex to .png I'm using a couple of executables that come with MikTex. As for the Latex to Html conversion I'm using Ian Hutchinson's TTH C source code which i altered so that it can be used efficiently from a web service.
I planning on doing a full Latex editor on my independent study class this semester, so this is just a warm up. :smile: What i'd really like to do is port TTH from C to another language, like C++, VB.NET and even Javascript, but the code was generated with Flex, it's messy and it's 27000 lines long, so I'm a little reluctant. I think this Tex/Latex scene is a little disorganized. Anyway, here's a link:
http://www.bloo.us/tex/services/
 
Last edited by a moderator:
Physics news on Phys.org
Looks nice :smile:

How long do the images stick around on the server? Could I link to them from another forum, for example?

Integrals don't seem to work so well in HTML, by the way :wink:

http://www.warpenguin.com/~dice/int.png
 
Last edited by a moderator:
Flex is pretty good. I'm actually working on a project that will use flex to generate code to parse a custom template system.

Instead of trying to port the whole thing to javascript or whatever language, why don't you use xmlrpc to get real-time updating of the latex graphics. In order to save bandwidth slice the image into many little pieces so you only have to update what has changed.
 
Images stick around until i delete them manually. :)
The HTML converter is not very good. Can you believe you have to pay $900 for that? I got for free because the author has it available as open source and free for non-comercial usage, but there are a lot of issues with that tool. I'm considering making my own, but it's a moderately sized project.
Is there a flex that generates non-c code? And is XMLRPC the equivalent to Ajax?
 
What you need to do is have html like this:

Code:
<img alt="" src="latex_generator.py">

And then have some code, perhaps mod_python, like this:

Code:
req.content_type('image/jpeg')
req.send_http_header()
req.write(jpeg_binary_data)

This way you're dealing with the image in memory, which is much faster than writing the image to disk and then having the program write the name of the file in the src field, which then gets fetched.

You can make the program more robust by splitting the image into tiny pieces and caching them individually.

-------------

Why do you need an html converter? You get the formula from POST or GET, pass it through to a latex processor and then spit out to html.

--------------

There is a version that generates java.

--------------

AJAX is the marketing term
XMLRPC is the technical term

AJAX = XMLRPC
 
Let me tell you the full story. I want to do a full latex editor. One of the features i wanted to have is the ability to see what your Latex document will look like as you type it. Initially i had only the Latex to PNG ASP.NET script set up, so i considered doing what you've just suggested and split the image into pieces and only "redraw" whatever was needed. When i found out about the Latex-To-Html converter i thought that this would be a lot better because with html it's much easier to only update the little portions of the Latex that have changed (not to mention it's faster and of smaller size). Of course the Latex-To-Html thing is not the best and that's why i thought about writing my own. Of course then what would be really good would be to write this tool in Javascript because this way it would run entirely on the client without a roundtrip to the server for each update.
Last semester me and another guy in my group used Ajax to build a web application and that's what i was considering using for this Latex editor anyway. If it wasn't for the preview thing, which some might argue isn't really necessary, i wouldn't even care about the latex-to-html thing, but since none of the other Latex editors have it i thought it was worth considering.
In any cas eit seems i can't avoid having to build a Lexical Analyzer for Latex because i want the editor to be smart and detect syntax errors. I was thinking since Latex is not a programming language it wouldn't be so hard, especially using Flex. I already had to write a compiler for a programming lanugauge so this seems a lot easier.
 
I actually have a Latex to MathML converter and i was going to add it to the Latex converter that i have. I believe you can only display MML with a plugin though right? What can i do with the MML that is generated?
 
Mathml is integrated in Firefox 1.5. IE does need a plugin.

Mathml is xml. You can do XSL transformations on it to convert it to another format. For example you can convert it to SVG.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 766 ·
26
Replies
766
Views
742K
  • · Replies 19 ·
Replies
19
Views
8K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K