}
-void InsetCitation::updateLabels(ParIterator const &, UpdateType)
+void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
{
CiteEngine const engine = buffer().params().citeEngine();
if (cache.params == params() && cache.engine == engine)
docstring label = glabel;
if (label.size() > maxLabelChars) {
- label.erase(maxLabelChars-3);
+ label.erase(maxLabelChars - 3);
label += "...";
}
int InsetCitation::latex(odocstream & os, OutputParams const & runparams) const
{
CiteEngine cite_engine = buffer().params().citeEngine();
+ BiblioInfo const & bi = buffer().masterBibInfo();
// FIXME UNICODE
docstring const cite_str = from_utf8(
asValidLatexCommand(getCmdName(), cite_engine));
else if (!after.empty())
os << '[' << after << ']';
- os << '{' << cleanupWhitespace(getParam("key")) << '}';
+ if (!bi.isBibtex(getParam("key")))
+ // escape chars with bibitems
+ os << '{' << escape(cleanupWhitespace(getParam("key"))) << '}';
+ else
+ os << '{' << cleanupWhitespace(getParam("key")) << '}';
if (runparams.inulemcmd)
os << "}";