Home ·  Blog ·  Debian ·  FreeDict ·  software projects ·  publications ·  Impressum     

Blog posts about free software, usage, configuration and my involvement in free software projects.

Image of the word tautologie as
            LaTeX-output \tau\to\log{}ie

RSS

GladTeX-ng - Embed LaTeX Quality Images Into HTML

Posted by Sebastian Humenda at 20.08.2015, 21:36

I recently struggled to get GladTeX working on Windows which is a real pain with the current mixture of C/Perl. It's possible to get a binary out of GladTeX and the required subprogram eqn2img, but on some systems it would not terminate when processing a .htex file.
Even though I have been trying to avoid this step, I finally decided to rewrite GladTeX in pure Python, because that brings many benefits.

Python is nowadays far more popular as Perl and has been adopted as a plugin scripting language. So reimplementing GladTeX in Python brings:

As mentioned there used to be a subprogram eqn2img written in C. It would call dvips, use Ghostscript to convert ps2png and do some image manipulation on it. The far simpler solution is to use dvipng directly and to skip the graphics manipulation. This way I also avoid having to maintain a C-chunk in a Perl/Python project.

I've seen on the internet that some people like to use GladTeX to embed it in their programs or work flows. Pandoc is a quite popular choice there. The new design actually brings a library called GleeTeX which allows to be used directly inside of Python applications. So you can i.e. embed i.e. GladTeX in your web application directly without the need to call a subprocess.
I've made the code available on GitHub:

http://github.com/humenda/gladtex

and I invite everybody to propose changes / help out! It's a good chance to shape the library API if you're planning on using that within your application.

Even though I will make the new GladTeX mostly compatible with the old GladTeX version, I'll probably leave out things which I feel are not worth keeping.

Powered by Debian GNU/Linux
© Sebastian Humenda, last modified 20/08/2015