- // We are going to collect all the citation keys used in the document,
- // getting them from the TOC.
- Toc const & toc = buffer().tocBackend().toc("citation");
- Toc::const_iterator it = toc.begin();
- Toc::const_iterator const en = toc.end();
- vector<docstring> citekeys;
- for (; it != en; ++it) {
- if (it->str().empty())
- continue;
- vector<docstring> const keys = getVectorFromString(it->str());
- citekeys.insert(citekeys.end(), keys.begin(), keys.end());
- }
- if (citekeys.empty())
- return docstring();
- sort(citekeys.begin(), citekeys.end());
- unique(citekeys.begin(), citekeys.end());
- // We now have a sorted, unique list of the keys used in this document.
- // We will now convert it to a list of the BibTeXInfo objects used in
- // this document...
- // FIXME XHTML
- // We need to do something here about cross-references, if we
- // want to be able to display them AS cross-references. Probably the
- // easiest thing to do is to loop over the list again and add whatever
- // cross-references we find, then sort and unique it, planning just to
- // add the cross-references to the bibliography.
- vector<BibTeXInfo const *> binfo;
- vector<docstring>::const_iterator cit = citekeys.begin();
- vector<docstring>::const_iterator const cen = citekeys.end();
- BiblioInfo const & bi = buffer().masterBibInfo();
- for (; cit != cen; ++cit) {
- BiblioInfo::const_iterator const bt = bi.find(*cit);
- if (bt == bi.end())
- continue;
- binfo.push_back(&(bt->second));
- }
- // ...and sort it.
- sort(binfo.begin(), binfo.end(), lSorter);
- // Finally, then, we are ready for output.
- xs << StartTag("h2", "class='bibliography'");
- xs << _("References");
- xs << EndTag("h2");
- xs << StartTag("div", "class='bibliography'");
+ BiblioInfo const & bibinfo = buffer().masterBibInfo();
+ vector<docstring> const & cites = bibinfo.citedEntries();
+ CiteEngineType const engine_type = buffer().params().citeEngineType();
+ bool const numbers = (engine_type == ENGINE_TYPE_NUMERICAL);
+
+ docstring reflabel = from_ascii("References");
+ Language const * l = buffer().params().language;
+ if (l)
+ reflabel = translateIfPossible(reflabel, l->code());
+
+ xs << html::StartTag("h2", "class='bibtex'")
+ << reflabel
+ << html::EndTag("h2")
+ << html::StartTag("div", "class='bibtex'");