Hello, Jean-Marc On Thu, 4 Sep 2003, Jean-Marc Lasgouttes wrote:
> >>>>> "Joao" == Joao Luis Meloni Assirati <[EMAIL PROTECTED]> writes: > > Joao> Therefore, I suggest that when '\command{blah blah}' is unknown > Joao> to tex2lyx, it be translated as a single ERT. Maybe to add a > Joao> command line switch like "--try-hard-on-ert", with the warning > Joao> that the resulting lyx file will be unreliable. > > And how many parameters do you consider? Do you do the same for > \command*{blah blah}? And what about \command[bar]{foo}? This would not be hard to solve if the brackets [ ] mean only syntax delimiters. Then \command[bar]{foo} could be put inside a single ERT, no matter \command takes arguments or not. The problem is that [ and ] can be also text, and with my naive proposal tex2lyx would crash with '\command[foo' (no closing ]) when \command takes no argument. Latex syntax can be annoying... > It is very difficult to do sensible things when one does not know > syntax. In this respect, reLyX uses a syntax table which allows it to > read more correctly commands even when they will eventually become > ERT. Implementing this in tex2lyx is not trivial. I see. Instead of a syntax table, tex2lyx could read \defs, \lets, \newcommands and \renewcommands from the sty files called in the tex file being imported. Just dreamning... > JMarc Joćo.