On Friday 14 November 2008 17:35:38 Sebastian Wiesner wrote: > Friday 14 November 2008 18:16:17 Fredrik Johansson > > > On Fri, Nov 14, 2008 at 5:44 PM, Sebastian Wiesner > > > > <[EMAIL PROTECTED]> wrote: > > > Friday 14 November 2008 17:17:26 Fredrik Johansson > > > > > >> 1. Inline equations need proper vertical alignment. > > > > > > Proper vertical alignment is supported by Sphinx, but depends on the > > > latex- preview package. Since this package is not available > > > everywhere, Sphinx does not use it by default. But if you're sure, > > > that the package is installed, set "pngmath_use_preview" to True in > > > conf.py, and rebuild the docs. This will result in proper image > > > alignment. > > > > As I said in the followup, vertical-align:middle would work in most > > cases. Certainly, it is a better default. If no one agrees, at least > > give me a CSS class for formulas so I can vertical-align:middle them > > myself :-) > > I doubt, that vertical-align:middle works as expected. The baseline is not > necessarily located in the vertical center of the image. > > Image a formula containing only lowercase letters (e.g. "a + c"). > Centering such an image would center the lowercase "a" on the line, which > is certainly not, what you want. Even more problematic are formulas like > "g + a", which contain letters reaching below the baseline. Centering this > image would center "g" on line, making it look more like "9" than like "g".
Just as a sidenote: I wrote a docutils math directive/role using matplotlib which doesn't require TeX and uses (a subset of) the same syntax. It generates PNGs I then embed in PDFs but it should be trivial to make it work for HTML. And the vertical alignment for inline math works: http://www.flickr.com/photos/ralsina/3029812713/ You can find the code here: http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/math_directive.py (the docutils directive) http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/math_flowable.py (the simple matplotlib/reportlab code which should be easy to adapt for HTML output. Ignore drawOn, use genImage and descent) It should even be possible to use SVGs instead of PNGs which would make things look *much* better. IMVHO, most PNG math looks very very ugly aliased and generally low quality :-( There are some problems with it because I don't actually **use** it,so it's not very tested (spacing issues, some, and yes, alignment issues). -- ("\''/").__..-''"`-. . Roberto Alsina `9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH) (_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar _..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia (l)-'' ((i).' ((!.' according to alexa.com (27/5/2007) Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian W. Kernighan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---
