On Wed, Feb 28, 2007 at 10:27:18PM +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> The attached patches make both these mechanisms respond to the > Martin> ProvidesNatbib textclass flag. I am not sure I did this right > Martin> -- I am especially uncertain about the handling of the numeric > Martin> vs. author-year thing. Shouldn't this also be in the .layout > Martin> file if the class is loading natbib? > > CiteEngine_enum getEngine(Buffer const & buffer) > { > - return buffer.params().cite_engine; > + BufferParams const & p = buffer.params(); > + if (p.getLyXTextClass().provides(LyXTextClass::natbib)) { > + if (p.cite_engine == biblio::ENGINE_NATBIB_NUMERICAL) > + return ENGINE_NATBIB_NUMERICAL; > + else > + return ENGINE_NATBIB_AUTHORYEAR; > + } else > + return p.cite_engine; > } > > What is the logic here?
It's about which "citation engine" to use. Before the patch, it is the one specified in the document's bufferparameters -- i.e., stuff settable from Document Settings, the Bibliography tab. Manually choosing to use natbib, or not. That is the current situation: the natbib engine, allowing you to choose from multiple alternative formats like citep, citeauthor etc., is only used if you specify it explicitly this way. With the patch, this engine is also chosen if the _document class_ provides natbib (as indicated in the .layout file by the ProvidesNatbib switch). The choice between numeric an authoryear in this part of the patch is something I don't understand really. That's what I asked about. I think the document class should provide this in this case, but it doesn't. Perhaps a FIXME would be called for. - Martin > Martin> I suppose that if this solution is acceptable, it should go > Martin> into 1.4 also. So Manuel will get it in time for the April EGS > Martin> meeting in Vienna :-) > > Yes, probably. > > JMarc >
pgpGJ29eKVVxV.pgp
Description: PGP signature