Vertical alignment of inline math with firefox and IE

601 views
Skip to first unread message

Christian

unread,
Sep 23, 2011, 10:15:10 AM9/23/11
to MathJax Users
Hi there!

I'm using mathajax within a Joomla-Website embedding LaTeX code in
HTML. It works really great except the one problem I've been search
now hours and days without finding a solution.

All inline math set with \(\) won't display correct with firefox a and
IE. The vertical alignment with the text is broken as you can see on
this site:

http://www.mathelike.de/mathematik-abiturloesungen/musterabitur-bayern-2011-g8/stochastik-i/teilaufgabe-4b.html

or any other site...

And here's how I've set up mathjax:

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/
latest/MathJax.js">

MathJax.Hub.Config({
MMLorHTML: {
prefer: {Firefox: "HTML"}
},
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/
NativeMML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js"],
displayMath: [ ['$$','$$'], ['\[','\]']],
inlineMath: [ ['$','$'], ['\\(','\\)'] ],
displayAlign: "left",
displayIndent: "0em",
TeX: {
extensions:
["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
}
});
</script>

Hope someone can help. Thanks for any assistance!

Christian

Davide P. Cervone

unread,
Sep 24, 2011, 10:58:15 AM9/24/11
to mathja...@googlegroups.com
The problem is that template_css.css includes

* { vertical-align: top }

(among other attributes for "*")

and that is causing all the math to align to the top of the line
rather than the baseline. If you can remove that, it would solve the
problem. If not, you might try including

.MathJax, .MathJax_Display { vertical-align: baseline }

of perhaps

.MathJax *, .MathJax_Display * { vertical-align: baseline }

(or both) in order to counteract this alignment setting for the
MathJax output.

Davide

Christian

unread,
Oct 2, 2011, 10:56:09 AM10/2/11
to MathJax Users
Thank you so much! Works like a dream.

And sorry for being late with my response.

Christian

On 24 Sep., 16:58, "Davide P. Cervone" <d...@union.edu> wrote:
> The problem is that template_css.css includes
>
>         * { vertical-align: top }
>
> (among other attributes for "*")
>
> and that is causing all the math to align to the top of the line  
> rather than the baseline.  If you can remove that, it would solve the  
> problem.  If not, you might try including
>
>         .MathJax, .MathJax_Display { vertical-align: baseline }
>
> of perhaps
>
>         .MathJax *, .MathJax_Display * { vertical-align: baseline }
>
> (or both) in order to counteract this alignment setting for the  
> MathJax output.
>
> Davide
>
> On Sep 23, 2011, at 10:15 AM, Christian wrote:
>
>
>
>
>
>
>
> > Hi there!
>
> > I'm using mathajax within a Joomla-Website embedding LaTeX code in
> > HTML. It works really great except the one problem I've been search
> > now hours and days without finding a solution.
>
> > All inline math set with \(\) won't display correct with firefox a and
> > IE. The vertical alignment with the text is broken as you can see on
> > this site:
>
> >http://www.mathelike.de/mathematik-abiturloesungen/musterabitur-bayer...
Reply all
Reply to author
Forward
0 new messages