1 May 08:11 2006

### Re: Splitting strings into blocks

Danny Yoo <dyoo <at> hkn.eecs.berkeley.edu>

2006-05-01 06:11:03 GMT

2006-05-01 06:11:03 GMT

On Sun, 30 Apr 2006, Daniel Watkins wrote: > I'm currently working on a program to parse LaTeX style maths > expressions and provide an answer. For example, I have the expression > "2^\frac{1}{2}". I'm trying to work out a way to split this into it's > most basic blocks of LaTeX (i.e. 2^ and \frac{1}{2}) while maintaining a > record of the depth of the expression (i.e. (2^,0),(\frac{1}{2},1)). Hi Daniel, Forgive me for going off a side tangent here, but do we have to work directly on LaTeX? I don't mean this to be a silly question! What kind of problem are we trying to solve? It sounds like we're trying to evaluate LaTeX equations, so that presents the problem of parsing LaTeX. Diagrammically: LaTeX source ---- parsing --> evaluated expressions We could talk about parsing LaTeX. But could we have equations written in something easier to parse, and generate LaTeX out of that? That is: some easy-to-parse equations | +-- simple parser --> LaTeX writer ---> LaTeX source | +-- simple parser --> evaluator --> evaluated expressions(Continue reading)