Search:

# LaTeXMathML

Summary: Translating LaTeX math notation dynamically to Presentation MathML
Version: 2007-10-04
Prerequisites: pmwiki-2.0.0
Status: Stable
Maintainer: Nicolas Poulain
Categories: Markup Math

## Questions answered by this recipe

• How can I translate LaTeX math notation dynamically to Presentation MathML

## Description

Embed MathML contents in webpages with LaTeX syntax.

## Notes

LaTeXMathML is a JavaScript program has been created by modifying Peter Jipsen's ASCIIMathML.js script.
See :http://www.maths.nottingham.ac.uk/personal/drw/lm.html for informations.

2. Unzip LaTeXMathML.zip package into your PmWiki's root folder so that
1. the LaTeXMathML.php file goes into your PmWiki's cookbook/ directory
2. the LaTeXMathML.js file goes into a new directory called LaTeXMathML/ into your PmWiki's pub/ directory
3. Add the following line to a local customization file:
    include_once('cookbook/LaTeXMathML.php');


The script adds $$...$$ and $...$ markups that display MathML from LaTeX syntax, the first form centers the equation, while the second generates the equation "inline".

## Release Notes

Achoo, 02 July 2008: Thanks for the great job! However, while the markup $..$ for inline mode works fine, I can't manage to make the display mode $$..$$ to work. Any ideas/clues? (note: when I unzip the attachment it gives the date of 2006 instead of 2007, is it possible that the old version is uploaded by mistake?)

Well, I'm SO happy it works! I don't mind that the $$...$$ doesn't work in any way whatsoever!
They're not as pretty as the ones shown... really cramped and titchy like mimetex... bit of downer. promsan ...actually I do... I got the smooth and lovely fonts running, but only inline {$...$}; so I've rigged up jsMath... which produces the centred fonts but so far only in rougharse mimetex - no delicious PDF-smooth integral signs yet! promsan

RvdB, 27 feb 2009: The markup code for the $$..$$ seems to be wrong. I have replaced Markup('$$', '<{', with Markup('$$', '<', and now i get a centered equation in the div with align=center attribute (probably a typo, or the directive was orignally intended to be {$). But alas, the \displaystyle wrapper doesn't seem to work; i still get the inline style for the equations, in my case sub en super scripts for the integral limits. Brian C. Becker, 20 August, 2009: For $$to work properly (equation centered on its own line), add this line to the end of LaTeXMathML.php. If you would like to use LaTeX's usual $$...$$ as well, you can add the second line as well: Markup("working$$", "_begin", "/\\$\\$(.*?)\\$\\/", "<div align=\"center\">\1\</div>"); Markup("nlequation", "_begin", "/^\\$$\s*(.*?)\s*\\$$/m", "<div align=\"center\">\1\</div>");
Cookbook /
ASCIIMath  Display MathML rendered ascii formula into PmWiki 2.x pages (Stable)
Formula  Lightweight rendering of mathematical formulas in wiki pages (Beta)
JsMath  Add markup to display and embed mathematical formulas in wiki pages using TeX. (Stable)
LinuxTex  Enable TeX markup
MathJax  Add markup to embed math using TeX syntax. (Stable)
Mathtex  Add markup to display and embed several lines of mathematical formulas in wiki pages (testing)
MimeTeX  Add markup to display and embed mathematical formulas in wiki pages (Stable)
SimpleJsMath
TrueLatex  Enables interpretation and rendering of real LaTeX markups in PmWiki. Support for XeLaTex included in v1.8. (Working perfectly. Very simple to use, customizable and comes with lots of options.)

## Contributors

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Page last modified on January 12, 2012, at 10:09 AM