On Thursday 26 July 2001 15:52, Michael Schmitt wrote:
> On Thu, 26 Jul 2001, Angus Leeming wrote:
>
> > On Thursday 26 July 2001 15:11, Michael Schmitt wrote:
> > > Hi,
> > >
> > > I have activated natbib support in the document dialog but LyX does not
> > > write the corresponding "\usepackage[sort]{natbib}" statement when
> > > exporting LaTeX. Could someone please verify this (invalid) behavior?
> > >
> > Errrr. Why would it? Do you see a "sort" option anywhere? This is
preliminary
> > support for natbib
>
> Such a sort option would be nice indeed! Maybe I was dreaming when I wrote
> my email :-)
>
> But I would be very glad if I got a "usepackage" option at all! Maybe it
> has to do with the fact that my PhD is a multipart document? A possible
> explanation would be that the usepackage statement is only added in case
> of a citation and LyX just looks into the main document (where there is
> just a bibliography reference).
Light dawns!
Here is the method that checks whether we should have a "usepackage" at the
start of the document.
void InsetCitation::validate(LaTeXFeatures & features) const
{
if (getCmdName() != "cite" && features.bufferParams().use_natbib)
features.natbib = true;
}
Ie, go through each and every Citation inset and if any one of them is a
citep, citet etc, then flag usepackage{natbib} for inclusion.
All of your citation commands are still "cite" aren't they?
There is little point in including natbib if you aren't going to use it!
Angus