]> git.lyx.org Git - features.git/commitdiff
Basic support for biblatex-chicago
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 18 Feb 2019 12:14:53 +0000 (13:14 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:58 +0000 (14:39 +0200)
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
src/BufferParams.cpp

index 4b78d88545206f4e4db224cd3643a6a4bfb73365..d8b027f001c196e42f835df72f7a8c292fde2116 100644 (file)
 \TestPackage{babel}
 \TestPackage{beamerposter}
 \TestPackage{biblatex}
+\TestPackage{biblatex-chicago}
 \TestPackage{bibtopic}
 \TestPackage{bicaption}
 \TestPackage{bidi}
index d57f68c0e9038f8e59526a4f9b1e05c3cacd884f..60bfa3ab2226ad9d241c23776bea5ac5157c16bb 100644 (file)
@@ -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";
        }