- // One day, these might be tunable (as they are in BibTeX).
- char const op = '('; // opening parenthesis.
- char const cp = ')'; // closing parenthesis.
- // puctuation mark separating citation entries.
- char const * const sep = ";";
-
- docstring const op_str(' ' + docstring(1, op));
- docstring const cp_str(docstring(1, cp) + ' ');
- docstring const sep_str(from_ascii(sep) + ' ');
-
- 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;
- }