]> git.lyx.org Git - features.git/commitdiff
Properly parse biblatex crossref'ed book titles
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Feb 2024 14:51:35 +0000 (15:51 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Feb 2024 14:51:35 +0000 (15:51 +0100)
src/BiblioInfo.cpp

index 8ce296b3720aed626439184a16197dc757e872f3..2a2e8d476cc327bf9ad31aa51126f873563a7789 100644 (file)
@@ -1279,6 +1279,8 @@ docstring BibTeXInfo::getValueForKey(string const & oldkey, Buffer const & buf,
 
        // If we have no result, check in the cross-ref'ed entries
        if (ret.empty() && !xrefs.empty()) {
+               bool const biblatex =
+                       buf.params().documentClass().citeFramework() == "biblatex";
                // xr is a (reference to a) BibTeXInfo const *
                for (auto const & xr : xrefs) {
                        if (!xr)
@@ -1289,6 +1291,13 @@ docstring BibTeXInfo::getValueForKey(string const & oldkey, Buffer const & buf,
                        if (!ret.empty())
                                // success!
                                break;
+                       // in biblatex, cross-ref'ed titles are mapped
+                       // to booktitle. Same for subtitle etc.
+                       if (biblatex && prefixIs(key, "book"))
+                               ret = (*xr)[key.substr(4)];
+                       if (!ret.empty())
+                               // success!
+                               break;
                }
        }