Asger Kunuk Alstrup wrote:

> Just a clarifying question: How well do we handle a round-trip of the
> User guide now? I.e. open the user guide, export to LaTeX, then use
> your patched version of tex2lyx to import the LaTeX. Then export again,
> and compare to the original export. Diff is your friend - especially
> ignoring white space.

The roundtrip works quite well.
The main problems are:

- Each loop adds stuff to the preamble
- Something is wrong with nesting lists, see \subsubsection{Example \#1: The
Six-fold Way and Mixed Nesting}. I don't understand how the nesting stuff
should work, and I have only simple nested lists in my document, so I won't
do anything on that.
- The problem Andre mentioned with commands taking an optional argument.
- Unmatched begin_layout / end_layout pairs inside a table

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.


Georg

Reply via email to