Forum Bugs

MathML square root in denonimator of fraction needs spacing

Yardboy
Hi -

Displaying MathML, the spacing below the horizontal divider of a fraction is insufficient. If the denominator is a square root, the top of the square root symbol and the horizontal divider of the fraction meld together at smaller font sizes (10/12pt). At higher font sizes it becomes possible, with close scrutiny, to see the top of the square root symbol, but it's still quite a bit less than ideal.

How can I get a little spacing between the fraction divider and the content below it? I tried several css stylings, before searching and finding here that you don't apply css to the MathML.

Attached image demonstrates - top is from Prince-generated PDF at 12pt text, middle is same but with MathML at 18pt (undesirable), bottom is browser page display of MathJax rendering, which is how we'd like to see it in the PDF.

Thanks.
c.
  1. Untitled-1.png11.4 kB
bfelix
bump. Same issue for us.
StoneCypher
Add top padding to the denominator wrapper, increase line spacing or use a less naive font.

In general, if you provide source, you get better answers.

John Haugeland is http://fullof.bs/

Yardboy
StoneCypher wrote:
Add top padding to the denominator wrapper, increase line spacing or use a less naive font.

In general, if you provide source, you get better answers.


John -

I appreciate your input. As noted in OP, I've tried several combinations of css, to no avail. Information within this forum (http://www.princexml.com/bb/viewtopic.php?p=7740#p7740) indicates that Prince does not apply CSS styling to MathML, although this post (http://www.princexml.com/bb/viewtopic.php?f=5&t=3668) from several months later seems to imply support.

In any case, source is below. In my own work to solve this issue, I've added padding-top, margin-top and line-height declarations to each of: the second mrow within the mfrac (denominator wrapper), the msqrt, the mrow within the msqrt. I've done so within the referenced stylesheet as well as inline on the elements themselves, with and with out !important directives. None of this has any impact to the PDF output.

<span class="class1">
  <b>
    Which&#xA0;fraction is the simplest form of 
    <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mrow>
        <mfrac>
          <mrow>
            <mn>7</mn>
          </mrow>
          <mrow>
            <msqrt>
              <mrow>
                <mn>10</mn>
              </mrow>
            </msqrt>
          </mrow>
        </mfrac>
        <mtext>?</mtext>
      </mrow>
    </math>
  </b>
</span>


Note that the source is provided by a third party and I have no control over it, other than what I can manipulate myself with code, regex, etc.
StoneCypher
Notably, those are all things which require a display:block or display:inline-block element.

Start by setting something that applies to basically all tags, like the color, to make sure your rule is actually getting applied.

If it is, then set display:block to see if the display mode is preventing styling.

John Haugeland is http://fullof.bs/

mikeday
Currently in Prince most layout related CSS properties do not apply to MathML elements.
Yardboy
mikeday wrote:
Currently in Prince most layout related CSS properties do not apply to MathML elements.


Thanks, Mike. This was my initial understanding, as noted in OP. I'm wondering about that second link I posted later, though, that seems to imply there is support. Any insight?
mikeday
It is possible to typeset equations using pure CSS, essentially emulating native MathML support using CSS layout properties. Basically a fraction becomes a little table with one column and two rows, and so on.