TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As suggested by the answer to my question here, I am using the Sphinx tool in order to multi-target PDF and HTML output. For HTML, I'm using the pngmath extension.

The vertical alignment of inline math in the HTML output is very bothersome. The math equations are positioned below where they should and this causes the entire rendered page to look bad because none of the equations are lined-up properly.

Does anyone know how this can be fixed?

share|improve this question
up vote 3 down vote accepted

See my question about exactly that, in short the solution is to add to conf.py:

pngmath_latex_preamble=r'\usepackage[active]{preview}' # + other custom stuff for inline math, such as non-default math fonts etc.

This "feature" is explained in sphinx docs.

share|improve this answer
Thanks! That fixed it. Why anyone would want that "feature" escapse me. – 3Sphere Jul 30 '11 at 19:01
They say it is because the preview package does not come installed with LaTeX in all distributions. Personally I think it would be better to force people install it, because it really looks horrible without it. – eudoxos Jul 31 '11 at 8:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.