MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Workshop (https://www.mobileread.com/forums/forumdisplay.php?f=178)
-   -   dynamically scale MathML equations (https://www.mobileread.com/forums/showthread.php?t=261917)

user2178319 06-18-2015 03:41 PM

dynamically scale MathML equations
 
1 Attachment(s)
Hello,

I have an EPUB3 that includes a lot of MathML. I would prefer to not use flat figure because we already have the MathML. it's showing up in iBooks, which is good, but the longer equations are breaking onto new lines and gernerally rendering poorly. Is there a way I can manipulate the CSS to have it scale proportionally?

Here is my current code for one of the example equations:
Code:

<p class="TxtC">Or, more simply:</p>

<div class="equation-grp"><div class="equation"><p class="Eqn"><epub:switch>
    <epub:case required-namespace="http://www.w3.org/1998/Math/MathML">
        <math xmlns='http://www.w3.org/1998/Math/MathML' overflow="scroll" xref="c003.e008-mml" id="c003.e008-mml">
                        <mrow>
                            <msub>
                                <mrow>
                                    <mtext>Cumulative Incidence</mtext>
                                </mrow>
                                <mrow>
                                    <mn>2</mn>
                                    <mspace width="1pt"/>
                                    <mtext>years</mtext>
                                </mrow>
                            </msub>
                            <mo>=</mo>
                            <mn>1</mn>
                            <mo>&#x2212;</mo>
                            <mspace width="1pt"/>
                            <msup>
                                <mrow>
                                    <mrow>
                                        <mo>(</mo>
                                        <mrow>
                                            <mn>1</mn>
                                            <mo>&#x2212;</mo>
                                            <mtext>Annual Incidence Proportion</mtext>
                                        </mrow>
                                        <mo>)</mo>
                                    </mrow>
                                </mrow>
                                <mn>2</mn>
                            </msup>
                        </mrow>
        </math>
    </epub:case>
    <epub:default>
        <img id="test_equation-c003.e008" alt="c003.e008" src="../Images/9781550595734.c003.e008.jpg"/>
    </epub:default>
</epub:switch></p></div></div>

<p class="TxtC">And this leads to a more general way of anticipating cumulative incidence over a set
    of risk intervals:</p>

And here is my current CSS:

Code:

math{
    font-family:'Asana-Math','Cambria Math', Cambria, MathJax_Main,
                    STIXGeneral, OpenSymbol, serif !important;
    font-size: 100% !important;
    width:80% !important;
}

Any help on this matter would be enormously appreciated, I would like to keep the MathML without re-sizing each equation and without forcing linebreaks.

jwlewis 07-01-2015 09:04 AM

I looked at your long equation in FireFox, iBooks, Kobo for iPad/iPhone, and Gitden Readers. I think the problem is that the equation is just too long. It renders OK in FireFox, but not in the other readers. I suggest abbreviating "Cumulative Incidence" to "CI" and "Annual Incidence Proportion" to "AIP". That would shorten the equation and maybe keep it on one line.


All times are GMT -4. The time now is 10:23 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.