I've carried through on my threat and created a ProvidesNatbib layout
keyword. It's attached as diff_natbib (diff -ru format). I've also
attached the updated AASTeX stuff as diff_aastex. Only if the natbib patch
is accepted should the aastex patch be applied. The changes are trivial,
but get done what I need. There is one thing I'd like to do, but haven't
figured out how: the patch currently does not turn on the GUI natbib
support automatically; you still need to click the radio button. Is there
some way to tell the GUI to turn on without clicking anything else?

The Changelog entry, which I didn't apply, should look like
LaTeXFeatures.C, lyxtextclass.C lyxtextclass.h: Add layout keyword
ProvidesNatbib. Do not add \usepackage{natbib} to tex file if natbib is
provided by the LaTeX class.

I'd like the patch to be applied now since I consider the lack of
ProvidesNatbib to be a bug in the sense that it breaks the new natbib
support for AASTeX.

Be gentle - there's a reason I write documentation, not code ...

Mike

-- 
Mike Ressler
[EMAIL PROTECTED]
OK, I'm lame: I don't have my own website ...
diff -ru lyx-1.2.0pre3/src/LaTeXFeatures.C lyx-1.2.0pre3a/src/LaTeXFeatures.C
--- lyx-1.2.0pre3/src/LaTeXFeatures.C   Thu Mar 21 09:25:07 2002
+++ lyx-1.2.0pre3a/src/LaTeXFeatures.C  Thu Apr 18 21:13:48 2002
@@ -245,7 +245,7 @@
 
        // float.sty
        // natbib.sty
