Vertically collapsing fractions

10 views
Skip to first unread message

andrei.s...@gmail.com

unread,
Nov 8, 2016, 8:14:32 AM11/8/16
to MathJax Users
I'm trying to use MathJax in a PBworks wiki by including the standard script into the sidebar that apperas on every page. It works well with an exception that all the fractions appear collapsed, like in the following picture:

,

which is produced by \( x = \frac{\quad 1}{2 \quad} \).

I assume that such behaviour is somehow caused by the MathJax attempt to not break the line spacing. The thing is, the PBworks editor encloses each paragraph into <p><span></span></p>. Editing the source of the page to delete the paragraph tag surrounding the formula fixes the problem, but it would reappear at each of the next edits.

I wonder what exactly can be the problem with MathJax processing a formula inside a paragraph tag and how can I fix it (preferrably on the side of MathJax settings)?



Peter Krautzberger

unread,
Nov 8, 2016, 8:17:01 AM11/8/16
to mathja...@googlegroups.com
Hi Andrei,

It's very unlikely that this kind of document structure is causing the problem but it's hard to say mcuh without a live sample exhibiting the problem. 

Could you share one?

Regards,
Peter.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andrei.s...@gmail.com

unread,
Nov 8, 2016, 8:30:44 AM11/8/16
to MathJax Users
Here it is.
http://mathjaxtest.pbworks.com/w/page/112808551/FrontPage - this is the page where the issue appears.
http://mathjaxtest.pbworks.com/w/page/112808557/SideBar - this is the sidebar with the script embedded.

вторник, 8 ноября 2016 г., 16:17:01 UTC+3 пользователь Peter Krautzberger написал:
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.

Peter Krautzberger

unread,
Nov 8, 2016, 8:42:54 AM11/8/16
to mathja...@googlegroups.com
Hi Andrei,

Thanks for the sample.

The problem stems from the surrounding (aggressive) page CSS which affects the CommonHTML output, that is:

.wikistyle p span {
   line-height: 1.2em;
}

will force a line-height change to MathJax's spans.

You can add

.mjx-math *{
  line-height: 0!important;
}

to your CSS to reset it.

@dpvc is that worth adding on our end?

Regards,
Peter.

To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.

Davide Cervone

unread,
Nov 8, 2016, 8:53:19 AM11/8/16
to mathja...@googlegroups.com
> You can add
>
> .mjx-math *{
> line-height: 0!important;
> }
>
> to your CSS to reset it.
>
> @dpvc is that worth adding on our end?

We already have this, but without the "!important". I suppose it would be possible to add "!important" to everything, but even that can be overridden by external CSS that is more specific and also marked !important. So it is no guarantee.

Davide

andrei.s...@gmail.com

unread,
Nov 8, 2016, 8:53:47 AM11/8/16
to MathJax Users
Thanks a lot, that fixes the problem completely.

вторник, 8 ноября 2016 г., 16:42:54 UTC+3 пользователь Peter Krautzberger написал:

Peter Krautzberger

unread,
Nov 8, 2016, 9:41:52 AM11/8/16
to mathja...@googlegroups.com
So it is no guarantee.

Right. Let's not then.

Peter.

Reply all
Reply to author
Forward
0 new messages