X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferParams.cpp;h=6d519f27f8c41674c21b91f0c7cec03b53d89393;hb=08aef452e7d3d5901e42b5e6a38ecaf18cd38529;hp=a92c4c596125a1be4e40021d0959260123ab5a90;hpb=7e121117bb320368a9164d3a39432a4b54789538;p=lyx.git diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index a92c4c5961..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")) @@ -2251,8 +2251,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, // called after babel, though. if (use_babel && !features.isRequired("jurabib") && !features.isRequired("hyperref") - && !features.isRequired("varioref") - && !features.isRequired("vietnamese") + && !features.isRequired("varioref") && !features.isRequired("japanese")) { os << features.getBabelPresettings(); // FIXME UNICODE @@ -2265,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 = @@ -2287,7 +2286,8 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, // (the rest is obsoleted by the new TU encoding). // It needs to be loaded at least after amsmath, amssymb, // esint and the other packages that provide special glyphs - if (features.mustProvide("tipa") && useNonTeXFonts) { + if (features.mustProvide("tipa") && useNonTeXFonts + && !features.isProvided("xunicode")) { // The package officially only supports XeTeX, but also works // with LuaTeX. Thus we work around its XeTeX test. if (features.runparams().flavor != OutputParams::XETEX) { @@ -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"; @@ -2622,8 +2626,16 @@ vector BufferParams::backends() const v.push_back("luatex"); v.push_back("dviluatex"); } - } else - v.push_back(buffmt); + } else { + string rbuffmt = buffmt; + // If we use an OutputFormat in Japanese docs, + // we need special format in order to get the path + // via pLaTeX (#8823) + if (documentClass().hasOutputFormat() + && encoding().package() == Encoding::japanese) + rbuffmt += "-ja"; + v.push_back(rbuffmt); + } v.push_back("xhtml"); v.push_back("text"); @@ -2688,14 +2700,15 @@ string BufferParams::getDefaultOutputFormat() const if (!default_output_format.empty() && default_output_format != "default") return default_output_format; - if (isDocBook() - || encoding().package() == Encoding::japanese) { + if (isDocBook()) { FormatList const & formats = exportableFormats(true); if (formats.empty()) return string(); // return the first we find return formats.front()->name(); } + if (encoding().package() == Encoding::japanese) + return lyxrc.default_platex_view_format; if (useNonTeXFonts) return lyxrc.default_otf_view_format; return lyxrc.default_view_format; @@ -3413,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())