LaTeX My Latex Converter: Convert Latex to Image/HTML

  • Thread starter Thread starter -Job-
  • Start date Start date
  • Tags Tags
    Converter Latex
AI Thread Summary
A web-based converter has been developed to transform LaTeX code into images and HTML, utilizing MikTex executables for image conversion and modified TTH C source code for HTML. The HTML conversion faces limitations, particularly with certain LaTeX tags and integrals, prompting discussions about potential improvements and the desire to create a more robust tool. Suggestions include using XMLRPC for real-time updates and splitting images into smaller pieces to enhance efficiency. There is interest in developing a full LaTeX editor that allows live previews, which would require building a lexical analyzer for syntax error detection. The conversation also touches on MathML integration and its capabilities for further transformations.
-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
Views
2K
Replies
4
Views
4K
Replies
2
Views
6K
Replies
766
Views
738K
Replies
5
Views
2K
Replies
1
Views
3K
Replies
6
Views
4K
Back
Top