Andre Poenitz wrote:
Since I started to waste the evening with TeX, the final version:

   \def\plus{+}
   \def\gobble#1{}
   \catcode`\+=\active

   \def\checknextchar{%
     \ifx\nextchar+%
           \raisebox{0.6ex}{\tiny\plus\kern-.3ex\plus}%
           \let\next\gobble%
     \else%
           \plus%
           \let\next\relax%
     \fi%
     \next%
   }

   \def+{\futurelet\nextchar\checknextchar}

It starts getting readable, so I better stop now.

That's actually quite elegant, in fact. Well done!

Incidentally, I stumbled across htlatex and start to wonder whether this would be a good start for tex2lyx. It is able to process the
macros above...

Yes, I'd considered that, too. It obviously has a decent TeX parser in there. That said, have you look at plastex? It's python, but it also seems to have a good parser, and it gives you a DOM-like structure that can be manipulated all kinds of ways.

rh

Reply via email to