| 1 |
% apalike.sty style, used in conjunction with apalike.bst, |
| 2 |
% will produce an apa-like bibliography style. |
| 3 |
% |
| 4 |
% Copyright (C) 1986, 1987, 2010 Oren Patashnik. |
| 5 |
% Unlimited copying and redistribution of this file are permitted as long as |
| 6 |
% it is unmodified. Modifications (and redistribution of modified versions) |
| 7 |
% are also permitted, but only if the resulting file is renamed. |
| 8 |
% |
| 9 |
% 1) Bibliography entries formatted alphabetically, last name |
| 10 |
% first, each entry having a hanging indentation and no label. |
| 11 |
% 2) References in the following formats: |
| 12 |
% (Author, 1986) |
| 13 |
% (Author and Author, 1986) |
| 14 |
% (Author et al., 1986). |
| 15 |
% 3) Multiple references in the form (Author1, 1986; Author2, 1987) |
| 16 |
% |
| 17 |
% To be used as an optional argument to the \documentstyle command; for example |
| 18 |
% \documentstyle[11pt,apalike]{book} |
| 19 |
% |
| 20 |
% History: |
| 21 |
% 16-Sep-86, original version by Oren Patashnik, ideas from Susan King. |
| 22 |
% 13-Oct-87 changes: |
| 23 |
% Fixed bug in last line by adding the {} that disappeard when |
| 24 |
% the \hbox{} was removed from the pre-APALIKE definition; |
| 25 |
% added club and widow penalties; |
| 26 |
% patched the \newblock LaTeX bug from `-.07em' to simply `.07em'; |
| 27 |
% and made this work for document styles that don't define `chapter'. |
| 28 |
% Undated changes by Karl Berry and/or Oren Patashnik: |
| 29 |
% 1) use \refname and \bibname instead of hardwiring |
| 30 |
% the strings "References" and "Bibliography"; this change was first |
| 31 |
% made in the apalike.sty in the germbib package. |
| 32 |
% 2) do not define \bibhang if it is already defined. |
| 33 |
% Karl Berry contributes his changes to the public domain. |
| 34 |
% 8-Dec-10, clarify license. |
| 35 |
|
| 36 |
% Use parens instead of brackets for \cite, and no label in the bibliography |
| 37 |
% |
| 38 |
\def\@cite#1#2{(#1\if@tempswa , #2\fi)} |
| 39 |
\def\@biblabel#1{} |
| 40 |
|
| 41 |
% Set length of hanging indentation for bibliography entries |
| 42 |
% |
| 43 |
\ifx\bibhang\@thisisundefined \newlength{\bibhang} \fi |
| 44 |
\setlength{\bibhang}{2em} |
| 45 |
|
| 46 |
% \thebibliography environment depends on whether or not `chapter's can exist |
| 47 |
% |
| 48 |
\@ifundefined{chapter}{\def\thebibliography#1{\section*{\refname\@mkboth |
| 49 |
{\sl\uppercase{\refname}}{\sl\uppercase{\refname}}}\list |
| 50 |
{\relax}{\setlength{\labelsep}{0em} |
| 51 |
\setlength{\itemindent}{-\bibhang} |
| 52 |
\setlength{\leftmargin}{\bibhang}} |
| 53 |
\def\newblock{\hskip .11em plus .33em minus .07em} |
| 54 |
\sloppy\clubpenalty4000\widowpenalty4000 |
| 55 |
\sfcode`\.=1000\relax}}% |
| 56 |
{\def\thebibliography#1{\chapter*{\bibname\@mkboth |
| 57 |
{\sl\uppercase{\bibname}}{\sl\uppercase{\bibname}}}\list |
| 58 |
{\relax}{\setlength{\labelsep}{0em} |
| 59 |
\setlength{\itemindent}{-\bibhang} |
| 60 |
\setlength{\leftmargin}{\bibhang}} |
| 61 |
\def\newblock{\hskip .11em plus .33em minus .07em} |
| 62 |
\sloppy\clubpenalty4000\widowpenalty4000 |
| 63 |
\sfcode`\.=1000\relax}} |
| 64 |
|
| 65 |
% `; ' goes between cites, and there's no \hbox around individual cites |
| 66 |
% |
| 67 |
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi |
| 68 |
\def\@citea{}\@cite{\@for\@citeb:=#2\do |
| 69 |
{\@citea\def\@citea{; }\@ifundefined |
| 70 |
{b@\@citeb}{{\bf ?}\@warning |
| 71 |
{Citation `\@citeb' on page \thepage \space undefined}}% |
| 72 |
{\csname b@\@citeb\endcsname}}}{#1}} |