+ // 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)
+ continue;
+ // use empty BibTeXInfoList to avoid loops
+ BibTeXInfoList xr_dummy;
+ ret = xr->getValueForKey(oldkey, buf, ci, xr_dummy, maxsize);
+ 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)];
+ // likewise, author is maped onto bookauthor
+ else if (biblatex && contains(key, ":bookauthor"))
+ ret = xr->getValueForKey(subst(key, "bookauthor", "author"),
+ buf, ci, xr_dummy, maxsize);
+ if (!ret.empty())
+ // success!
+ break;
+ }
+ }
+