X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=1e809380179ac19c81036f8074bf4a7296e62f2a;hb=1797f5218b8819874f9dbe97b44445b3b5d598a0;hp=4b47083660359ab38ce85ebee0c489465a26ed3f;hpb=ba496b94acc56d41595d266bfdc4cce669006e4b;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 4b47083660..1e80938017 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -36,6 +36,7 @@ using namespace std; using namespace lyx::support; + namespace lyx { ///////////////////////////////////////////////////////////////////// @@ -236,7 +237,7 @@ void LaTeXFeatures::require(set const & names) void LaTeXFeatures::getAvailable() { - Lexer lex(0, 0); + Lexer lex; support::FileName const real_file = libFileSearch("", "packages.lst"); if (real_file.empty()) @@ -449,7 +450,8 @@ char const * simplefeatures[] = { "ifthen", "amsthm", "listings", - "bm" + "bm", + "pdfpages" }; int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *); @@ -489,6 +491,9 @@ string const LaTeXFeatures::getPackages() const (mustProvide("esintoramsmath") && params_.use_esint == BufferParams::package_off)) { packages << "\\usepackage{amsmath}\n"; + } else if (mustProvide("amsbsy")) { + // amsbsy is already provided by amsmath + packages << "\\usepackage{amsbsy}\n"; } // wasysym is a simple feature, but it must be after amsmath if both @@ -516,9 +521,8 @@ string const LaTeXFeatures::getPackages() const } // pdfcolmk must be loaded after color - if (mustProvide("pdfcolmk")) { + if (mustProvide("pdfcolmk")) packages << "\\usepackage{pdfcolmk}\n"; - } // makeidx.sty if (isRequired("makeidx")) { @@ -552,13 +556,12 @@ string const LaTeXFeatures::getPackages() const } // lyxskak.sty --- newer chess support based on skak.sty - if (mustProvide("chess")) { + if (mustProvide("chess")) packages << "\\usepackage[ps,mover]{lyxskak}\n"; - } // setspace.sty if (mustProvide("setspace") && !tclass.provides("SetSpace")) - packages << "\\usepackage{setspace}\n"; + packages << "\\usepackage{setspace}\n"; // amssymb.sty if (mustProvide("amssymb") @@ -574,29 +577,25 @@ string const LaTeXFeatures::getPackages() const // natbib.sty if (mustProvide("natbib")) { packages << "\\usepackage["; - if (params_.getEngine() == biblio::ENGINE_NATBIB_NUMERICAL) { + if (params_.citeEngine() == ENGINE_NATBIB_NUMERICAL) packages << "numbers"; - } else { + else packages << "authoryear"; - } packages << "]{natbib}\n"; } // jurabib -- we need version 0.6 at least. - if (mustProvide("jurabib")) { + if (mustProvide("jurabib")) packages << "\\usepackage{jurabib}[2004/01/25]\n"; - } // xargs -- we need version 1.09 at least - if (mustProvide("xargs")) { + if (mustProvide("xargs")) packages << "\\usepackage{xargs}[2008/03/08]\n"; - } // bibtopic -- the dot provides the aux file naming which // LyX can detect. - if (mustProvide("bibtopic")) { + if (mustProvide("bibtopic")) packages << "\\usepackage[dot]{bibtopic}\n"; - } if (mustProvide("xy")) packages << "\\usepackage[all]{xy}\n"; @@ -780,7 +779,8 @@ docstring const LaTeXFeatures::getIncludedFiles(string const & fname) const } -void LaTeXFeatures::showStruct() const { +void LaTeXFeatures::showStruct() const +{ lyxerr << "LyX needs the following commands when LaTeXing:" << "\n***** Packages:" << getPackages() << "\n***** Macros:" << getMacros()