diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index 2dea2448c9..7136f2eeb2 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -285,7 +285,7 @@ or by a defined page break \pagebreak[4] Then one has those macros with a long name for a short meaning, like \textasciitilde, \textasciicircum{} or \textbackslash{}, \slash{}, -\nobreakdash and the characters +\nobreakdash- and the characters that LaTeX wants to espace because they are active, like \_\&\#\$\{\}\%. And what about special characters like hyphe\-nation mark, diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 3e25ef53e1..d901e18150 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -2462,9 +2462,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, skip_spaces_braces(p); } - else if (t.cs() == "nobreakdash") { + else if (t.cs() == "nobreakdash" && p.next_token().asInput() == "-") { context.check_layout(os); - os << "\\SpecialChar \\nobreakdash\n"; + os << "\\SpecialChar \\nobreakdash-\n"; + p.get_token(); } else if (t.cs() == "textquotedbl") {