From fae43384684c7f2f6b20c677066d84800cee63c6 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 21 Aug 2018 17:18:04 +0200 Subject: [PATCH] tex2lyx: support for btUnit (multibib) (cherry picked from commit 0ae68ae828cd8d3589c7aa4bd2ef958aa38182b4) --- src/tex2lyx/Preamble.h | 2 ++ src/tex2lyx/TODO.txt | 5 ----- src/tex2lyx/text.cpp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 0d3ff0113f..5c8b17f128 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -82,6 +82,8 @@ public: /// void citeEngine(std::string const & e) { h_cite_engine = e; } /// + void multibib(std::string const & s) { h_multibib = s; } + /// bool titleLayoutFound() const { return title_layout_found; } /// void titleLayoutFound(bool found) { title_layout_found = found; } diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index fa2bd7aca7..a68cc375fa 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -36,11 +36,6 @@ Format LaTeX feature LyX feature 453 automatic stmaryrd loading \use_package stmaryrd 457 automatic stackrel loading \use_package stackrel 526 Plural and capitalized refstyles InsetRef -533 Multibib support - \begin{btUnit}...\end{btUnit} \multibib {none|part|chapter|section|subsection} - (if a part, chapter, section etc. - follows the \begin...) - diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 85e2462e3e..09a29ffd14 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1942,6 +1942,24 @@ void parse_environment(Parser & p, ostream & os, bool outer, p.skip_spaces(); } + else if (name == "btUnit") { + string const nt = p.next_next_token().cs(); + active_environments.push_back("btUnit"); + if (nt == "part") + preamble.multibib("part"); + else if (nt == "chapter") + preamble.multibib("chapter"); + else if (nt == "section") + preamble.multibib("section"); + else if (nt == "subsection") + preamble.multibib("subsection"); + else { + parse_unknown_environment(p, name, os, FLAG_END, outer, + parent_context); + active_environments.pop_back(); + } + } + else if (name == "framed" || name == "shaded") { eat_whitespace(p, os, parent_context, false); parse_outer_box(p, os, FLAG_END, outer, parent_context, name, ""); -- 2.39.5