]> git.lyx.org Git - features.git/commitdiff
Display full author list with Natbib (non-BibTeX) if requested
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 19 Apr 2019 07:33:31 +0000 (09:33 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:26 +0000 (15:48 +0200)
src/BiblioInfo.cpp
src/frontends/qt4/GuiBibitem.cpp

index dac2097bb93baeec34705bf3eb44350450b72622..80cafeb3595bf1a60b005084f43bf5c2bf295ac2 100644 (file)
@@ -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;
        }
 
index 462a8705f572817efef0d00356d14e98d264e5fe..84bffe4d7d508ca91a54fa19db84629f0bdf892c 100644 (file)
@@ -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);