Georg Baum wrote: > - Each loop adds stuff to the preamble Yes. The preamble stuff has no intelligence at all. It just dumps output.
> I have more trouble with non lyx-generated documents. The main > problem is the fact that Parser::tokenize() unconditionally removes > all whitespace after a command. parse_text() then adds > unconditionally whitespace at some places. This makes it impossible > to parse verbatim environments. Another problem is that there are > commands where whitespace matters, for example after a \hspace{}. > I started to implement a strategy where Parser::tokenize() does not > remove any whitespace. This is instead shifted to parse_text(), > where it is only removed if it is needed. This adds some lines to > text.C. It is not finished yet, but works already better than the > original version. > > Comments? If nobody has objections, I'll finish this. André has noted in the past that the current implementation is a hack that 'worked well enough for him'. I think that you should keep going with the 'clean' solution that you describe. Regards, Angus