I wrote a plugin (intended to be used as a filter) which takes LaTeX
input and turns it an IMG element which uses Google's chart API to
render the output. I unimaginatively named the modue
Template::Plugin::GoogleLaTeX. I would like to upload it to CPAN but I
do not want to trample on the Template::Plugin namespace without
checking first. Is that name OK?
Example usage:
[%- USE GoogleLaTeX -%]
<p>[%- FILTER latex
alt = '[ Utility maximization ]',
title = 'Utility maximization',
class = 'display',
style = 'border:3px outset #dde; padding:16px;',
id = 'umax',
height = 100,
color = 'fa1111',
fill = 'bg,lg,20,ddddee,1,1111ff,0'
-%]
\begin{eqnarray}
\max U(x,y) & = & \ln x + \ln y \\
\mathrm{s.t.} & & p_xx + p_yy = I \\
& & x \geq 0, y \geq 0
\end{eqnarray}
[%- END -%]
</p>
results in
<p><img
src="http://chart.apis.google.com/chart?cht=tx&chf=bg,lg,20,ddddee,1,1111ff,0&chl=%5Cbegin%7Beqnarray%7D%0D%0A%5Cmax%20U(x%2Cy)%20%26%20%3D%20%26%20%5Cln%20x%20%2B%20%5Cln%20y%20%5C%5C%0D%0A%5Cmathrm%7Bs.t.%7D%20%26%20%26%20p_xx%20%2B%20p_yy%20%3D%20I%20%5C%5C%0D%0A%26%20%26%20x%20%5Cgeq%200%2C%20y%20%5Cgeq%200%20%0D%0A%5Cend%7Beqnarray%7D&chco=fa1111&chs=100"
id="umax" class="display" style="border:3px outset #dde;
padding:16px;" alt="[ Utility maximization ]" title="Utility
maximization" height="100"></p>
--
A. Sinan Unur
http://www.unur.com/sinan/
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates