>>>>> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:
Andre> Interesting. But a bit too large for my taste ;-)
Andre> I have a prototype of a tex2lyx converter under
[...]
Andre> that uses TeX itself for the conversion. It currently does not
Andre> do tables and paragraph nesting is broken, but the rest looks
Andre> ok.
A converter that uses TeX for conversion is of course much fun :) A
few remarks:
* to output a character verbatim, you can use \string (like
\string\layout, where the \ is output as is)
* you can probably get a line feed with ^^J
[for example, something like
\def\layout#1{\string\layout #1^^J^^J}
should work, although I did not test it]
* currently, the name<->layout conversion is hardcoded, and this is no
good. What you should do (like reLyX does) is to parse the textclass
file and discover which layout goes with which command/environment
(Itemize, Section, or whatever).
* what happens with unknown macros? If you get an error, it is not
very good...
Andre> The perl part could easily be replaced by C++ (and probably is
Andre> not needed at all once a TeX guru has a look at it).
Maybe part of it can go away, indeed.
Andre> I actually did not want to tell anybody about it until it was
Andre> finished and someone found the LyXText bug, but before you
Andre> start serious work in this direction I thought I should tell
Andre> you to prevent double work.
Altough this is great fun, I am not sure how robust we can make it...
We need at least to have a way to pass through unknown macros as ERT.
This may require a lot of TeX wizardry that I do not have...
JMarc