View Single Post
Old 06-18-2015, 02:41 PM   #1
user2178319
Junior Member
user2178319 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2015
Device: Kobo
dynamically scale MathML equations

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.
Attached Thumbnails
Click image for larger version

Name:	photo.PNG
Views:	397
Size:	82.1 KB
ID:	139414  
user2178319 is offline   Reply With Quote