I am looking for a way of generating PNG images of equations from LATEX source code embedded in templates. For example, given:
[% FILTER latex_display ]
\begin{eqnarray*}
\max && U(x,y) \\
\mathrm{s.t.} && p_x x + p_y y \leq I \\
&& x \geq 0, y \geq 0
\end{eqnarray*}
[% END %]
I would like to get the output:
<div class="latex display"><img src="equation.png" width="x" height="y"></div>
which should ultimately display as:
I am using ttree to generate documents offline. I know about Template::Plugin::Latex but that is geared towards producing actual documents out of LATEX templates.
Any suggestions?
I appreciate the suggestions (and I have voted them up). However, they are no quite what I need. I would really appreciate a few pointers towards getting started with a Plugin or Filter for Template Toolkit.
Wikipedia does something similar to what you want. They use a program called texcv
. Then you also have MathJAX which is more aimed at dynamic math rendering in web-pages.
texcv
is according to the linked page written in OCaml however since the rest of Mediawiki is written in PHP I don't think you should have any problem with repurposing the program to use with Perl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With