-
MathType
-
WirisQuizzes
-
Nubric
-
CalcMe
-
MathPlayer
-
Store FAQ
-
MathFlow
-
BF FAQ
-
Miscellaneous
-
Wiris Integrations
Migrate MathType image formulas to MathML
Reading time: 1minFollowing the steps in this article, you will learn to replace MathType image formulas with their equivalent MathML representation.
Prerequistes:
- Access to the HTML content containing MathType image formulas.
- Image formulas must contain the
data-mathmlattribute.
Step 1. Locate MathType image formulas
Find all image elements with the class:
Wirisformula
Example:
<img class="Wirisformula" ... data-mathml="...">
Step 2. Extract the MathML
Read the value stored in the data-mathml attribute.
The MathML is encoded using replacement characters.
Step 3. Decode the MathML
Apply the following replacements:
| Replace | With |
|---|---|
« |
< |
» |
> |
§ |
& |
¨ |
" |
` |
' |
Step 4. Replace image formulas with MathML
Replace the original image element with the decoded MathML.
Example:
<mi>x</mi>
instead of:
«mi»x«/mi»
Verify the migration
- The formula is stored as MathML.
- The image element has been removed.
- The formula renders correctly using MathML mode.
Troubleshooting
| Issue | Possible cause |
|---|---|
| Invalid MathML after migration | One or more replacement characters were not decoded. |
| Formula does not render | WIRISplugins.js is not loaded. |
| No MathML available | The image formula does not contain a data-mathml attribute. |
Related resources: