mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Generate the citation labels before exporting to plain text.
This commit is contained in:
parent
6456c2262e
commit
cc1ce04798
@ -2121,6 +2121,13 @@ void Buffer::addBibTeXInfo(docstring const & key, BibTeXInfo const & bi) const
|
||||
}
|
||||
|
||||
|
||||
void Buffer::makeCitationLabels() const
|
||||
{
|
||||
Buffer const * const master = masterBuffer();
|
||||
return d->bibinfo_.makeCitationLabels(*master);
|
||||
}
|
||||
|
||||
|
||||
bool Buffer::citeLabelsValid() const
|
||||
{
|
||||
return masterBuffer()->d->cite_labels_valid_;
|
||||
|
@ -486,6 +486,8 @@ public:
|
||||
/// add a single piece of bibliography info to our cache
|
||||
void addBibTeXInfo(docstring const & key, BibTeXInfo const & bi) const;
|
||||
///
|
||||
void makeCitationLabels() const;
|
||||
///
|
||||
bool citeLabelsValid() const;
|
||||
///
|
||||
void getLabelList(std::vector<docstring> &) const;
|
||||
|
@ -344,8 +344,13 @@ void InsetCitation::addToToc(DocIterator const & cpit) const
|
||||
|
||||
int InsetCitation::plaintext(odocstream & os, OutputParams const &) const
|
||||
{
|
||||
os << cache.generated_label;
|
||||
return cache.generated_label.size();
|
||||
string const & cmd = getCmdName();
|
||||
if (cmd == "nocite")
|
||||
return 0;
|
||||
|
||||
docstring const label = generateLabel(false);
|
||||
os << label;
|
||||
return label.size();
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ void writePlaintextFile(Buffer const & buf, FileName const & fname,
|
||||
// make sure we are ready to export
|
||||
buf.updateBuffer();
|
||||
buf.updateMacroInstances(OutputUpdate);
|
||||
buf.makeCitationLabels();
|
||||
|
||||
writePlaintextFile(buf, ofs, runparams);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user