void Buffer::addBiblioInfo(BiblioInfo const & bin) const
{
+ // We add the biblio info to the master buffer,
+ // if there is one, but also to every single buffer,
+ // in case a child is compiled alone.
BiblioInfo & bi = d->bibinfo_;
bi.mergeBiblioInfo(bin);
}
-void Buffer::addBibTeXInfo(docstring const & key, BibTeXInfo const & bi) const
+void Buffer::addBibTeXInfo(docstring const & key, BibTeXInfo const & bin) const
{
- Buffer const * tmp = masterBuffer();
- BiblioInfo & masterbi = (tmp == this) ?
- d->bibinfo_ : tmp->d->bibinfo_;
- masterbi[key] = bi;
+ // We add the bibtex info to the master buffer,
+ // if there is one, but also to every single buffer,
+ // in case a child is compiled alone.
+ BiblioInfo & bi = d->bibinfo_;
+ bi[key] = bin;
+
+ if (parent() != 0) {
+ BiblioInfo & masterbi = parent()->d->bibinfo_;
+ masterbi[key] = bin;
+ }
}
// engine, e.g. \cite[]{} for the basic engine.
void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
{
+ // When this is a child compiled on its own, we use the childs
+ // own bibinfo, else the master's
BiblioInfo const & bi = runparams.is_child
? buffer().masterBibInfo() : buffer().bibInfo();
docstring const key = getParam("key");