Kayvan said: > Doing some searches on the net, I found a very interesting piece of > software at http://www.nist.gov/sc4/editing/latex/programs/ltx2x/ > > I am thinking of using it as the basis for a C-based reLyX replacement. > > Amir, can you take a look and tell me what you think? Wow. It's pretty impressive. Did you notice btw that it's on CTAN (tex-archive/support/ltx2x/) and that it's now version 0.92? My first reaction was of course "how dare you try to replace reLyX?!" Then I realized that I was just thinking that because I put so much effort into it. Considering that LyX 1.0 was initially supposed to make reLyX obsolete, I can't really complain if a better latex converter comes along. Advantages: (1) It's in C, so people don't need to have Perl and I would think it could even be included in the LyX code. (I assume you could distribute the C rather than the lex etc. files. Otherwise, file this in disadvantages.) (2) It's under the LLPL, which I assume doesn't hurt the GPL? (If it does, file this under disadvantages.) (3) It can handle a whole lot of stuff. And I suspect that a lot more work went into it than into the v0.01 Text::TeX module that's at the heart of reLyX. (I may have put a lot of work into reLyX, but I only tinkered with Text::TeX.) That said, there are (at least) a couple problems with using it. (1) One reason people didn't want to help work on reLyX was that they didn't know Perl. How many people do you think will know lex, yacc, express-a, and the ltx2x command table language? (2) If you look at the ltx2x limitations, you'll see that e.g. it can't handle x^2 (it requires you to write x^{2}) or {\em foo} (it requires \emph{foo}). Those are, of course, two of the more popular LaTeX functions (although hopefully people will stop using \em eventually, I wouldn't hold my breath). That means that --- unless ltx2x overcomes these limitations at some point --- you'll still need to use CleanTeX.pl, but that means distributing reLyX AND something else! (3) ltx2x has the same problem of not handling optional arguments correctly that reLyX has, although it may be to a lesser extent. (4) It seems like ltx2x may have some issues with \newcommands, though probably not to the same extent that reLyX does. (5) related to #2-4, I don't know how active development on ltx2x is. OTOH, it may be powerful enough currently to handle just about everything you want to. (6) If you decide to do this, you'll be starting almost from scratch --- you'll be able to use some of the reLyX output ideas, and the syntax.defaults file e.g. says how many arguments each command takes. But nonetheless you're going to have to write code-handling for every single command. Which, trust me, is a lot of work. In addition, you are guaranteed to run into situations where the way that ltx2x looks at things isn't the way that LyX does, which will require kludging. I hope I wasn't *too* biased. But to return to my knee-jerk reaction for just a moment: why exactly do you want to replace reLyX rather than fix it? -Amir