\catcode`\@=11
\def\makebib@W{Bibliography}
\def\makebib{\begingroup\rm\bigbreak\centerline{\smc\makebib@W}%
 \nobreak\medskip
 \sfcode`\.=\@m\everypar{}\parindent\z@
 \def\nopunct{\nopunct@true}\def\nospace{\nospace@true}%
 \nopunct@false\nospace@false
 \def\lkerns@{\null\kern\m@ne sp\kern\@ne sp}%
 \def\nkerns@{\null\kern-\tw@ sp\kern\tw@ sp}%
}
\let\endmakebib\endgroup
\def\noprepunct{\noprepunct@true}
\def\noprespace{\noprespace@true}
\def\noquotes{\noquotes@true}
\def\setbibinfo@#1{\edef\next@{\ifnopunct@1\else0\fi
 \ifnospace@1\else0\fi\ifnoprepunct@1\else0\fi\ifnoprespace@1\else0\fi
 \ifnoquotes@1\else0\fi}%
 \DNii@{00000}%
 \ifx\next@\nextii@\else\xdef\bibinfo@{\bibinfo@\the#1,\next@}%
 \fi}
\def\getbibinfo@#1{\ifx\bibinfo@\empty
 \let\next@0\let\nextii@0\let\nextiii@0\let\nextiv@0\let\nextv@0\else
 \edef\next@{\def
  \noexpand\next@####1\the#1,####2####3####4####5####6####7\noexpand\next@
  {\let\noexpand\next@####2\let\noexpand\nextii@####3%
  \let\noexpand\nextiii@####4\let\noexpand\nextiv@####5%
  \let\noexpand\nextv@####6}%
  \noexpand\next@\bibinfo@\the#1,00000\noexpand\next@}\next@
 \fi}
\def\bookinquotes{\bookinquotes@true}
\def\paperinquotes{\paperinquotes@true}
\def\ininbook{\ininbook@true}
\def\closequotes@{\ifopenquotes@''\openquotes@false\fi}
\def\bib{\global\let\bibinfo@\empty\global\let\translinfo@\relax\beginbib@true
 \begingroup\noindent@
 \hangindent\bibindent@\hangafter\@ne\bib@}
\def\v@id#1{\setbox#1\box\voidb@x}
\def\bib@{\v@id\nobox@\v@id\keybox@\v@id\bybox@\v@id\paperbox@
 \v@id\paperinfobox@\v@id\jourbox@\v@id\volbox@\v@id\issuebox@
 \v@id\yrbox@\v@id\pgbox@\v@id\ppbox@\v@id\bookbox@\v@id\inbookbox@
 \v@id\bookinfobox@\v@id\publbox@\v@id\publaddrbox@\v@id\edbox@
 \v@id\edsbox@\v@id\langbox@\v@id\translbox@\v@id\finalinfobox@
 \bgroup}
\def\Setnonemptybox@#1#2{\unskip\setbibinfo@#1\egroup#2%
 \def\aftergroup@{\ifdim\wd#1=\z@\setbox#1\box\voidb@x\fi}%
 \setbox#1\vbox\bgroup\aftergroup\aftergroup@\hsize\maxdimen\leftskip\z@
 \rightskip\z@\hbadness\@M\hfuzz\maxdimen\noindent}
\def\setnonemptybox@#1{\Setnonemptybox@#1\relax}
\def\no{\setnonemptybox@\nobox@}
\def\key{\setnonemptybox@\keybox@\bf}
\def\by{\setnonemptybox@\bybox@}
\def\bysame{\setnonemptybox@\bybox@\leaders\hrule\hskip3em\null}
\def\paper{\setnonemptybox@\paperbox@
 \ifpaperinquotes@\getbibinfo@\paperbox@
 \if\nextv@1\else``\fi\else\it\fi}
\def\paperinfo{\setnonemptybox@\paperinfobox@}
\def\jour{\Setnonemptybox@\jourbox@\prevjour@true}
\def\vol{\setnonemptybox@\volbox@\bf}
\def\issue{\setnonemptybox@\issuebox@}
\def\yr{\setnonemptybox@\yrbox@}
\def\toappear{\noprepunct\finalinfo(to appear)}
\def\pg{\setnonemptybox@\pgbox@}
\def\pp{\setnonemptybox@\ppbox@}
\def\book{\Setnonemptybox@\bookbox@\prevbook@true
 \ifbookinquotes@\getbibinfo@\bookbox@
 \if\nextv@1\else``\fi\else\it\fi}
\def\inbook{\Setnonemptybox@\inbookbox@\prevbook@true
 \ifininbook@ in \fi\ifbookinquotes@\getbibinfo@\inbookbox@
 \if\nextv@1\else``\fi\fi}
\def\bookinfo{\setnonemptybox@\bookinfobox@}
\def\publ{\setnonemptybox@\publbox@}
\def\publaddr{\setnonemptybox@\publaddrbox@}
\def\ed{\setnonemptybox@\edbox@}
\def\eds{\setnonemptybox@\edsbox@}
\def\lang{\setnonemptybox@\langbox@}
\def\finalinfo{\setnonemptybox@\finalinfobox@}
\def\getbox@#1{\setbox\z@\vbox{\vskip-\@M\p@
 \unvbox#1%
 \setboxzl@
 \global\setbox\@ne\hbox{\unhbox\z@\unskip\unskip\unpenalty}%
 \ifdim\lastskip=-\@M\p@\else
 \loop\ifdim\lastskip=-\@M\p@
 \else\unskip\unpenalty\setboxzl@
 \global\setbox\@ne\hbox{\unhbox\z@\unhbox\@ne}%
 \repeat\fi}%
 \unhbox\@ne}
