%\filename{bibmacros.tex}
%\edited{last by stolfi on Sat Mar  7 00:53:49 1987}

% Macros for the catalog of computational geometry papers

% TO DO:
%
%   Change to multiple \auth{} lines?

\input /home/staff/stolfi/tex/su/geomacros
\input /home/staff/stolfi/tex/su/searchmacros

\loadfonts{sc}
\loadfonts{ss}

\catcode`@=11 \endlinechar=-1

% Paragraph dimensions

  \pagewidth=420pt

  \textwidth=420pt
  \textheight=620pt

  \parindent=0pt
  \hfuzz=5pt
  \leftglue=0pt

  {\bigTXrmfont % big size roman text font
   \global\bigparsep=0.5ex plus 0.2ex} % Was 0.85 ex

  {\norTXrmfont % normal size roman text font
   \global\normalparsep=0.5ex plus 0.2ex} % Was 0.85 ex

  {\smaTXrmfont % small size roman text font
   \global\smallparsep=0.75ex plus 0.2ex} % Was 0.85 ex

  \hsize\textwidth
  \vsize\textheight
  \normalsize\rm

% Format options:

\newif\ifbibcrunch   \bibcrunchfalse   % use "Crunched" entry format
\newif\ifbibremarks  \bibremarksfalse  % print review comments.
\newif\ifbibtopics   \bibtopicsfalse   % print keyword list.
\newif\ifbibdate     \bibdatefalse     % print last edit date of entries.
\newif\ifbibnumorder \bibnumorderfalse % hint that entries are sorted by tag. 

% Format for "key" part of author's name:

  \catcode`\<=\active
%  \def<#1>{{$\la\hbox{#1}\ra$}}  % Change to \sc someday?
  \def<#1>{{#1}}
  
% Format for tags in text:

  \def\r[#1]{[{#1}]}

% This macro defines how the tag at the upper left corner
% of each entry should be printed:

  \def\tagformat#1{{\normalsize\rm[{\ss #1}]}}

% Gobble up new entry:

  \def\ref\r[#1]{\gdef\bibtag{#1}}

  \def\date#1{\gdef\bibdate{#1}}

  \def\moddate{} % for compatibility

% Begin typesetting the entry (called by \auth

  \newdimen\refindent

  \newcount\pubcount \pubcount=0

  \def\beginref{
    \message{ \bibtag}\message{...}
    \ifbibnumorder\expandafter\secbreak\bibtag;\fi
    \par\penalty-400\vskip0pt plus3pt
    \vskip \refvglue 
    \setbox0\hbox{\tagformat{\bibtag}\quad}\leftglue=\wd0
    \hfuzz=10pt
    \hmode
    \hbox to 0pt{\hss\box0}%
    \begingroup
      \let\par=\relax      % ignore blank lines between fields
      \def\ref{\endref\ref}% in case \endref is missing.
  }

  \def\endref{\ifbibdate \par\smallsize\ti\bibdate \fi
    \par\endgroup
  }

% Author line (also typesets the tag)

  \def\auth#1{\beginref{\rm #1:}}

% Title

  \def\tit#1{\unskip
    \ifbibcrunch{\quad}\hbreak\suggested\else\vadjust{\vskip 0.3ex}\brk\fi
    {\bf #1}
  }

% Publication

  \def\pubno{[\number\pubcount] }
  \def\pubit#1{{\rm[#1]}}

  \def\pub#1{
    \ifbibcrunch
      { }\hbreak\suggested
    \else
      \ifnum\pubcount>0
        { }\hbreak\suggested
      \else
        \unskip\vadjust{\vskip 0.3ex}\brk
      \fi
    \fi
    \advance\pubcount by 1{\rm #1}
  }

  % ``missing'' mark
  
  \def\missing{{\bigsize $\bullet$} } 

% Remarks

  \long\def\rem#1{
    \ifbibremarks
      {
        \endgraf\vskip0.5ex
        \let\par=\endgraf
        \advance\leftglue by 15pt \advance\rightglue by 15pt
        {\smallsize\rm #1\par}
      }
    \fi
  }

% Topics (keywords)

  \def\top#1{
    \ifbibtopics
      \endgraf\vskip 0.5ex
      {{\rm Topics:} #1\endgraf}
    \fi
  }

% Checks for section change

  \def\curseca{.}\def\cursecb{.}
  \newif\ifnewsec

  \def\secbreak#1#2{\newsecfalse
    \if\curseca #1 \else\newsectrue\fi
    \if\cursecb #2 \else\newsectrue\fi
    \ifnewsec 
      \gdef\curseca{#1}\gdef\cursecb{#2}
      \suction{\curseca\cursecb}
    \fi
    \globbb
  } 

  \def\globbb#1;{}

% Start new section

  \def\suction#1{\par
    % \vfill\eject
    \message{ [Section #1]}
    % \framebox
    %  {\hbox to 427 pt
    %    {\hfil
    %     \framebox{\hbox{\hskip 1pt #1\hskip 1pt}}}}
    % \penalty 1000\vskip 10pt plus 3pt
    }

% HACK:::

\def\next{}

\catcode`@=12 \endlinechar=`\^^M

% END
