% Latex `lsalike' bibliography style (06-Jan-94 version 1.0alpha),
% This file implements citations for the ``lsalike'' bibliography style.
% It derives originally from `named', modified by a lot of people
% including someone at AAAI and Michael Braverman.
% This current version was rewritten by Dan Jurafsky, and
% is intended to roughly follow the LSA (Linguistic Society of America)
% style sheet.

% The ``lsalike'' bibliography style (lsalike.bst) creates citations 
% with labels like
%        \citeauthoryear{author-info}{year}
% these labels are processed by the following commands:
%
%       \citeasnoun[pageno]{key}  % changed by aws
%               which produces citations with the author followed by the
%               year enclosed in parenthesis, e.g. Hemingway (1925).
%               Optional page number produces e.g. Hemingway (1925:135)
%       \cite[pageno]{key}
%               which produces citations with both author and year,
%               enclosed in parenthesis.
%               e.g. "(Barth 1968)"
%               Optional page number produces e.g. (Hemingway 1925:135)
%       \quotecite{key}
%               which produces citations with the author followed by
%               's and then the year enclosed in parenthesis.
%               e.g. "Chomsky's (1957) proposal met with little..."
%       \citeboth{key}
%               which produces citations with the author followed by the
%               name, no parenthesis.
%               e.g. "Barth 1968"
%       \citeauthor{key}
%               which produces the author information only
%               e.g. "Barth"
%       \citeyear{key}
%               which produces the year information only
%               e.g. "1947"





\newlength{\bibhang}
%\setlength{\bibhang}{2em}
\setlength{\bibhang}{1em}
% can do this to shorten bibliography
% flipped by djcm jan 95. This controls the over hang. 

\typeout{test LSAlike Bibliography and Citatn. Style -- released 06 Jan 1994}

\@ifundefined{chapter}{\def\thebibliography#1{\section*{References\@mkboth
  {REFERENCES}{REFERENCES}}\list
  {\relax}{\setlength{\labelsep}{1em}% changed 0em to 1em djcm Thu 15/8/02
% 4pt changed to 2pt  djcm
%  \itemsep 2pt plus 1pt minus 0.5pt
% then replaced the above single line by these two lines: 
%     \itemsep -2pt
%     \baselineskip 12pt plus 1pt minus 0.5pt
% Thu 15/8/02 DJCM modified itemsep... and modified baselineskip
     \itemsep 2pt
     \baselineskip 14pt plus 1pt minus 0.5pt
  \setlength{\itemindent}{-\bibhang}
        \setlength{\leftmargin}{\bibhang}}
    \def\newblock{\hskip .11em plus .33em minus .07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}}%
{\def\thebibliography#1{\chapter*{Bibliography\@mkboth
  {BIBLIOGRAPHY}{BIBLIOGRAPHY}}\addcontentsline{toc}{chapter}{Bibliography}\list
  {\relax}{\setlength{\labelsep}{0em}
% next 2 lines can be inserted to shorten bibliography 
       \itemsep 2.6pt
%        \baselineskip 12pt plus 1pt minus 0.5pt
        \setlength{\itemindent}{-\bibhang}
        \setlength{\leftmargin}{\bibhang}}
    \def\newblock{\hskip .11em plus .33em minus .07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}}

\let\@internalcite\cite

% modified by addn of commas, on frenchspacing lines DJCM 98 05
\def\xcite{\def\@citeseppen{-1000}%
 \def\@cite##1##2{(\nobreak\hskip 0in{##1\if@tempswa , ##2\fi})}%
 \def\citeauthoryear##1##2{\frenchspacing##1, ##2}\@internalcite}

\def\xpagecite[#1]#2{\def\@citeseppen{-1000}%
 \def\@cite##1##2{(\nobreak\hskip 0in{##1\if@tempswa , ##2\fi})}%
 \def\citeauthoryear##1##2{\frenchspacing##1, ##2, #1}\@internalcite{#2}}
% \def\citeauthoryear##1##2{\frenchspacing##1, ##2:#1}\@internalcite{#2}}
% changed Wed 18/6/03 djcm

\def\cite{\@ifnextchar [{\xpagecite}{\xcite}}

\def\xciteasnoun{\def\@citeseppen{1000}%
 \def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{\frenchspacing##1 (##2)}\@internalcite}

\def\quotecite{\def\@citeseppen{1000}%
 \def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{\frenchspacing##1's (##2)}\@internalcite}

\def\citeboth{\def\@citeseppen{1000}%
 \def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{\frenchspacing##1, ##2}\@internalcite}
% end DJCM changes

% \def\item{\@ifnextchar [{\@item}{\@noitemargtrue \@item[\@itemlabel]}}
\def\citeasnoun{\@ifnextchar [{\pagecite}{\xciteasnoun}}

\def\pagecite[#1]#2{\def\@citeseppen{1000}%
 \def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{\frenchspacing##1 (##2:#1)}\@internalcite{#2}}

\def\citeauthor#1{\def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{\frenchspacing##1}\@citedata{#1}}

\def\citeyear#1{\def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
 \def\citeauthoryear##1##2{##2}\@citedata{#1}}

\def\@citedata#1{\@tempswafalse%
 \if@filesw\immediate\write\@auxout{\string\citation{#1}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#1\do
    {\@citea\def\@citea{,\penalty\@citeseppen\ }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{}}

% don't box citations, separate with ; and a space
% also, make the penalty between citations negative: a good place to break
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{;\penalty\@citeseppen\ }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{#1}}

% raise the brackets in bibliography labels
\def\@biblabel#1{}

% Inverted by aws 22/8/94

% lsalike currently uses the ampersand (&) instead of the
% word "and" in author lists, and it also replaces names by dashes in one
% more situation than the journal Language.
% Both these can be returned to standard Language style by switching the comments on
% the appropriate functions for \lsadashifynew  and \lsaand below.  
% (The non-standard situation occurs for ordered examples like:
%
% Robin, Christopher and Winnie Pooh
% Robin, Christopher and Eeyore
%
% The style will currently dashify the second Christopher Robin -
% this is not standard.

%\def\lsadashify#1{---\hspace*{-2pt}---}
\def\lsadashify#1{#1}
% flipped by djcm jan 95 (and back again)

%\def\lsadashifynew#1{---\hspace*{-2pt}---}
\def\lsadashifynew#1{#1}
% flipped by djcm jan 95 (and back)

%\def\lsaand{\& }
\def\lsaand{and }


