%standard reference formatting macros (plain TeX)
%flag, author, title, etc., volume, pages, date, gov't no., other
%citation flag is superscript
%
%note: remove characters (%%%) from lines below (6 times)
%%%            \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
%if titles desired in loc. cit.

\def\Flagstyle#1{\hangindent\parindent\indent\hbox to0pt{\hss\raise1ex\hbox{\Flagfont#1}\kern.5em}}%flag style

\def\journalarticleformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\egroup, \fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }\fi%
       \if\Ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
        \if\etest\present\if\Ttest\present{"}\fi\hskip.2em(\bgroup\estr\egroup)\def\Comma{\unskip, }\fi%
         \if\Jtest\present\Comma\bgroup\Tomefont\Jstr\/\egroup\def\Comma{, }\fi%
          \if\Vtest\present\if\Jtest\present\hskip.2em\else\Comma\fi\bgroup\Volfont\Vstr\egroup\def\Comma{, }\fi%
           \if\Dtest\present\hskip.2em(\bgroup\Dstr\egroup)\def\Comma{, }\fi%
            \if\Ptest\present\bgroup, \Pstr\egroup\def\Comma{, }\fi%
             \if\ttest\present\Comma\bgroup``\Titlefont\tstr\egroup\def\Comma{," }\fi%
              \if\jtest\present\Comma\bgroup\Tomefont\jstr\/\egroup\def\Comma{, }\fi%
               \if\vtest\present\if\jtest\present\hskip.2em\else\Comma\fi\bgroup\Volfont\vstr\egroup\def\Comma{, }\fi%
                \if\dtest\present\hskip.2em(\bgroup\dstr\egroup)\def\Comma{, }\fi%
                 \if\ptest\present\bgroup, \pstr\egroup\def\Comma{, }\fi%
                  \if\Gtest\present{\Comma Gov't ordering no. }\bgroup\Gstr\egroup\def\Comma{, }\fi%
                   \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
                    \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}

\def\conferencereportformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\egroup, \fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }\fi%
       \if\Ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
        \if\Jtest\present\Comma\bgroup\Tomefont\Jstr\/\egroup\def\Comma{, }\fi%
         \if\Ctest\present\Comma\bgroup\Cstr\egroup\def\Comma{, }\fi%
          \if\Dtest\present\hskip.2em(\bgroup\Dstr\egroup)\def\Comma{, }\fi%
           \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
            \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}

\def\bookarticleformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\egroup, \fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }\fi%
       \if\Ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
        \if\etest\present\if\Ttest\present"\fi\hskip.2em(\bgroup\estr\egroup)\def\Comma{\unskip, }\fi%
         \if\Btest\present\Comma in \bgroup\Tomefont\Bstr\/\egroup\def\Comma{\unskip, }\fi%
          \if\otest\present\ \bgroup\ostr\egroup\def\Comma{, }\fi%
           \if\Etest\present\Comma\bgroup\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi\def\Comma{, }\fi%
            \if\Stest\present\Comma\bgroup\Sstr\egroup\def\Comma{, }\fi%
             \if\Vtest\present\bgroup\hskip.2em\#\Volfont\Vstr\egroup\def\Comma{, }\fi%
              \if\Ntest\present\bgroup\hskip.2em\#\Volfont\Nstr\egroup\def\Comma{, }\fi%
               \if\Itest\present\Comma\bgroup\Istr\egroup\def\Comma{, }\fi%
                \if\Ctest\present\Comma\bgroup\Cstr\egroup\def\Comma{, }\fi%
                 \if\Dtest\present\Comma\bgroup\Dstr\egroup\def\Comma{, }\fi%
                  \if\Ptest\present\Comma\Pstr\def\Comma{, }\fi%
                   \if\ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
                    \if\btest\present\Comma in \bgroup\Tomefont\bstr\egroup\def\Comma{, }\fi%
                     \if\atest\present\Comma\bgroup\astr\egroup\unskip, \if\acnt\present eds.\else ed.\fi\def\Comma{, }\fi%
                      \if\stest\present\Comma\bgroup\sstr\egroup\def\Comma{, }\fi%
                       \if\vtest\present\bgroup\hskip.2em\#\Volfont\vstr\egroup\def\Comma{, }\fi%
                        \if\ntest\present\bgroup\hskip.2em\#\Volfont\nstr\egroup\def\Comma{, }\fi%
                       \if\itest\present\Comma\bgroup\istr\egroup\def\Comma{, }\fi%
                        \if\ctest\present\Comma\bgroup\cstr\egroup\def\Comma{, }\fi%
                         \if\dtest\present\Comma\bgroup\dstr\egroup\def\Comma{, }\fi%
                          \if\ptest\present\Comma\pstr\def\Comma{, }\fi%
                           \if\Gtest\present{\Comma Gov't ordering no. }\bgroup\Gstr\egroup\def\Comma{, }\fi%
                            \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
                             \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}

