[Blindmath] to read laTex

Andrew Stacey andrew.stacey at math.ntnu.no
Mon Nov 28 19:17:42 UTC 2011


On Mon, Nov 28, 2011 at 05:27:53PM +0000, Michael Whapples wrote:
> I possibly would say that it would be wrong for MathType to simplify the
> equations more. My reasoning is that the LaTeX mode of MathType is also for
> input and removing some of those braces could actually lead to a different
> visual appearance of the equation.
> 
> Its this reason of what happens when the equation is recompiled that I say
> LaTeX is really a good authoring system but not a reading system IE. what
> gives good output visually when compiled is not necessarily good for reading
> and vice versa.

As an example, the code "x {=} y" and "x = y" display differently when
compiled to PDF but I would imagine that for reading the mathematics then the
difference is pretty minimal.

(Quoted originally from Ben)

> > I have in fact written such a Perl script to do this for Mathtype to Latex
> > conversions produced by my own Math professor.  But the pattern matching
> > gets pretty difficult when extraneous curly braces are inserted here and
> > there.  One almost needs a gramatical parser to simplify the expressions
> > and THEN do a translation.

I've written a few scripts and the like for manipulating TeX documents.  My
first ones were largely pattern based but I eventually realised that this
didn't work and I ended up writing an implementation of TeX's "mouth" and
"stomach" in Perl.  Even that wasn't great, so I took literally the statement
that "the only thing that understands TeX is tex itself" and wrote a class
that converts a LaTeX document to some other format.  As it works in tex
itself then it can understand true LaTeX syntax, including all those
horrendous braces.  I've not mentioned it before on this list because I don't
know what output format would be appropriate for the readers here, and it is
very much in alpha/beta (though I use it for writing all my documents that end
up on webpages now so it's definitely usable).  I only mention it now because
of the above about Perl scripts and so I want to save anyone the pain I went
through on that route!  Anyone interested or intrigued is welcome to contact
me off-list.

Andrew




More information about the BlindMath mailing list