From 71737b87f9c3729ba6d0969b032448073948a673 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 18 Feb 2019 13:14:53 +0100 Subject: [PATCH] Basic support for biblatex-chicago This uses a specific wrapper package that must be loaded instead of biblatex. Via "Requires biblatex-chicago", this is now possible. For proper support, a citeengine file needs to be written This commit here could also be backported to stable. --- lib/chkconfig.ltx | 1 + src/BufferParams.cpp | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 4b78d88545..d8b027f001 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -285,6 +285,7 @@ \TestPackage{babel} \TestPackage{beamerposter} \TestPackage{biblatex} +\TestPackage{biblatex-chicago} \TestPackage{bibtopic} \TestPackage{bicaption} \TestPackage{bidi} diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index d57f68c0e9..60bfa3ab22 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2348,19 +2348,25 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, } // ... but before biblatex (see #7065) - if (features.mustProvide("biblatex") + if ((features.mustProvide("biblatex") + || features.isRequired("biblatex-chicago")) + && !features.isProvided("biblatex-chicago") && !features.isProvided("biblatex-natbib") && !features.isProvided("natbib-internal") && !features.isProvided("natbib") && !features.isProvided("jurabib")) { + // The biblatex-chicago package has a differing interface + // it uses a wrapper package and loads styles via fixed options + bool const chicago = features.isRequired("biblatex-chicago"); string delim = ""; string opts; os << "\\usepackage"; if (!biblatex_bibstyle.empty() - && (biblatex_bibstyle == biblatex_citestyle)) { + && (biblatex_bibstyle == biblatex_citestyle) + && !chicago) { opts = "style=" + biblatex_bibstyle; delim = ","; - } else { + } else if (!chicago) { if (!biblatex_bibstyle.empty()) { opts = "bibstyle=" + biblatex_bibstyle; delim = ","; @@ -2392,7 +2398,10 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, opts += delim + biblio_opts; if (!opts.empty()) os << "[" << opts << "]"; - os << "{biblatex}\n"; + if (chicago) + os << "{biblatex-chicago}\n"; + else + os << "{biblatex}\n"; } -- 2.39.5