\def\bookformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\egroup, %
               \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi, %
                     \else\if\Itest\present\bgroup\Authfont\Istr\egroup, \fi\fi\fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }%
           \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi\def\Comma{, }%
                 \else\if\Itest\present\bgroup\Authfont\Istr\egroup\def\Comma{, }\fi\fi\fi%
         \if\Ttest\present\Comma\bgroup\Tomefont\Tstr\/\egroup\def\Comma{\unskip, }%
               \else\if\Btest\present\Comma\bgroup\Tomefont\Bstr\/\egroup\def\Comma{\unskip, }\fi\fi%
           \if\otest\present\ \bgroup\ostr\egroup\def\Comma{, }\fi%
            \if\etest\present\hskip.2em(\bgroup\estr\egroup)\def\Comma{\unskip, }\fi%
             \if\Stest\present\Comma\bgroup\Sstr\egroup\def\Comma{, }\fi%
              \if\Vtest\present\bgroup\hskip.2em\#\Volfont\Vstr\egroup\def\Comma{, }\fi%
               \if\Ntest\present\bgroup\hskip.2em\#\Volfont\Nstr\egroup\def\Comma{, }\fi%
                \if\Atest\present\if\Itest\present
                        \Comma\bgroup\Istr\egroup\def\Comma{\unskip, }\fi%
                     \else\if\Etest\present\if\Itest\present
                             \Comma\bgroup\Istr\egroup\def\Comma{\unskip, }\fi\fi\fi%
                    \if\Ctest\present\Comma\bgroup\Cstr\egroup\def\Comma{, }\fi%
                     \if\Dtest\present\Comma\bgroup\Dstr\egroup\def\Comma{, }\fi%
                      \if\ttest\present\Comma\bgroup\Tomefont\tstr\egroup\def\Comma{, }%
                            \else\if\btest\present\Comma\bgroup\Tomefont\bstr\egroup\def\Comma{, }\fi\fi%
                         \if\stest\present\Comma\bgroup\sstr\egroup\def\Comma{, }\fi%
                          \if\vtest\present\bgroup\hskip.2em\#\Volfont\vstr\egroup\def\Comma{, }\fi%
                           \if\ntest\present\bgroup\hskip.2em\#\Volfont\nstr\egroup\def\Comma{, }\fi%
                            \if\itest\present\Comma\bgroup\istr\egroup\def\Comma{, }\fi%
                             \if\ctest\present\Comma\bgroup\cstr\egroup\def\Comma{, }\fi%
                              \if\dtest\present\Comma\bgroup\dstr\egroup\def\Comma{, }\fi%
                               \if\Gtest\present{\Comma Gov't ordering no. }\bgroup\Gstr\egroup\def\Comma{, }\fi%
                                \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
                                 \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}

\def\technicalreportformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\egroup, %
               \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi, %
                     \else\if\Itest\present\bgroup\Authfont\Istr\egroup, \fi\fi\fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }%
           \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi\def\Comma{, }%
                 \else\if\Itest\present\bgroup\Authfont\Istr\egroup\def\Comma{, }\fi\fi\fi%
         \if\Ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
          \if\Atest\present\if\Itest\present
                  \Comma\bgroup\Istr\egroup\def\Comma{, }\fi%
               \else\if\Etest\present\if\Itest\present
                       \Comma\bgroup\Istr\egroup\def\Comma{, }\fi\fi\fi%
           \if\Rtest\present\Comma\bgroup\Rstr\egroup\def\Comma{, }\fi%
            \if\Ctest\present\Comma\bgroup\Cstr\egroup\def\Comma{, }\fi%
             \if\Dtest\present\Comma\bgroup\Dstr\egroup\def\Comma{, }\fi%
              \if\ttest\present\Comma\bgroup``\Titlefont\tstr\egroup\def\Comma{," }\fi%
               \if\itest\present\Comma\bgroup\istr\egroup\def\Comma{, }\fi%
                \if\rtest\present\Comma\bgroup\rstr\egroup\def\Comma{, }\fi%
                 \if\ctest\present\Comma\bgroup\cstr\egroup\def\Comma{, }\fi%
                  \if\dtest\present\Comma\bgroup\dstr\egroup\def\Comma{, }\fi%
                   \if\Gtest\present{\Comma Gov't ordering no. }\bgroup\Gstr\egroup\def\Comma{, }\fi%
                    \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
                     \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}

\def\otherformat{\footnote{}{\Reffont\let\uchyph=1\parindent=0pt\def\Comma{}%
               \sfcode`\.=1000\sfcode`\?=1000\sfcode`\!=1000\sfcode`\:=1000\sfcode`\;=1000\sfcode`\,=1000%\frenchspacing
     \if\Ftest\present\Flagstyle\Fstr\fi%
         \if\Loccittest\present\if\Ibidtest\present{\it ibid.}\else%
          \if\Atest\present\bgroup\Authfont\Astr\, egroup%
               \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi, %
                     \else\if\Itest\present\bgroup\Authfont\Istr\egroup, \fi\fi\fi%
%%%           \if\Ttest\present\bgroup``\Titlefont\Tstr\egroup," \fi%
             {\it loc.\ cit.}\fi%
           \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip.\fi\else%
      \if\Atest\present\bgroup\Authfont\Astr\egroup\def\Comma{\unskip, }%
           \else\if\Etest\present\bgroup\def\Eand{\Aand}\def\Eandd{\Aandd}\Authfont\Estr\egroup\unskip, \ifnum\Ecnt>1eds.\else ed.\fi\def\Comma{, }%
                 \else\if\Itest\present\bgroup\authfont\Istr\egroup\def\Comma{, }\fi\fi\fi%
         \if\Ttest\present\Comma\bgroup``\Titlefont\Tstr\egroup\def\Comma{," }\fi%
           \if\Atest\present\if\Itest\present
                   \Comma\bgroup\Istr\egroup\def\Comma{, }\fi%
                \else\if\Etest\present\if\Itest\present
                        \Comma\bgroup\Istr\egroup\def\Comma{, }\fi\fi\fi%
                \if\Ctest\present\Comma\bgroup\Cstr\egroup\def\Comma{, }\fi%
                 \if\Dtest\present\Comma\bgroup\Dstr\egroup\def\Comma{, }\fi%
                  \if\Gtest\present{\Comma Gov't ordering no. }\bgroup\Gstr\egroup\def\Comma{, }\fi%
                   \if\Otest\present\Comma\bgroup\Ostr\egroup\fi%
                    \if\Ztest\present\bgroup\ignorespaces\Zstr\egroup\gdef\Ztest{}\unskip\fi.\fi}}