!startlink {!<a href='#LyXCite-%clean:key%'>!}
!endlink {!</a>!}
- !cite %!startlink%{%label%[[%label%]][[#%key%]]}%!endlink%%!nextcite%
+ !cite %!startlink%{%label%[[%label%]][[{%numericallabel%[[%numericallabel%]][[#%key%]]}]]}%!endlink%%!nextcite%
!nextcite {%next%[[%!sep% %!cite%]]}
!nexthashkey {%next%[[%!sep% #%key%%!nexthashkey%]]}
!sep ,
!close ]
- !citet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%#%key%%!endlink%]]}%!nextcitet%
- !citealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%#%key%%!endlink%]]}%!nextcitealt%
+ !citet %!abbrvauthor% %!open%%!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitet%
+ !citealt %!abbrvauthor% %!textbefore%{%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%]]}%!nextcitealt%
- !hashkey {%dialog%[[#ID]][[%!startlink%#%key%%!endlink%%!nexthashkey%]]}
+ !hashkey {%dialog%[[#ID]][[%!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
!nextcitet {%next%[[%!close%%!sep% %!citet%]]}
!nextcitealt {%next%[[%!sep% %!citealt%]]}
!nexthashid {%next%[[%!sep% #ID%!nexthashid%]]}
- !nexthashkey {%next%[[%!sep% %!startlink%#%key%%!endlink%%!nexthashkey%]]}
+ !nexthashkey {%next%[[%!sep% %!startlink%{%numericallabel%[[%numericallabel%]][[#%key%]]}%!endlink%%!nexthashkey%]]}
cite %!open%%!textbefore%%!hashkey%%!textafter%%!close%
citep %!open%%!textbefore%%!hashkey%%!textafter%%!close%
ret = label_;
else if (key == "modifier" && modifier_ != 0)
ret = modifier_;
+ else if (key == "numericallabel")
+ ret = cite_number_;
else if (key == "abbrvauthor")
// Special key to provide abbreviated author names.
ret = getAbbreviatedAuthor(buf, false);
DocumentClass const & textclass = master->params().documentClass();
// do this only if we are the top-level Buffer
- if (master == this)
+ if (master == this) {
+ textclass.counters().reset(from_ascii("bibitem"));
reloadBibInfoCache();
+ }
// keep the buffers to be children in this set. If the call from the
// master comes back we can see which of them were actually seen (i.e.
docstring InsetBibitem::bibLabel() const
{
+ BufferParams const & bp = buffer().masterBuffer()->params();
+ if (bp.citeEngineType() == ENGINE_TYPE_NUMERICAL)
+ return autolabel_;
docstring const & label = getParam("label");
return label.empty() ? autolabel_ : label;
}
BibTeXInfo keyvalmap(false);
keyvalmap.key(key);
keyvalmap.label(label);
+
+ BufferParams const & bp = buffer().masterBuffer()->params();
+ Counters & counters = bp.documentClass().counters();
+ docstring const bibitem = from_ascii("bibitem");
+ if (bp.citeEngineType() == ENGINE_TYPE_NUMERICAL || getParam("label").empty()) {
+ if (counters.hasCounter(bibitem))
+ counters.step(bibitem, InternalUpdate);
+ string const & lang = it.paragraph().getParLanguage(bp)->code();
+ keyvalmap.setCiteNumber(counters.theCounter(bibitem, lang));
+ }
+
DocIterator doc_it(it);
doc_it.forwardPos();
keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & counters = bp.documentClass().counters();
docstring const bibitem = from_ascii("bibitem");
- if (getParam("label").empty()) {
+ if (bp.citeEngineType() == ENGINE_TYPE_NUMERICAL || getParam("label").empty()) {
if (counters.hasCounter(bibitem))
counters.step(bibitem, utype);
string const & lang = it.paragraph().getParLanguage(bp)->code();