commit 378a2c825743b4234bf2a7e6358cf82eb2709e88 Author: Juergen Spitzmueller <sp...@lyx.org> Date: Sat Jan 7 17:40:23 2017 +0100
Outsource jurabib specials to the style file. --- lib/citeengines/jurabib.citeengine | 16 ++++++++++++---- src/BiblioInfo.cpp | 21 --------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/citeengines/jurabib.citeengine b/lib/citeengines/jurabib.citeengine index 220dd64..f092fa0 100644 --- a/lib/citeengines/jurabib.citeengine +++ b/lib/citeengines/jurabib.citeengine @@ -129,16 +129,24 @@ CiteFormat authoryear !open ( !sep ; !close ) + !obracket [ + !cbracket ] # A link that lets us jump to the bibliography entry in LyXHTML # %clean:key% will be substituted by the cite key to give a unique id !startlink {!<a href='#LyXCite-%clean:key%'>!} !endlink {!</a>!} - # "ShortAuthor" or "??" - !shortauthor {%shortauthor%[[%shortauthor%]][[??]]} - # "... ShortTitle" (button) / "... ShortTitle <short title>" (dialog) - !shorttitle {%shorttitle%[[ %shorttitle%]][[{%dialog%[[ <%_shorttitle%>]]}]]} + # "ShortAuthor", "Author" or "??" + !shortauthor {%shortauthor%[[%shortauthor%]][[{%abbrvauthor%[[%abbrvauthor%]][[??]]}]]} + # "... ShortTitle" + !shorttitle {%shorttitle%[[ %shorttitle%]][[{%dialog%[[ <%_shorttitle%>]][[%!makejurashorttitle%]]}]]} + # Title or "??" + !maketitle {%title%[[ %title%]][[ ??]]} + # "Journal Volume [Year]" + !jurashorttitle {%journal%[[ %journal%]]}{%volume%[[ %volume%]]}{%year%[[ %!obracket%%year%%!cbracket%]]} + # Handle short title fallback + !makejurashorttitle {%ifentrytype:article%[[%!jurashorttitle%]][[{%ifentrytype:periodical%[[%!jurashorttitle%]][[ %!maketitle%]]}]]} # "prenote " !textbefore {%textbefore%[[%textbefore% ]]} # "/prenote" (button) / "/prenote/<before>" (dialog) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 44e517a..59ecd7f 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -292,13 +292,6 @@ docstring const BibTeXInfo::getAuthorList( vector<docstring> const authors = getVectorFromString(author, from_ascii(" and ")); - if (jurabib_style && (authors.size() == 2 || authors.size() == 3)) { - docstring shortauthor = familyName(authors[0]) - + "/" + familyName(authors[1]); - if (authors.size() == 3) - shortauthor += "/" + familyName(authors[2]); - return convertLaTeXCommands(shortauthor); - } docstring retval; CiteEngineType const engine_type = buf ? buf->params().citeEngineType() @@ -763,20 +756,6 @@ docstring BibTeXInfo::getValueForKey(string const & oldkey, Buffer const & buf, ret = modifier_; else if (key == "numericallabel") ret = cite_number_; - else if (key == "shortauthor") - // When shortauthor is not defined, jurabib automatically - // provides jurabib-style abbreviated author names. We do - // this as well. - ret = getAbbreviatedAuthor(&buf, true); - else if (key == "shorttitle") { - // When shorttitle is not defined, jurabib uses for `article' - // and `periodical' entries the form `journal volume [year]' - // and for other types of entries it uses the `title' field. - if (entry_type_ == "article" || entry_type_ == "periodical") - ret = operator[]("journal") + " " + operator[]("volume") - + " [" + operator[]("year") + "]"; - else - ret = operator[]("title"); else if (key == "abbrvauthor") { // Special key to provide abbreviated author names, // with respect to maxcitenames.