From 73f2b01678fa7936738165e25315e8d1f4529acd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Fri, 7 Nov 2014 03:29:53 +0100 Subject: [PATCH] tex2lyx: support for bibtopic can also go to branch --- src/tex2lyx/Preamble.cpp | 3 +++ src/tex2lyx/TODO.txt | 1 - src/tex2lyx/text.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 0de0700ae2..145b17b2c8 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -966,6 +966,9 @@ void Preamble::handle_package(Parser &p, string const & name, h_cite_engine_type = "authoryear"; } + else if (name == "bibtopic") + h_use_bibtopic = "true"; + else if (name == "hyperref") handle_hyperref(options); diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 46429c987b..afd7ce414b 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -18,7 +18,6 @@ Format LaTeX feature LyX feature 226 nothing (impossible to import) InsetBranch, \branch...\end_branch 226 transformations InsetExternal 228 draft InsetExternal -232 bibtopic InsetBibTeX 254 esint.sty \use_esint 267 XeTeX utf8 encoding 270 \alert, \structure (beamer) layout diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index c0c71d2de3..009b8b490f 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1525,6 +1525,37 @@ void parse_environment(Parser & p, ostream & os, bool outer, preamble.registerAutomaticallyLoadedPackage("color"); } + else if (name == "btSect") { + eat_whitespace(p, os, parent_context, false); + parent_context.check_layout(os); + begin_command_inset(os, "bibtex", "bibtex"); + string bibstyle = "plain"; + if (p.hasOpt()) { + bibstyle = p.getArg('[', ']'); + p.skip_spaces(true); + } + string const bibfile = p.getArg('{', '}'); + eat_whitespace(p, os, parent_context, false); + Token t = p.get_token(); + if (t.asInput() == "\\btPrintCited") { + p.skip_spaces(true); + os << "btprint " << '"' << "btPrintCited" << '"' << "\n"; + } + if (t.asInput() == "\\btPrintNotCited") { + p.skip_spaces(true); + os << "btprint " << '"' << "btPrintNotCited" << '"' << "\n"; + } + if (t.asInput() == "\\btPrintAll") { + p.skip_spaces(true); + os << "btprint " << '"' << "btPrintAll" << '"' << "\n"; + } + os << "bibfiles " << '"' << bibfile << '"' << "\n"; + os << "options " << '"' << bibstyle << '"' << "\n"; + parse_text_in_inset(p, os, FLAG_END, outer, parent_context); + end_inset(os); + p.skip_spaces(); + } + 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.2