Major work on natbib implementation
authorTim Pope <code@tpope.net>
Mon, 17 Nov 2003 08:05:16 +0000 (08:05 +0000)
committerTim Pope <code@tpope.net>
Mon, 17 Nov 2003 08:05:16 +0000 (08:05 +0000)
Makefile
mlastyle.dtx

index ab16ecb886c3003f704dda449ecedbce732c5ed1..c6fa6c751629dc137a172440a4c1820ffb05d43a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,8 +18,6 @@ FAKEROOT=`[ -x /usr/bin/fakeroot ] && echo /usr/bin/fakeroot`
 
 %.bbl: %.bib
        $(BIBTEX) $*.aux
-       $(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo
-       $(MAKEINDEX) -s gind.ist -o $*.ind $*.idx
 
 %.bib: %.dtx
        $(LATEX) $<
@@ -30,6 +28,9 @@ FAKEROOT=`[ -x /usr/bin/fakeroot ] && echo /usr/bin/fakeroot`
 %.dvi: %.sty %.dtx %.bbl
        $(LATEX) $*.dtx
        $(LATEX) $*.dtx
+       $(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo
+       $(MAKEINDEX) -s gind.ist -o $*.ind $*.idx
+       $(LATEX) $*.dtx
 
 %.ps: %.dvi
        $(DVIPS) -o $@ $<
index 252e96ac7a64a5f3777130c1f79d20a37501be74..906ed671f6903ec1aa87d177d01f8e5120f55cda 100644 (file)
@@ -69,8 +69,14 @@ Schlegl",
   \addtolength{\textwidth}{-1in}
   \addtolength{\headwidth}{-1in}
 \else
+  \IfFileExists{natbib.sty}{
+    \usepackage{natbib}
+    \citeindextrue
+    \bibpunct{[}{]}{,}{n}{}{,}%{
+    \bibliographystyle{plainnat}}
+    {\bibliographystyle{plain}}
+  \IfFileExists{url.sty}{\usepackage{url}}{}
   \usepackage[compat]{mlastyle}
-  \bibliographystyle{plain}
   %\addtolength{\headsep}{-5pt}
   %\addtolength{\headheight}{-12pt}
   %\addtolength{\topmargin}{-17pt}
@@ -81,6 +87,8 @@ Schlegl",
 {\newcommand{\examp}[2][]{{\let\emph\uline\fontfamily{ptm}\selectfont##2}##1}}%
 {\newcommand{\examp}[2][]{``##2##1''}}
 
+{\makeatletter\gdef\NAT@MLA#1{#1}\gdef\NAT@idxtxt
+{\expandafter\NAT@MLA\NAT@name\ \NAT@open\NAT@num\NAT@close}}
 \EnableCrossrefs
 \CodelineIndex
 \RecordChanges
@@ -151,6 +159,7 @@ Schlegl",
 % \DoNotIndex{\addtolength}
 % \DoNotIndex{\advance}
 % \DoNotIndex{\baselineskip}
+% \DoNotIndex{\bibpreamble,\bibpunct,\bibsep}
 % \DoNotIndex{\begin}
 % \DoNotIndex{\bfseries}
 % \DoNotIndex{\c@enumiv}
@@ -208,6 +217,7 @@ Schlegl",
 % \DoNotIndex{\listparindent}
 % \DoNotIndex{\makeenmark}
 % \DoNotIndex{\mbox}
+% \DoNotIndex{\ml@}
 % \DoNotIndex{\mlastyle@bibstylefalse}
 % \DoNotIndex{\mlastyle@bibstyletrue}
 % \DoNotIndex{\mlastyle@cite}
@@ -261,7 +271,6 @@ Schlegl",
 % \DoNotIndex{\sloppy}
 % \DoNotIndex{\space}
 % \DoNotIndex{\string}
-% \DoNotIndex{\sw@llow}
 % \DoNotIndex{\the}
 % \DoNotIndex{\thebibliography}
 % \DoNotIndex{\thepage}
@@ -614,13 +623,16 @@ Schlegl",
 % Define the surname, along with an obsolete synonym.
 %    \begin{macrocode}
 \def\surname#1{\gdef\mlastyle@surname{#1}}
-\def\mlastyle@surname{\def\sw@llow##1 {}\expandafter\sw@llow\@author}
+\def\mlastyle@surname{\def\ml@##1 ##2,##3@@{##2}%
+  \expandafter\ml@\@author, ,@@}
 \let\lastname\surname
 %    \end{macrocode}
 % \end{macro}
 % \subsection{Formatting}
 % Formatting is done if the \Lopt{mla} or \Lopt{format} option is set.
+%
 % \begin{macro}{\mlastyle@i}
+% This is the standard MLA format indent.
 %    \begin{macrocode}
   \newdimen\mlastyle@i \mlastyle@i=.5in
 %    \end{macrocode}
@@ -859,6 +871,7 @@ Schlegl",
 \fi % \ifmlastyle@format
 %    \end{macrocode}
 % \subsection{Style}
+% \begin{macro}{\bibstyle@mlastyle}
 % This first block is the beginnings of an implementation for
 % \package{natbib}.
 %    \begin{macrocode}
@@ -867,6 +880,7 @@ Schlegl",
 {\gdef\refname{Works Cited}}
 {\gdef\bibname{Works Cited}}}
 %    \end{macrocode}
+%\end{macro}
 % \begin{macro}{\cite}
 % \begin{macro}{\citealt}
 % ^^A\begin{macro}{\citepage}
@@ -998,11 +1012,16 @@ Schlegl",
 % set.
 %    \begin{macrocode}
 \else
-  \newcommand{\mlastyle@cite}[2][]{\@tempswafalse\@citex[]{#2}}
+  \ifx\@undefined\citet
+    \newcommand{\mlastyle@cite}[2][]{\@tempswafalse\@citex[]{#2}}
+    \newcommand{\citeC}[2][]{~\@tempswafalse\@citex[]{#2}}
+  \else
+    \newcommand{\mlastyle@cite}[2][]{\citep[]{#2}}
+    \def\citeC{ \citep}
+  \fi
   \let\cite\mlastyle@cite
   \let\citepage\mlastyle@cite
   \let\citeindirect\mlastyle@cite
-  \newcommand{\citeC}[2][]{~\@tempswafalse\@citex[]{#2}}
   \let\citeM\mlastyle@relax
   \let\citepageM\mlastyle@relax
   \let\citeindirectM\mlastyle@relax