X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferParams.cpp;h=6d519f27f8c41674c21b91f0c7cec03b53d89393;hb=08aef452e7d3d5901e42b5e6a38ecaf18cd38529;hp=2f7058a9e4403faf3cbcd0341381f6760ad69671;hpb=7309ae50b4c40bdbd5c4e45962f132ec0e1a4249;p=lyx.git diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 2f7058a9e4..6d519f27f8 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -394,7 +394,7 @@ BufferParams::BufferParams() papersize = PAPER_DEFAULT; orientation = ORIENTATION_PORTRAIT; use_geometry = false; - biblio_style = "plain"; + biblio_style = string(); use_bibtopic = false; multibib = string(); use_indices = false; @@ -2094,8 +2094,8 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, OutputParams tmp_params = features.runparams(); pdfoptions().writeLaTeX(tmp_params, os, features.isProvided("hyperref")); - // correctly break URLs with hyperref and dvi output - if (features.runparams().flavor == OutputParams::LATEX + // correctly break URLs with hyperref and dvi/ps output + if (features.runparams().hyperref_driver == "dvips" && features.isAvailable("breakurl")) os << "\\usepackage{breakurl}\n"; } else if (features.isRequired("nameref")) @@ -2264,16 +2264,16 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, if (!listings_params.empty() || features.mustProvide("listings") || features.mustProvide("minted")) { - if (features.mustProvide("listings")) - os << "\\usepackage{listings}\n"; - else + if (use_minted) os << "\\usepackage{minted}\n"; + else + os << "\\usepackage{listings}\n"; } if (!listings_params.empty()) { - if (features.mustProvide("listings")) - os << "\\lstset{"; - else + if (use_minted) os << "\\setminted{"; + else + os << "\\lstset{"; // do not test validity because listings_params is // supposed to be valid string par = @@ -2322,7 +2322,11 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, } // ... but before biblatex (see #7065) - if (features.mustProvide("biblatex")) { + if (features.mustProvide("biblatex") + && !features.isProvided("biblatex-natbib") + && !features.isProvided("natbib-internal") + && !features.isProvided("natbib") + && !features.isProvided("jurabib")) { string delim = ""; string opts; os << "\\usepackage"; @@ -3422,6 +3426,9 @@ bool BufferParams::addCiteEngine(vector const & engine) string const & BufferParams::defaultBiblioStyle() const { + if (!biblio_style.empty()) + return biblio_style; + map const & bs = documentClass().defaultBiblioStyle(); auto cit = bs.find(theCiteEnginesList.getTypeAsString(citeEngineType())); if (cit != bs.end())