\def\adjustpunct@#1{\count@\lastkern
 \ifnum\count@=\z@#1\closequotes@\else
 \ifnum\count@>\tw@#1\closequotes@\else
 \ifnum\count@<-\tw@#1\closequotes@\else
  \unkern\unkern\setboxzl@
  \skip@\lastskip\unskip
  \count@@\lastpenalty\unpenalty
  \ifnum\count@=\tw@\unskip\setboxzl@\fi
  \ifdim\skip@=\z@\else\hskip\skip@\fi
  #1\closequotes@
  \ifnum\count@=\tw@\null\hfill\fi
  \penalty\count@@
 \fi\fi\fi}
\def\prepunct@#1#2{\getbibinfo@#2%
 \ifnopunct@
 \else
  \if\nextiii@0\adjustpunct@#1\fi
 \fi
 \closequotes@
 \ifnospace@
 \else
  \if\nextiv@0\space\else\fi
 \fi
 \nopunct@false\nospace@false
 \if\next@1\nopunct@true\fi
 \if\nextii@1\nospace@true\fi}
\def\ppunbox@#1#2{\prepunct@{#1}#2%
 \getbox@#2}
\def\endbib@{%
 \ifbeginbib@
  \ifvoid\nobox@
   \ifvoid\keybox@\else\hbox to\bibindent@{[\getbox@\keybox@]\hss}\fi
  \else\hbox to\bibindent@{\hss\getbox@\nobox@. }\fi
  \ifvoid\bybox@\else\getbox@\bybox@\fi
 \else
  \nopunct@true
  \ifvoid\bybox@\else\ppunbox@\relax\bybox@\fi
 \fi
 \ifvoid\translbox@\else\ppunbox@,\translbox@\fi
 \ifvoid\paperbox@\else\ppunbox@,\paperbox@\ifpaperinquotes@
  \if\nextv@1\else\openquotes@true\fi\fi
 \fi
 \ifvoid\paperinfobox@\else\ppunbox@,\paperinfobox@\fi
 \test@false
 \ifvoid\jourbox@\else\test@true\ppunbox@,\jourbox@\fi
 \ifprevjour@\test@true\fi
 \iftest@
  \ifvoid\volbox@\else\ppunbox@\relax\volbox@\fi
  \ifvoid\issuebox@
   \else\prepunct@\relax\issuebox@ no.~\getbox@\issuebox@\fi
  \ifvoid\yrbox@\else\prepunct@\relax\yrbox@(\getbox@\yrbox@)\fi
  \ifvoid\ppbox@\else\ppunbox@,\ppbox@\fi
  \ifvoid\pgbox@\else\prepunct@,\pgbox@ p.~\getbox@\pgbox@\fi
 \fi
 \test@false
 \ifvoid\bookbox@\else\test@true\ppunbox@,\bookbox@\ifbookinquotes@
  \if\nextv@1\else\openquotes@true\fi\fi\fi
 \ifvoid\inbookbox@\else\test@true\ppunbox@,\inbookbox@\ifbookinquotes@
  \if\nextv@1\else\openquotes@true\fi\fi\fi
 \ifprevbook@\test@true\fi
 \iftest@
  \ifvoid\edbox@\else\prepunct@\relax\edbox@(\getbox@\edbox@, ed.)\fi
  \ifvoid\edsbox@\else\prepunct@\relax\edsbox@(\getbox@\edsbox@, eds.)\fi
  \ifvoid\bookinfobox@\else\ppunbox@,\bookinfobox@\fi
  \ifvoid\publbox@\else\ppunbox@,\publbox@\fi
  \ifvoid\publaddrbox@\else\ppunbox@,\publaddrbox@\fi
  \ifvoid\yrbox@\else\ppunbox@,\yrbox@\fi
  \ifvoid\ppbox@\else\prepunct@,\ppbox@ pp.~\getbox@\ppbox@\fi
  \ifvoid\pgbox@\else\prepunct@,\pgbox@ p.~\getbox@\pgbox@\fi
 \fi
 \ifvoid\finalinfobox@
  \ifendbib@
   \ifnopunct@\else.\closequotes@\fi
  \else
  \ifvoid\langbox@\else\space(\getbox@\langbox@)\fi
   \/\semicolon@\closequotes@
  \fi
 \else
  \ifendbib@
   \ppunbox@{.\spacefactor3000\relax}\finalinfobox@
    \ifnopunct@\else.\fi
  \else
   \ppunbox@,\finalinfobox@\/\semicolon@\fi
 \fi
 \ifvoid\langbox@\else\space(\getbox@\langbox@)\fi
}
\def\endbib{\unskip\egroup\endbib@true\endbib@\par\endgroup}
\def\morebib{\unskip\egroup
 \endbib@false\endbib@
 \global\let\bibinfo@\empty\beginbib@false
 \bib@}
\def\anotherbib{\unskip\egroup
 \endbib@false\endbib@
 \global\let\bibinfo@\empty\beginbib@false
 \prevjour@false\prevbook@false\bib@}
\def\transl{\unskip
 \xdef\translinfo@{\the\translbox@,\ifnopunct@1\else0\fi
 \ifnospace@1\else0\fi\ifnoprepunct@1\else0\fi\ifnoprespace@1\else0\fi0}%
 \egroup\endbib@false\endbib@
 \global\let\bibinfo@\translinfo@\beginbib@false
 \bib@
 \egroup
 \def\aftergroup@{\ifdim\wd\translbox@=\z@\setbox\translbox@\box\voidb@x\fi}%
 \setbox\translbox@\vbox\bgroup\aftergroup\aftergroup@
 \hsize\maxdimen\leftskip\z@\rightskip\z@\hbadness\@M\hfuzz\maxdimen
 \noindent}
\catcode`\@=\active
