github/gollum — pull request #377 by pipex (2012-06-11 09:46:23+00:00)
Title: [Fix] Inline latex formula alignment

Fixed an issue of latex inline formulas not aligning correctly with
the text. The fix is a ruby translation of the Perl code described in
http://tex.stackexchange.com/questions/44486/pixel-perfect-vertical-alignment-of-image-rendered-tex-snippets. This code calculates the alignment of the generated image depending on
the image size and the size of the white space between the formula and
the margins of the image.

The alignment now is nearly perfect, however the new rendering comes
with a performance impact because of the increased number of operations.
To reduce this impact, the generated images and calculated values for
the alignment are now cached in `~/.cache/gollum`. The caching is done
per formula and not per page, thus avoiding caching the same formula
twice. I think a better caching alternative would be to save the alignment
parameters in the browser session and let the browser cache the image,
however i have not figured out how to do that yet.

The Readme and tests have been modified accordingly with the new tool
requirements and expected markup.

Hope you find it useful

--
**pipex**