>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:
Georg> This patch fixes bug 2786: tex2lyx does not know any of the
Georg> spaces supported by InsetSpace except ~. The attached LyX file
Georg> shows that the roundtrip LyX-> LaTeX->LyX->LaTeX is perfect.
I do not think we should skip braces and spaces depending on what LyX
outputs.
+ // LyX adds {} after the space, so we have to eat
+ // spaces here if there are any before a possible
+ // {} pair, but not after \\, (whitespace after \\,
+ // is not swallowed by LaTeX).
+ if (t.cs() != ",")
+ eat_whitespace(p, os, context, false);
This should be generic and depend only on the name of the macro, right?
+ // LyX does not add {} after "\\ " and "\\,"
+ if (t.cs() != " " && t.cs() != ",")
+ skip_braces(p);
+ }
Would it hurt to skip braces after \, and "\ "?
In general, should we use what we know about macros (in
syntax.defaults) to eat all the {} that are after \foo macros? Shall
this code be for space insets only, or more general?
Georg> This goes in tonight unless somebody objects. Jean-Marc, also
Georg> for 1.4.3?
This would be OK in 1.4.3 in any case (my objections above are for
code cleanup, so presumably 1.5).
JMarc