An alternative to the TeX Notation filter

An alternative to the TeX Notation filter

by Tim Hunt -
Number of replies: 7
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
My colleague Jonathan Fine has been working on a cool JISC-funded project called MathTran. It is basically a web-service for rendering TeX. He gave a presentation about it this afternoon, and I realised it would be really easy to make a version of the TeX filter that used MathTran instead. I was right, it was easy, it took less than an hour.

You can get it from the modules and plugins database, once the moderators have approved the entry.

One thing that MathTran allows, that the old filter does not is that it lets you align the baseline of the maths with the baseline of the surrounding text.

Note what it says in the database: Since this filter places load on the server at MathTran.org, we request that you contact webmaster@mathtran.org before you deploy this in a production environment, but you are welcome to experiment with it.
Average of ratings: -
In reply to Tim Hunt

Re: An alternative to the TeX Notation filter

by Cristina Berisso -

From the examples shown in the MathTrans site, the Math expressions are far more elegant than with standard TeX filter, and also the aligning with the text is fantastic. I would love to use it but I am a little scared that not all the  Math expressions that I have typed already using the previous TeX filter in the quizzes for my course would render correctly. In trying TeX expressions using the "How to use TeX tips" interactive tool via the link to mathtran.org, I noticed that some expressions in TeX do not render properly, in particular those that contain roots different from square roots. I am giving an example below of an expression with a cubic root rendered by TeX and how MathTran interpreted it.

Tex -->

TeX rendering

MathTran -->

 mathtran rendering example 1

Do you know which are the TeX notations that may not be accepted by MathTran or where to find a document with instructions for the equivalent expressions?

Thank you for this great addition!

In reply to Cristina Berisso

Re: An alternative to the TeX Notation filter

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The difference is to do with the difference between TeX and LaTex. TeX is the original type-setting system for maths, and LaTeX is a set of macros built on top of TeX that converts higher-level constructs like \sqrt[3]{216\,x^5\,y^5} into lower level TeX commands before they are rendered.

mimetex, which is what powers the Moodle TeX filter is acutally based on LaTeX. MathTran is mostly based of TeX.

Let me explain the 'mostly' in the previous sentence. The decision to use plain TeX for mathtran was based on good technical considerations to do with how to make the service fast and secure. However, the extra commands in LaTeX are clearly useful. Well, lots of the commands in LaTeX are useful, but there are also lots of really obscure and complex commands that are hardly ever used. Another consideration is that the MathTran project has other goals, for example a TeX to MathML converter, which is very hard to do, but would be really, really useful. So what MathTran is going to do is, to re-implement a subset of the extra commands in LaTeX, which are the ones that people acutally use in practice. The aim is to render close to 100% of all the LaTeX out there. But by keeping the subset of commands small-ish, they make it possible to do more interesting processing on the data later, for instance conversion to MathML.

The upshop of all that is that Jonathan would like to hear about examples of expressions that LaTeX can render, but which MathTran can't yet, and which are actually used in real mathematics.

Therefore, please do send you example to Jonathan in one of the ways listed here: http://mathtran.org/contact.html. (I don't think Jonathan reads this forum.)


P.S. Why is conversion to MathML cool? Well it enables two things that are not currenly possible. First, it lets you copy-and-paste expressions (or parts of expressions) into other programs. This includes symbolic algrebra programs like Mathematica, and also the new equation editor in Word 2007. Second, the Daisy taking book project has adopted MathML as its standard for maths, so MathML is good news for accessibility. However, MathML is a horrible format to have to create, it is much easier to type maths in TeX, so a TeX to MathML converter is what is needed. However, it is far from easy, because the meaning of a lot of bits of maths expressions depends on the context. So, a converter is going to take some sort of artificial intelligence.
In reply to Tim Hunt

Re: An alternative to the TeX Notation filter

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
One small point, mimetex is actually the fallback position. Since 1.6 the filter is powered by "proper" latex and ghostscript binaries if they exist, which provides much better rendering and a fuller syntax.
In reply to Cristina Berisso

Re: An alternative to the TeX Notation filter

by Jonathan Fine -

MathTran, at present, uses a variant of the plain TeX format, described in Don Knuth's The TeXbook.  For roots it uses the notation

   \root 3 \of {1 + x^2}

for example.  Here's another example: 

    \displaystyle\root 4 \of {\frac{1+x}{1-x}}

It would be great to have an on-line guide, and I think most users would like to have LaTeX notation available.  Both of these would require some work.

Finally, thank you for your interest in MathTran.

In reply to Tim Hunt

Re: An alternative to the TeX Notation filter

by Cristina Berisso -

MathTran is a wonderful tool that was announced in this forum and that I have been using extensively since then to develop math pages for my courses. I understand that since the project is concluded, the server will be unplugged around August 2008. It would be really sad sad to lose this great tool that simplifies so much the work of developers of math/science content.

Does anyone know who to contact to find out if Moodle could host the MathTran script and all necessary files, so the developers that have been using it could still have it available? Jonathan Fine thought that the hosting by Moodle would be a good way of solving this unfortunate situation. The server needs to be a Linux machine. It would be great also to have several servers around the world that could host MathTran, so as to have always some other copies in case a particular server is temporarily down.

Any ideas on who to contact? Any other institution who would offer to host it?Any Linux server administrators willing to help?

Thanks in advance for any suggestion and/or names.

Cristina

In reply to Cristina Berisso

Re: An alternative to the TeX Notation filter

by Jonathan Fine -
Thank you, Cristina, for praising MathTran. We don't yet know that the MathTran server will be unplugged in August 2008, it's just that the present funding that pays for it runs out then. At the UK TeX Users Group AGM there was interest in providing funding for MathTran, for example.

At present http://www.mathtran.org is serving about 30,000 images a day, and a large proportion of them are going to Moodle sites.

I'd be delighted if Moodle were able to offer MathTran (and similar web services) to Moodle users, and would be willing to help you set this up.

At present there's only one MathTran server out there on the web, and last week it was unavailable due to a network problem. This is what prompted Christina's message.