MathParser
MathParser is a freeware tool that converts MathML into LaTeX. It processes pure MathML code as well as HTML with embedded MathML. It also offers a special built-in parser for Mathcad HTML/MathML files.
You do not have to retype all equations for publishing anymore.
MathParser is written in Java™ and runs on every computer with a Java Runtime Environment (version 1.4 and higher).
Note: Currently MathParser only processes MathML in 'presentation markup' notation.
Java and the Java Coffee Cup Logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
top of page

-
Enter the input file. You can also use the "Browse..." button to choose the input file.
-
Set the format of the input file. If the input is pure MathML (usually files ending with '.mml'), choose MathML.
If the MathML code is embedded in HTML (usually files ending with '.html'), choose HTML/MathML.
If you want to convert a Mathcad file, export it as "HTML/MathML file for IBM techexplorer". In older versions (Mathcad 2001) you will find this file format if you choose "Save as.." from the "File" menu.
In Mathcad 11 you have to choose "Save as Web Page...". When you save the file, an options screen will appear. Select "Save equation as: MathML" and "Display using: IBM Techexplorer".
Select Mathcad MathML/HTML as file format in MathParser then.
-
If you want the result of the conversion to be saved directly, choose "File" from the "Output" box and enter the name of the target file.
If you want to get the conversion result on screen, choose "Window".
-
Choose from the "Options" menu:
-
Mark "Write LaTeX header" if you want a complete LaTeX document to be generated. In this case MathParser uses its standard header. (See also: "Advanced Users: Editing MathParser's substitution table and standard header")
-
Mark "Skip unknown entities" if you do not want unknown MathML keywords to be inserted in the output with the comment 'NOT_FOUND'.
-
You can choose in what way "Formulae" are inserted in the output: Embedded (into the text), set off (every formula in a new paragraph) or enumerated (every formula in a new paragraph with enumeration).
-
Once you have defined all options start the conversion by clicking the "Convert" button.
When finished the convertion a message will appear or, if you chose "Window" for output, the LaTeX code will be shown in a new window where you can edit and copy the resulting code.
top of page
You can contact us for questions and feedback at http://www.tilman.de/mathparser where you can also download the latest version of MathParser for free.
top of page
MathParser needs two text files for MathML conversion: 'substitutions.txt' defines, which LaTeX keyword replaces which MathML keyword, 'header.txt' contains the LaTeX header that is inserted at the beginning of the output if you chose "Write LaTeX header" from the options menu.
Both files can be edited with a simple text editor.
You can download 'substitutions.txt' and 'header.txt' from the MathParser Homepage or extract it from the program file with a ZIP compatible compression utility.
Editing the files
In 'header.txt' simply write down the LaTeX header for the converted files.
In 'substitutions.txt' you can enter a LaTeX substitution for a MathML element in every line.
There are two kinds of MathML elements to be substituted: Entities end tags. Entities are place holders for special characters and symbols which can be substituted directly. Tags define a logical correlation between blocks.
Enter a substitution for an entity in this way:
[entity] [tab(s)] [LaTeX substitution]
Example:
ε \epsilon
(Substitution for the MathML entity that represents the greek character epsilon)
Tags enclose one or more blocks of data like this: <tag>block(s)</tag>. Since the order of the inner blocks in MathML can differ from the order in LaTeX notation, the substitution has to disclose MathParser the correct sequence of blocks. For this purpose the keyword %BLOCK[block no.]% is used.
Example:
<mroot> \sqrt[%BLOCK2%]{%BLOCK1%}
This is the substitution for the MathML element for roots. In MathML the root's exponent follows the radicand while in LaTeX the notation is the other way around. Thus we need to tell MathParser to alter the block order by exchanging BLOCK2 and BLOCK1.
Applying the edited files to MathParser
To use your edited files with MathParser, just put it into the same directory with the program file. On startup, MathParser seeks for 'substitutions.txt' and 'header.txt' in the program directory. If they are not found the built-in configuration files are used.
top of page