On Wed, 19 Feb 2003 10:59:34 +0000
Angus Leeming <[EMAIL PROTECTED]> wrote:

> Hello Karsten.

Hello,
 
> reLyX may "someday soon" be retired in favour of tex2lyx, Andr�'s new 
> baby. It is still very new indeed but has the advantage of using a 
> proper TeX parser rather than regex magic acting as a psuedo tex 
> parser. I see that you know perl and python rather than c++ (tex2lyx 
> is written in c++) but would strongly suggest that you at least have 
> a look at tex2lyx. It is unbelievably simple in comparison to reLyX.

I had to write a parser (for a simple raytracer language) in java (with
help of jlex+cup) some time ago, so maybe I understand a bit.

> In the meantime, reLyX is what we have and we would indeed like to 
> get it to support more of the subset of LaTeX known to LyX.
> 
> > 1. what LaTeX code can be used so that reLyX produces the 'quote
> > glq/grq'   insets? wvWare produces \quotedblbase{} and ''. '' is
> > mapped to 'quote elq' insets which is quite ok, but
> > ERT:\quotedblbase{} looks very ugly (and it's quite common in german
> > texts). I've tried \glqq as well, but (as far as I can read the
> > reLyX code), there's no way to reach 'quote glq/grq'. Am I right? 
> > (and while i'm at that topic: why does LyX use ",," and "''" to
> > export  'quote glq/grq'? "\glqq" resp."\grqq" would seem the right
> > thing to  me.)
> 
> reLyX has a file 'syntax.default' that tells it what to expect with 
> different macros. For example \cite[]{} tells reLyX to expect one 
> optional and one mandatory argument with a \cite macro. I see that 
> syntax.default has
>         \quotedblbase
> already. I also see that
>         $ grep quotedblbase BasicLyX.pm
> so nobody has actually told reLyX now to go from the LaTeX to the LyX.
> 
> You'll find (in BasicLyX.pm) that the conversion of LaTeX to LyX is 
> handled by 'sub basic_lyx' which is basically just a big switch of 
> LaTeX commands. Feel free to shout for help ;-)

That's a helpfull reply. I'll have a deeper look at it soon.
 
> > 2. Should reLyX ignore 1-cell-multicolumns? wvCleanLatex makes every
> > cell of a tabular (I've patched it to produce tabular instead of
> > longtable - maybe I did something wrong during that) a multicolumn
> > which makes editing annoying (esp. adding frames). Most probably a
> > wvWare bug, but could reLyX handle it?
> 
> You mean should reLyX turn valid LaTeX into different valid LaTeX 
> before creating a LyX tabular? No.

It seems I'll have to write an additional sanityzer CleanLatex2reLyXLatex to cope with 
that.

> > 3. reLyX improperly parses $a$$b$
> As Andr� has said: known bug. Probably impossible to squash with the 
> TeX.pm TeX parser.

That's a big point for tex2lyx. It took me a day propably to find that out.

> > 4. reLyX doesn't handle \newpage. Almost never needed in LyX, but
> > maybe reLyX could make a LyX-Pagebreak from that.
> 
> Add something to the basic_lyx switch.
>         elsif ($name eq '\newpage') {
>                 ...
>         }

I'll try it out.

> I see that \newpage _is_ handled within tabulars.

Why on earth should that happen?? I don't understand it...

> > That's all regarding reLyX (so far). There's certainly a lot more
> > but I'll wait until I'm subscribed :)
> 
> I look forward to it.

Ok, here I am :). I'll wait with further bugreports until I had the time to look into 
tex2lyx. I guess it's time to learn c++ (yet another language...)
 
> > I'd be happy to help out with solving these problems (I know a bit
> > perl, quite a bit python but unfortunately nearly no c++) but would
> > need some pointers how help would be helpfull.
> 
> I think that teaching reLyX how to LyX-ify certain LaTeX tokens is 
> pretty easy. Squashing real bugs in the TeX tokeniser is pretty hard. 
> If you would like to learn a little c++ have a look at the "muxh, muc 
> cleaner" tex2lyx code. 

I think I'll try to fix the obvious stuff within reLyX and write a litte script to 
handle the stuff reLyX can't.

So far now,

Karsten

Reply via email to