commit e76fc730406ec4d70949427bc7c4c5b146f72e98
Author: Georg Baum <b...@lyx.org>
Date:   Fri Feb 27 22:06:11 2015 +0100

    Fix \nobreakdash- roundtrip in moving args
    
    Previously, tex2lyx did not remove the \protect which is output by LyX in
    front of \nobreakdash- if needed. Now tex2lyx removes it unconditionally 
(like
    it does elsewhere), because LyX will add it if needed.

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index ce0443b..869fac9 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -3818,7 +3818,12 @@ void parse_text(Parser & p, ostream & os, unsigned 
flags, bool outer,
                }
 
                else if ((t.cs() == "nobreakdash" && p.next_token().asInput() 
== "-") ||
+                        (t.cs() == "protect" && p.next_token().asInput() == 
"\\nobreakdash" &&
+                         p.next_next_token().asInput() == "-") ||
                         (t.cs() == "@" && p.next_token().asInput() == ".")) {
+                       // LyX sometimes puts a \protect in front, so we have 
to ignore it
+                       if (t.cs() == "protect")
+                               p.get_token();
                        context.check_layout(os);
                        os << "\\SpecialChar \\" << t.cs()
                           << p.get_token().asInput() << '\n';

Reply via email to