jQuery for LaTeX in HTML |
Sean B. Palmer |
23/10/10 05:02 |
<script src="http://goo.gl/LISf"></script> <script> $(document).ready(function() { $('code').each(function(i, e) { e = $(e) latex = e.text() chart = 'http://www.google.com/chart?cht=tx&chl=' enc = encodeURIComponent(latex) e.replaceWith('<img src="' + chart + enc + '" alt="' + latex + '">') }); }) </script> Put that in your HTML files and elements like Combined with Markdown and using a Wikipedia short base URI: <base href="http://enwp.org/"> This can be really beautiful as you can do things like: The [Leibniz formula](Leibniz_formula_for_pi) for [π](π) is `1 \,-\, But there is one problem, in that Markdown sucks. When you put a Another slight annoyance is that you have to use <code> elements again Apart from that, this is a pretty nice combination, and it degrades |