mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
tex2lyx: extend titling support
Rather than checking for hardcoded title commands such as \maketitle,
use the titlename and titletype as defined in the layout.
This now also includes title environments.
Fixes part of #6461
(cherry picked from commit 429edc0a59
)
This commit is contained in:
parent
00f344effa
commit
c41f9f7ed7
@ -1793,6 +1793,16 @@ void parse_environment(Parser & p, ostream & os, bool outer,
|
||||
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}
|
||||
// It is impossible to decide if a CJK environment was in its own paragraph or within
|
||||
@ -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);
|
||||
|
@ -25,6 +25,8 @@ What's new
|
||||
|
||||
* TEX2LYX IMPROVEMENTS
|
||||
|
||||
- Improve import of titling commands other than \maketitle (bug 6461).
|
||||
|
||||
|
||||
|
||||
* USER INTERFACE
|
||||
|
Loading…
Reference in New Issue
Block a user