Skip to main content
Molly25619246empt
Participant
February 7, 2023
Question

How to stack equations aligned by the = sign using MathXMLcode brought over from word.

  • February 7, 2023
  • 3 replies
  • 224 views

I created this code using Word. In word it is aligned by equal signs, but as is clear, the alignment disappears when I clip and paste it.  What can I do to align this when I drop the MathXML into my Dreamweaver HTML?  Thanks.  

 

 

 

 

 

 

    This topic has been closed for replies.

    3 replies

    BenPleysier
    Community Expert
    Community Expert
    February 7, 2023

    You could use an image as you have done here.

     

    Another solution is to use HTML as in (using Bootstrap 5)

     

     

     

    <div class="d-flex align-items-center">
        <div class="pe-2">=</div>
        <div class="pe-2"><span class="border-bottom">[X]decarbonated</span><br>[AI]decarbonated</div>
        <div class="pe-2">x</div>
        <div class="pe-2">[AI]washed</div>
        <div class="pe-2">+</div>
        <div>[X]carb</div>
    </div>
    

     

     

     

    with this result

     

    Edit: You will need to style the bottom border a bit further.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Nancy OShea
    Community Expert
    Community Expert
    February 7, 2023

    What will this be used for?

    I ask because you might have better results exporting from Word to PDF (print) rather than HTML.

     

     

     

     

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    February 7, 2023

    I don't know of any automatic way of doing this. Probably the easiest would be to have a 3 column table, with an equation in a given row...

    In the center column would be the equal sign.
    Everything to the left of the equal sign would be right aligned, in the left colum.
    Everything right of the sign would be in the right column and left aligned.

    <table>
    <tr class="equation">
    <td>left equation bits</td>
    <td>=</td>
    <td>right equation bits</td>
    </tr>
    <tr class="equation">
    <td>some other left equation bits</td>
    <td>=</td>
    <td>some other right equation bits</td>
    </tr>
    <tr class="equation">
    <td>and yet more left equation bits</td>
    <td>=</td>
    <td>and yet more right equation bits</td>
    </tr>
    </table>

    Then use the first-child and last-child selectors in the css to align them...

    tr.equation > td:first-child {text-align:right;}
    tr.equation > td:last-child {text-align:left;}