mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-21 17:51:03 +00:00
tex2lyx: support for beamer text styles with overlays
E.g. things like \textbf<article>{foo} have to be imported as insets.
Part of #11068
(cherry picked from commit c74e399981
)
This commit is contained in:
parent
7c816488b6
commit
42863eac92
@ -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;
|
||||
}
|
||||
|
@ -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<bool, std::string> Arg;
|
||||
/*!
|
||||
|
@ -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<overlay>{} 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<overlay>{} 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<overlay>{} 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);
|
||||
|
Loading…
Reference in New Issue
Block a user