From 475b4b9571bb9092d83bb90c2ac32326090c8586 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 19 Apr 2019 09:33:31 +0200 Subject: [PATCH] Display full author list with Natbib (non-BibTeX) if requested --- src/BiblioInfo.cpp | 6 ++++++ src/frontends/qt4/GuiBibitem.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index dac2097bb9..80cafeb359 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -524,6 +524,12 @@ docstring const BibTeXInfo::getAuthorList(Buffer const * buf, // in this case, we didn't find a "(", // so we don't have author (year) return docstring(); + if (full) { + // Natbib syntax is "Jones et al.(1990)Jones, Baker, and Williams" + docstring const fullauthors = trim(rsplit(remainder, ')')); + if (!fullauthors.empty()) + return fullauthors; + } return authors; } diff --git a/src/frontends/qt4/GuiBibitem.cpp b/src/frontends/qt4/GuiBibitem.cpp index 462a8705f5..84bffe4d7d 100644 --- a/src/frontends/qt4/GuiBibitem.cpp +++ b/src/frontends/qt4/GuiBibitem.cpp @@ -64,7 +64,9 @@ void GuiBibitem::paramsToDialog(Inset const * inset) int const i = label.lastIndexOf("("); int const j = label.lastIndexOf(")"); if (i != -1 && j != -1 && i < j) { - // Split Author(Year) to Author and Year + // Split Author(s) and Year + // Natbib syntax is "Jones et al.(1990)Jones, Baker, and Williams" + // (full list is optional) QString const year = label.left(j).mid(i + 1); QString const author = label.left(i); QString const allauthors = label.mid(j + 1); -- 2.39.5