From a99960cc0491a40b77c48816c9a7bd46d49ac742 Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Mon, 9 Jan 2012 13:16:41 +0000 Subject: [PATCH] Update tex2lyx to format 424. The type of citation engine is determined by the citation package being used and, in the case of natbib, its options. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40593 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/Preamble.cpp | 8 ++++++-- src/tex2lyx/Preamble.h | 1 + src/version.h | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 88e8954fda..21106b19b9 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -401,6 +401,7 @@ Preamble::Preamble() : one_language(true) //h_boxbgcolor; h_biblio_style = "plain"; h_cite_engine = "basic"; + h_cite_engine_type = "numerical"; h_defskip = "medskip"; //h_float_placement; //h_fontcolor; @@ -739,7 +740,8 @@ void Preamble::handle_package(Parser &p, string const & name, else if (name == "natbib") { h_biblio_style = "plainnat"; - h_cite_engine = "natbib_authoryear"; + h_cite_engine = "natbib"; + h_cite_engine_type = "authoryear"; vector::iterator it = find(options.begin(), options.end(), "authoryear"); if (it != options.end()) @@ -747,7 +749,7 @@ void Preamble::handle_package(Parser &p, string const & name, else { it = find(options.begin(), options.end(), "numbers"); if (it != options.end()) { - h_cite_engine = "natbib_numerical"; + h_cite_engine_type = "numerical"; options.erase(it); } } @@ -756,6 +758,7 @@ void Preamble::handle_package(Parser &p, string const & name, else if (name == "jurabib") { h_biblio_style = "jurabib"; h_cite_engine = "jurabib"; + h_cite_engine_type = "authoryear"; } else if (name == "hyperref") @@ -923,6 +926,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc) it != h_use_packages.end(); it++) os << "\\use_package " << it->first << ' ' << it->second << '\n'; os << "\\cite_engine " << h_cite_engine << '\n' + << "\\cite_engine_type " << h_cite_engine_type << '\n' << "\\biblio_style " << h_biblio_style << "\n" << "\\use_bibtopic " << h_use_bibtopic << "\n" << "\\use_indices " << h_use_indices << "\n" diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 209c5a951e..59f8f88a15 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -83,6 +83,7 @@ private: std::string h_biblio_style; std::string h_boxbgcolor; std::string h_cite_engine; + std::string h_cite_engine_type; std::string h_defskip; std::string h_float_placement; std::string h_fontcolor; diff --git a/src/version.h b/src/version.h index d7ac566e96..bb9812e17a 100644 --- a/src/version.h +++ b/src/version.h @@ -31,7 +31,7 @@ extern char const * const lyx_version_info; // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. #define LYX_FORMAT_LYX 424 // jrioux : \cite_engine_type (authoryear|numerical) -#define LYX_FORMAT_TEX2LYX 423 +#define LYX_FORMAT_TEX2LYX 424 // jrioux : \cite_engine_type (authoryear|numerical) #if LYX_FORMAT_FOR_TEX2LYX != LYX_FORMAT_FOR_LYX #warning "tex2lyx produces an out of date file format." -- 2.39.2