- docstring label;
- vector<string> keys = getVectorFromString(keyList);
- vector<string>::const_iterator it = keys.begin();
- vector<string>::const_iterator end = keys.end();
- for (; it != end; ++it) {
- // get the bibdata corresponding to the key
- docstring const author(biblio::getAbbreviatedAuthor(infomap, *it));
- docstring const year(biblio::getYear(infomap, *it));
-
- // Something isn't right. Fail safely.
- if (author.empty() || year.empty())
- return docstring();
-
- // authors1/<before>; ... ;
- // authors_last, <after>
- if (cite_type == "cite" && engine == biblio::ENGINE_JURABIB) {
- if (it == keys.begin())
- label += author + before_str + sep_str;
- else
- label += author + sep_str;
-
- // (authors1 (<before> year); ... ;
- // authors_last (<before> year, <after>)
- } else if (cite_type == "citet") {
- switch (engine) {
- case biblio::ENGINE_NATBIB_AUTHORYEAR:
- label += author + op_str + before_str +
- year + cp + sep_str;
- break;
- case biblio::ENGINE_NATBIB_NUMERICAL:
- // FIXME UNICODE
- label += author + op_str + before_str +
- '#' + from_utf8(*it) + cp + sep_str;
- break;
- case biblio::ENGINE_JURABIB:
- label += before_str + author + op_str +
- year + cp + sep_str;
- break;
- case biblio::ENGINE_BASIC:
- break;
- }
-
- // author, year; author, year; ...
- } else if (cite_type == "citep" ||
- cite_type == "citealp") {
- if (engine == biblio::ENGINE_NATBIB_NUMERICAL) {
- // FIXME UNICODE
- label += from_utf8(*it) + sep_str;
- } else {
- label += author + ", " + year + sep_str;
- }
-
- // (authors1 <before> year;
- // authors_last <before> year, <after>)
- } else if (cite_type == "citealt") {
- switch (engine) {
- case biblio::ENGINE_NATBIB_AUTHORYEAR:
- label += author + ' ' + before_str +
- year + sep_str;
- break;
- case biblio::ENGINE_NATBIB_NUMERICAL:
- // FIXME UNICODE
- label += author + ' ' + before_str +
- '#' + from_utf8(*it) + sep_str;
- break;
- case biblio::ENGINE_JURABIB:
- label += before_str + author + ' ' +
- year + sep_str;
- break;
- case biblio::ENGINE_BASIC:
- break;
- }
-
- // author; author; ...
- } else if (cite_type == "citeauthor") {
- label += author + sep_str;
-
- // year; year; ...
- } else if (cite_type == "citeyear" ||
- cite_type == "citeyearpar") {
- label += year + sep_str;
- }
+ BiblioInfo const & bi = buf.masterBibInfo();
+ if (bi.empty())
+ return _("No bibliography defined!");
+
+ docstring const & key = getParam("key");
+ if (key.empty())
+ return _("No citations selected!");
+
+ vector<docstring> keys = getVectorFromString(key);
+ vector<docstring>::const_iterator it = keys.begin();
+ vector<docstring>::const_iterator en = keys.end();
+ docstring tip;
+ for (; it != en; ++it) {
+ docstring const key_info = bi.getInfo(*it, buffer());
+ if (key_info.empty())
+ continue;
+ if (!tip.empty())
+ tip += "\n";
+ tip += wrap(key_info, -4);