My Latex Converter: Convert Latex to Image/HTML

  • Context: LaTeX 
  • Thread starter Thread starter -Job-
  • Start date Start date
  • Tags Tags
    Converter Latex
Click For Summary

Discussion Overview

The discussion revolves around the development of a web-based LaTeX converter that can transform LaTeX code into images or HTML. Participants explore various technical aspects, potential improvements, and alternative approaches related to LaTeX processing and rendering.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their web-based LaTeX converter that outputs images and HTML, noting limitations in the HTML conversion.
  • Another participant inquires about the longevity of images on the server and mentions issues with rendering integrals in HTML.
  • Suggestions are made to use XMLRPC for real-time updates of LaTeX graphics instead of porting the entire codebase to another language.
  • Concerns are raised about the quality of the HTML converter and the high cost of commercial alternatives, with a participant considering developing their own solution.
  • Technical suggestions include handling images in memory for faster processing and splitting images into smaller pieces for efficiency.
  • A participant expresses a desire to create a full LaTeX editor with real-time previews, contemplating the use of JavaScript for client-side processing.
  • References are made to existing MathML resources and the potential integration of a LaTeX to MathML converter.
  • Discussion includes the compatibility of MathML with different browsers and its transformation capabilities using XSL.

Areas of Agreement / Disagreement

Participants express a variety of viewpoints on the effectiveness of existing tools and approaches, with no clear consensus on the best method for LaTeX conversion or the necessity of certain features.

Contextual Notes

Participants mention limitations in current tools, the complexity of the codebase, and the challenges of achieving efficient real-time updates, but do not resolve these issues.

-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
5K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 766 ·
26
Replies
766
Views
744K
  • · Replies 19 ·
Replies
19
Views
10K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K