commit 73f2b01678fa7936738165e25315e8d1f4529acd
Author: Uwe Stöhr <[email protected]>
Date:   Fri Nov 7 03:29:53 2014 +0100

    tex2lyx: support for bibtopic
    
    can also go to branch

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 0de0700..145b17b 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 46429c9..afd7ce4 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 c0c71d2..009b8b4 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, 
"");

Reply via email to