On Thursday 26 July 2001 17:06, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | 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!
> 
> But... I thought that natbib redefined "cite" as well?

Yes, but the point remains. You'll get the same output, whether or not you 
use natbib, so therefore don't use it. Why include unnecessary packages?

If I'm wrong (ie a cite is different when using natbib to when not using it) 
then of couurse the fix is trivial.

If I'm right, then I'd say leave things as they are.

Angus

Reply via email to