# [Wikipedia-l] Parsing TeX

Toby Bartels toby+wikipedia-l at math.ucr.edu
Fri Aug 9 14:31:54 UTC 2002

Jan Hidders wrote:

>Note that I was talking about math *expressions* and not about simple
>variable names! For simple variable names the required knowledge of LaTeX is
>going to be near zero.

And are they going to know that if we tell them that $$invokes LaTeX? They'll know if we tell them to put$$ around variable names.

>I would even argue that always using the TeX markup
>makes things simpler there. An example in your notation:

>  .. let $$v<sub>1</sub>$$, ..., $$v<sub>n</sub>$$ be a finite list ..

There are many versions of "my notation" around, but this is none of them.

.. let <var>v</var><sub>1</sub>, ..., <var>v</var><sub><var>n</var></sub> be a finite list ..

This is what I write now, and the HTML that we should produce.

.. let $$v$$<sub>1</sub>, ..., $$v$$<sub>$$n$$</sub> be a finite list ..

This is where $$parses as <var>. .. let$$v$$_{1}, ...,$$v$$_{$$n$$} be a finite list .. This is with a wiki notation for subscripts too. .. let [[math:v_1, \ldots, v_n]] be a finite list .. This calls LaTeX to create a PNG stored in a [[math:]] namespace. >and in mine: > .. let [v_1], ..., [v_n] be a finite list .. Other than the suboptimal TeX (which may be preferable in our context, since we want to allow for line breaks from time to time), this is like the [[math:]] namespace, as you know. The question is, how do we tell people to write like that? We can't say "Put [ and ] around math expressions.", because it isn't that simple, and things won't come out right. We can't say "Put [ and ] around a math expression to call LaTeX.", because it isn't that difficult, and people won't want to try it. Do you want to write up all of the LaTeX that we use? >Note that all that I'm arguing here is that we have one markup for math and >not two (one for <var> and one for LaTeX). I'd rather have two markups for math than one that won't get used. I think that we have a long way to go before getting a good LaTeX system. But we can implement <var> support (and <sub> and <sup> support) much sooner. ---- OK, new suggestion. There really are two different kinds of math expression, one kind mosly used for short things, one kind mostly for complicated stuff. These are inline equations (TeX ) and displayed equations (TeX$$).
One possibility is to use wiki markup for <var> and the like inline
and [[math:]] calling LaTeX for displayed equations.
We wouldn't be able to write $\int_a^b f(x)\,dx$ inline,
but I don't think that that's much of a problem.

I haven't thought this one through all the way.

-- Toby Bartels
<toby+wikipedia-l at math.ucr.edu>