%  ALLOW INTRODUCTION TO BIBLIOGRAPHY

\makeatletter

\newcommand{\bibintro}[1]{%
\let\@origthebib=\thebibliography
\let\@origlist=\list
\def\thebibliography{\def\list{#1\par\bigskip\@origlist}\@origthebib}%
}

\makeatother

%  FACILITATE HYPHEN IN PAGE RANGES, e.g., see FulghamCS1991

\newcommand{\hyphen}{-}

%  NOTING CHANGES IN CITATION KEYS OR SOURCE UPDATES

\newcommand{\changedsrc}[2]{
  Changed #1 to #2.  \typeout{CITATION UPDATE: Changed citation #1 to #2.}}

\newcommand{\update}[2]{\typeout{CITATION UPDATE: Newer version of #1 is #2.}}

%  INLINE CITATION

% maybe later have an argument plain, open, etc. and act accordingly.
\newcommand{\inlineciteclosed}
  {\ifx\newblock\undefined\newcommand{\newblock}{\hskip .11em plus .33em minus .07em}\fi}

\inlineciteclosed

\newcommand{\incite}[1]{\input{#1}\nocite{#1}}


%I am going to take this stuff out in the hope that with LaTeX2e, it
%will work to use series and volume fields for @incollection and
%@inproceedings entries.

%%  APPLYING @INCOLLECTION TO A BOOK BELONGING TO A SERIES.

\newcommand{\volumeword}{Volume} % For plain bibliography style
% \newcommand{\volumeword}{Vol.} % For abbrv bibliography style
\newcommand{\booknuminseries}[3]{#2.
\newblock {\rm \volumeword~#1 of}#3}
\newcommand{\bookinseries}[2]{#1.
\newblock#2}
 % Above stuff used in at least one old paper, but in new papers can use series field in BibTex entry.



%  CONFERENCE HANDLING

\newcounter{oscounter}

\newcommand{\ordinal}[1]{#1\ordsuffix{#1}}
\newcommand{\ordsuffix}[1] % handles 0-13 and uses \ordsuffixrecur for >13
{\ifcase#1
%0     1     2     3     4     5     6     7     8     9
th\or st\or nd\or rd\or th\or th\or th\or th\or th\or th\or
%10   11    12    13 -- note: 11,12,13 different from 21,22,23 or 31,32,33 ...
th\or th\or th\or th\else\setcounter{oscounter}{#1}\ordsuffixrecur\fi}
% Actually this code will fail for numbers over 100 such as 111, 213, etc.
\newcommand{\ordsuffixrecur}
{\addtocounter{oscounter}{-10}\ifcase\value{oscounter}%
%0     1     2     3     4     5     6     7     8     9
th\or st\or nd\or rd\or th\or th\or th\or th\or th\or th\else
\ordsuffixrecur\fi}

\newcommand{\allerton}[1]
  {Proceedings of the \ordinal{#1} Annual Allerton Conference on
    Communication, Control, and Computing}

\newcommand{\balisage}[1]
  {Proceedings of {Balisage}: {The} Markup Conference #1}

\newcommand{\dac}[1]
  {Proceedings of the \ordinal{#1} ACM/IEEE Design Automation Conference}

\newcommand{\focs}[1]
  {Proceedings of the \ordinal{#1} Annual Symposium on Foundations of
Computer Science}

\newcommand{\iccad}[1]
  {Proceedings of the IEEE International Conference on Computer-Aided
Design (ICCAD-#1)}

\newcommand{\icpp}[1]
  {Proceedings of the #1 International Conference on Parallel Processing}

\newcommand{\ipps}[1]
  {Proceedings of the \ordinal{#1} International Parallel Processing
Symposium}

\newcommand{\isca}[1]
  {Proceedings of the \ordinal{#1} Annual International Symposium on
    Computer Architecture}

\newcommand{\iticse}[1]
  {Proceedings of the \ordinal{#1} Annual {SIGCSE} Conference on Innovation and Technology in Computer Science Education}

\newcommand{\mfcs}[1]
  {\ordinal{#1} International Symposium on Mathematical Foundations of Computer Science}

\newcommand{\podc}[1]
  {Proceedings of the \ordinal{#1} {ACM} Symposium on Principles of
    Distributed Computing}

\newcommand{\rie}[1]
  {Proceedings of the \ordinal{#1} International Conference on Robotics in Education}

\newcommand{\sigcse}[1]
    {{SIGCSE '#1}}

\newcommand{\soda}[1]
    {Proceedings of the \ordinal{#1} Annual {\ifnum#1>3{ACM}\fi}{SIAM}
Symposium on Discrete Algorithms}

\newcommand{\spaa}[1]
    {Proceedings of the
     \ifcase#1\or 1989 \else{\ordinal{#1} Annual }\fi
     {ACM} Symposium on Parallel Algorithms and Architectures}

\newcommand{\stacs}[1]
    {Proceedings of the \ordinal{#1} Annual Symposium on Theoretical Aspects of Computer Science}

\newcommand{\stoc}[1]
    {Proceedings of the \ordinal{#1} {ACM} Symposium on Theory of Computing}

\newcommand{\swat}[1]
    {Proceedings of the \ordinal{#1} Scandinavian Workshop on Algorithm Theory}
