MathML Formatting - Preventing Vertical Compression

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
cjeffrey
Jr. Propeller Head
Posts: 2
Joined: Wed Dec 21, 2016 3:29 pm

MathML Formatting - Preventing Vertical Compression

Post by cjeffrey »

I am copying and pasting MathML equations from Word into Flare, between <p><MadCap:equation></MadCap:equation></p> tags. The result is as shown in the following example:

Code: Select all

               <p><MadCap:equation>
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
                        <mml:mi>R</mml:mi>
                        <mml:mi>F</mml:mi>
                        <mml:mo>=</mml:mo>
                        <mml:mi> </mml:mi>
                        <mml:mfrac>
                            <mml:mrow>
                                <mml:mn>1</mml:mn>
                            </mml:mrow>
                            <mml:mrow>
                                <mml:mn>1</mml:mn>
                                <mml:mo>+</mml:mo>
                                <mml:mi>R</mml:mi>
                                <mml:mi>E</mml:mi>
                                <mml:mi>F</mml:mi>
                                <mml:mo>×</mml:mo>
                                <mml:msub>
                                    <mml:mrow>
                                        <mml:mi>F</mml:mi>
                                    </mml:mrow>
                                    <mml:mrow>
                                        <mml:mi>s</mml:mi>
                                        <mml:mi>u</mml:mi>
                                        <mml:mi>r</mml:mi>
                                        <mml:mi>f</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                                <mml:mo>×</mml:mo>
                                <mml:msub>
                                    <mml:mrow>
                                        <mml:mi>F</mml:mi>
                                    </mml:mrow>
                                    <mml:mrow>
                                        <mml:mi>s</mml:mi>
                                        <mml:mi>a</mml:mi>
                                        <mml:mi>l</mml:mi>
                                    </mml:mrow>
                                </mml:msub>
                            </mml:mrow>
                        </mml:mfrac>
                    </mml:math>
                </MadCap:equation></p>
If the equation has a fraction, or a large operator (integral or summation) with indices above and below, the image is rendering vertically compressed (or the indices are brought after the operator).
ExampleEquation.png
I have struggled for quite a while but can't figure out how to resolve this. Is it a Flare limitation? Or am I not using MathML properly? I am using Flare version 2017.
You do not have the required permissions to view the files attached to this post.
cjeffrey
Jr. Propeller Head
Posts: 2
Joined: Wed Dec 21, 2016 3:29 pm

Re: MathML Formatting - Preventing Vertical Compression

Post by cjeffrey »

I think I have resolved my problem by inserting <mml:mstyle displaystyle="true"> after the <mml:math> tag (and close it before </mml:math>), as follows:

Code: Select all

                <MadCap:equation class="standalone">
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
                        <mml:mstyle displaystyle="true">
                            <mml:mi>R</mml:mi>
                            <mml:mi>F</mml:mi>
                            <mml:mo>=</mml:mo>
                                ...
I have used this in a lot of equations now and it seems to work quite nicely. By the way, my "standalone" class just adds a bit of space around the equation.
You do not have the required permissions to view the files attached to this post.
Post Reply