From 0ae68ae828cd8d3589c7aa4bd2ef958aa38182b4 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) --- src/tex2lyx/Preamble.h | 2 ++ src/tex2lyx/TODO.txt | 16 ++++++---------- src/tex2lyx/text.cpp | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index ebc60c7d6d..725bf6740e 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 dfda94001c..b348b29e8e 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -36,16 +36,12 @@ Format LaTeX feature LyX feature 443 unicode-math.sty InsetMath* 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...) -546 Landscape support - \begin{landscape}...\end{landscape} \begin_inset Flex Landscape - with longtable content: -555 V column type (varwidth package) Automatically detected with newlines, paragraph breaks and environment content in cells of rows -563 InsetArgument listpreamble: All content between \begin{env} and first \item of a list +526 Plural and capitalized refstyles InsetRef +546 Landscape support + \begin{landscape}...\end{landscape} \begin_inset Flex Landscape (see #11259) + with longtable content: +555 V column type (varwidth package) Automatically detected with newlines, paragraph breaks and environment content in cells of rows +563 InsetArgument listpreamble: All content between \begin{env} and first \item of a list diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index d242731b79..1fbc87eaed 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1923,6 +1923,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, "");