diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index 6e29623b96..1d506a78a8 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -453,7 +453,7 @@ bool Parser::good() } -bool Parser::hasOpt() +bool Parser::hasOpt(string const l) { // An optional argument can occur in any of the following forms: // - \foo[bar] @@ -479,7 +479,7 @@ bool Parser::hasOpt() putback(); break; } - bool const retval = (next_token().asInput() == "["); + bool const retval = (next_token().asInput() == l); pos_ = oldpos; return retval; } diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index 08d07c1af1..83fa1c745a 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -214,7 +214,7 @@ public: void dump() const; /// Does an optional argument follow after the current token? - bool hasOpt(); + bool hasOpt(std::string const l = "["); /// typedef std::pair Arg; /*! diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index ac2bed1512..f3617a8e97 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3627,14 +3627,16 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, continue; } - if ((where = is_known(t.cs(), known_text_font_series))) { + // beamer has a \textbf{} inset + if (!p.hasOpt("<") && (where = is_known(t.cs(), known_text_font_series))) { parse_text_attributes(p, os, FLAG_ITEM, outer, context, "\\series", context.font.series, known_coded_font_series[where - known_text_font_series]); continue; } - if ((where = is_known(t.cs(), known_text_font_shapes))) { + // beamer has a \textit{} inset + if (!p.hasOpt("<") && (where = is_known(t.cs(), known_text_font_shapes))) { parse_text_attributes(p, os, FLAG_ITEM, outer, context, "\\shape", context.font.shape, known_coded_font_shapes[where - known_text_font_shapes]); @@ -3713,9 +3715,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, continue; } - if (t.cs() == "uuline" || t.cs() == "uwave" + // beamer has an \emph{} inset + if ((t.cs() == "uuline" || t.cs() == "uwave" || t.cs() == "emph" || t.cs() == "noun" - || t.cs() == "xout") { + || t.cs() == "xout") && !p.hasOpt("<")) { context.check_layout(os); os << "\n\\" << t.cs() << " on\n"; parse_text_snippet(p, os, FLAG_ITEM, outer, context);