[Pmwiki-users] Math->image using LaTeX (was Re: More blue skye stuff...)

Patrick R. Michaud pmichaud
Thu Feb 5 11:27:05 CST 2004


On Thu, Feb 05, 2004 at 01:26:35AM +0100, Christian Ridderstr?m wrote:
> I have a mockup here:
> 	http://www.lyx.org/~chr/wiki/pmwiki.php?pagename=Math.Math
> 
> A statement such as [[$ e+f = \sqrt{r^2 - x^2} $]] invokes a function 
> called FmtMath() with 'e+f = \sqrt{r^2 - x^2}' as one of the arguments. 

I like the markup chosen here.

> A practical feature What's probably missing is a cacheing system. Before
> converting the latex, FmtMath() or the external script, should check if
> this particular piece of latex has already been converted. OTOH, if we
> cache these images we'll also need to do garbage collection so that the
> size cache-directory doesn't increase arbitrarily.

Easy:  MD5 hash the string in brackets, and use that as the name of the 
(cached) file containing the output.  Whenever a formula is encountered,
perform an MD5 to determine the appropriate cache file to send.  If the
cache file doesn't exist, create it before sending.

To keep the cache directory from overflowing, just remove it on a periodic
basis and let the system recreate the (cache) files as needed.

Pm



More information about the pmwiki-users mailing list