-       if (isRequired("natbib")) {
+       if (isRequired("natbib") && ! tclass.provides(LyXTextClass::natbib)) {
                packages << "\\usepackage[";
                if (params.use_numerical_citations) {
                        packages << "numbers";
diff -ru lyx-1.2.0pre3/src/lyxtextclass.C lyx-1.2.0pre3a/src/lyxtextclass.C
--- lyx-1.2.0pre3/src/lyxtextclass.C    Thu Mar 21 09:25:15 2002
+++ lyx-1.2.0pre3a/src/lyxtextclass.C   Thu Apr 18 23:18:01 2002
@@ -91,6 +91,7 @@
        TC_CLASSOPTIONS,
        TC_PREAMBLE,
        TC_PROVIDESAMSMATH,
+       TC_PROVIDESNATBIB,
        TC_PROVIDESMAKEIDX,
        TC_PROVIDESURL,
        TC_LEFTMARGIN,
@@ -114,6 +115,7 @@
                { "pagestyle",       TC_PAGESTYLE },
                { "preamble",        TC_PREAMBLE },
                { "providesamsmath", TC_PROVIDESAMSMATH },
+               { "providesnatbib",  TC_PROVIDESNATBIB },
                { "providesmakeidx", TC_PROVIDESMAKEIDX },
                { "providesurl",     TC_PROVIDESURL },
                { "rightmargin",     TC_RIGHTMARGIN },
@@ -284,6 +286,11 @@
                                provides_ |= amsmath;
                        break;
 
+               case TC_PROVIDESNATBIB:
+                       if (lexrc.next() && lexrc.getInteger())
+                               provides_ |= natbib;
+                       break;
+
                case TC_PROVIDESMAKEIDX:
                        if (lexrc.next() && lexrc.getInteger())
                                provides_ |= makeidx;

diff -ru lyx-1.2.0pre3/src/lyxtextclass.h lyx-1.2.0pre3a/src/lyxtextclass.h
--- lyx-1.2.0pre3/src/lyxtextclass.h    Thu Mar 21 09:25:15 2002
+++ lyx-1.2.0pre3a/src/lyxtextclass.h   Thu Apr 18 21:18:40 2002
@@ -93,7 +93,9 @@
                ///
                makeidx = 2,
                ///
-               url = 4
+               url = 4,
+               ///
+               natbib = 8
        };
        ///
        bool provides(Provides p) const;
diff -ru lyx-1.2.0pre3/lib/layouts/aastex.layout 
lyx-1.2.0pre3a/lib/layouts/aastex.layout
--- lyx-1.2.0pre3/lib/layouts/aastex.layout     Mon Mar 20 06:49:53 2000
+++ lyx-1.2.0pre3a/lib/layouts/aastex.layout    Thu Apr 18 22:43:29 2002
@@ -26,6 +26,7 @@
 #                        is changed. (Not by me!) Documentation, template, and
 #                        example files are available.
 # Version 1.1  7/25/99 - Changed \url to take advantage of new layout option.
+# Version 1.2  4/18/02 - Updated for natbib in 1.2.0
 
 # General textclass parameters
 Columns                        1
@@ -35,6 +36,7 @@
 TocDepth               0
 PageStyle              Plain
 ProvidesAmsmath                1
+ProvidesNatbib         1
 ProvidesUrl            1
 ClassOptions
   PageStyle            ""      
diff -ru lyx-1.2.0pre3/lib/templates/aastex.lyx 
lyx-1.2.0pre3a/lib/templates/aastex.lyx
--- lyx-1.2.0pre3/lib/templates/aastex.lyx      Fri Nov  3 03:21:37 2000
+++ lyx-1.2.0pre3a/lib/templates/aastex.lyx     Fri Apr 19 00:45:49 2002
@@ -1,6 +1,5 @@
-#This file was created by <mike> Wed Jun  9 13:29:15 1999
-#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
-\lyxformat 2.15
+#LyX 1.2 created this file. For more info see http://www.lyx.org/
+\lyxformat 220
 \textclass aastex
 \begin_preamble
 \slugcomment{}
@@ -17,6 +16,8 @@
 \paperpackage a4
 \use_geometry 0
 \use_amsmath 0
+\use_natbib 1
+\use_numerical_citations 0
 \paperorientation portrait
 \secnumdepth 3
 \tocdepth 3
@@ -34,10 +35,16 @@
 \layout Author
 
 <Author 1>
-\latex latex 
+\begin_inset ERT
+status Inlined
+
+\layout Standard
 
 \backslash 
 altaffilmark{1}
+\end_inset 
+
+
 \layout Affiliation
 
 <Institution and Address>
@@ -47,10 +54,16 @@
 \layout Author
 
 <Author 2>
-\latex latex 
+\begin_inset ERT
+status Inlined
+
+\layout Standard
 
 \backslash 
 altaffilmark{2,3}
+\end_inset 
+
+
 \layout Affiliation
 
 <Institution and Address>
@@ -59,39 +72,39 @@
 \layout Author
 
 <Author 3>
-\latex latex 
+\begin_inset ERT
+status Inlined
+
+\layout Standard
 
 \backslash 
 altaffilmark{3}
+\end_inset 
+
+
 \layout Affiliation
 
 <Institution and Address>
 \layout Standard
 
 
-\latex latex 
+\begin_inset ERT
+status Inlined
+
+\layout Standard
 
 \backslash 
 altaffiltext{1}{Visiting Astronomer, etc.}
-\latex default 
- 
 \layout Standard
 
-
-\latex latex 
-
 \backslash 
 altaffiltext{2}{Current Address, etc.}
-\latex default 
- 
 \layout Standard
 
-
-\latex latex 
-
 \backslash 
 altaffiltext{3}{Visiting Astronomer, etc.}
-\latex default 
+\end_inset 
+
  
 \layout Abstract
 
@@ -122,11 +135,10 @@
 \end_inset 
 
  and to 
-\latex latex 
+\begin_inset LatexCommand \citet{ref1}
+
+\end_inset 
 
-\backslash 
-citet{ref1}
-\latex default 
 > 
 \layout Section
 
@@ -154,30 +166,36 @@
 \bibitem [Author(1982)]{ref1}
 
 Author, A., 
-\latex latex 
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 
 \backslash 
 apj
-\latex default 
+\end_inset 
+
 , 109, 301 
 \layout Standard
 
 
-\latex latex 
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 
 \backslash 
 clearpage
-\layout FigCaption
+\end_inset 
+
 
+\layout FigCaption
 
-\latex latex 
 
 \begin_inset LatexCommand \label{fig1}
 
 \end_inset 
 
-
-\latex default 
 This is the first figure.
  
 \the_end

Reply via email to