diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index f4002b044a..f89e5a91ac 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1792,6 +1792,16 @@ void parse_environment(Parser & p, ostream & os, bool outer, preamble.registerAutomaticallyLoadedPackage("tipa"); preamble.registerAutomaticallyLoadedPackage("tipx"); } + + else if (name == parent_context.textclass.titlename() + && parent_context.textclass.titletype() == TITLE_ENVIRONMENT) { + parse_text(p, os, FLAG_END, outer, parent_context); + // Just in case the environment is empty + parent_context.extra_stuff.erase(); + // We must begin a new paragraph + parent_context.new_paragraph(os); + p.skip_spaces(); + } else if (name == "CJK") { // the scheme is \begin{CJK}{encoding}{mapping}text\end{CJK} @@ -3626,7 +3636,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, continue; } - else if (t.cs() == "makeindex" || t.cs() == "maketitle" || t.cs() == "makebeamertitle") { + else if (t.cs() == "makeindex" + || (t.cs() == context.textclass.titlename() + && context.textclass.titletype() == TITLE_COMMAND_AFTER)) { if (preamble.titleLayoutFound()) { // swallow this skip_spaces_braces(p); diff --git a/status.23x b/status.23x index 9d44843e00..8ad20bc562 100644 --- a/status.23x +++ b/status.23x @@ -25,6 +25,8 @@ What's new * TEX2LYX IMPROVEMENTS +- Improve import of titling commands other than \maketitle (bug 6461). + * USER INTERFACE