mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
tex2lyx: Fixes to the btUnit import
1. Do not attempt to mix diverging btUnits (e.g., chapters and sections). 2. use parse_text to properly parse the contents.
This commit is contained in:
parent
5c97424a72
commit
68d48b0015
@ -82,6 +82,8 @@ public:
|
|||||||
///
|
///
|
||||||
void citeEngine(std::string const & e) { h_cite_engine = e; }
|
void citeEngine(std::string const & e) { h_cite_engine = e; }
|
||||||
///
|
///
|
||||||
|
std::string multibib() const { return h_multibib; }
|
||||||
|
///
|
||||||
void multibib(std::string const & s) { h_multibib = s; }
|
void multibib(std::string const & s) { h_multibib = s; }
|
||||||
///
|
///
|
||||||
bool titleLayoutFound() const { return title_layout_found; }
|
bool titleLayoutFound() const { return title_layout_found; }
|
||||||
|
@ -1925,9 +1925,12 @@ void parse_environment(Parser & p, ostream & os, bool outer,
|
|||||||
|
|
||||||
else if (name == "btUnit") {
|
else if (name == "btUnit") {
|
||||||
string const nt = p.next_next_token().cs();
|
string const nt = p.next_next_token().cs();
|
||||||
if (nt == "part" || nt == "chapter"
|
// Do not attempt to overwrite a former diverging multibib.
|
||||||
|| nt == "section" || nt == "subsection") {
|
// Those are output as ERT instead.
|
||||||
active_environments.push_back("btUnit");
|
if ((nt == "part" || nt == "chapter"
|
||||||
|
|| nt == "section" || nt == "subsection")
|
||||||
|
&& (preamble.multibib().empty() || preamble.multibib() == nt)) {
|
||||||
|
parse_text(p, os, FLAG_END, outer, parent_context);
|
||||||
preamble.multibib(nt);
|
preamble.multibib(nt);
|
||||||
} else
|
} else
|
||||||
parse_unknown_environment(p, name, os, FLAG_END, outer,
|
parse_unknown_environment(p, name, os, FLAG_END, outer,
|
||||||
|
Loading…
Reference in New Issue
Block a user