- 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);
- if (key_info.empty())
- continue;
- if (!tip.empty())
- tip += "\n";
- tip += wrap(key_info, -4);
+ string cite_type = getCmdName();
+ bool const uppercase = isUpperCase(cite_type[0]);
+ if (uppercase)
+ cite_type[0] = lowercase(cite_type[0]);
+ bool const starred = (cite_type[cite_type.size() - 1] == '*');
+ if (starred)
+ cite_type = cite_type.substr(0, cite_type.size() - 1);
+
+ // handle alias
+ string const alias = buf.masterParams().getCiteAlias(cite_type);
+ if (!alias.empty())
+ cite_type = alias;
+
+ // FIXME: allow to add cite macros
+ /*
+ buffer().params().documentClass().addCiteMacro("!textbefore", to_utf8(before));
+ buffer().params().documentClass().addCiteMacro("!textafter", to_utf8(after));
+ */
+ docstring label;
+ // we only really want the last 'false', to suppress trimming, but
+ // we need to give the other defaults, too, to set it.
+ vector<docstring> keys =
+ getVectorFromString(key, from_ascii(","), false, false);
+ CitationStyle cs = getCitationStyle(buffer().masterParams(),
+ cite_type, buffer().masterParams().citeStyles());
+ bool const qualified = cs.hasQualifiedList
+ && (keys.size() > 1
+ || !getParam("pretextlist").empty()
+ || !getParam("posttextlist").empty());
+ QualifiedList pres = getQualifiedLists(getParam("pretextlist"));
+ QualifiedList posts = getQualifiedLists(getParam("posttextlist"));
+
+ CiteItem ci;
+ ci.textBefore = getParam("before");
+ ci.textAfter = getParam("after");
+ ci.forceUpperCase = uppercase;
+ ci.Starred = starred;
+ ci.max_size = UINT_MAX;
+ ci.isQualified = qualified;
+ ci.pretexts = pres;
+ ci.posttexts = posts;
+ if (for_xhtml) {
+ ci.max_key_size = UINT_MAX;
+ ci.context = CiteItem::Export;