% Modified by MFJ to add HP Labe
% File: dimacsmodules.sty adapted from dimacspub5.sty by Sarah
%         Donnelly for use as cover for Modules series.
% File:  dimacspub.sty
% Adapted from Author:  Dana S. Nau, nau@mimsy.umd.edu, July 22, 1988.
%
% Modified by Martin Farach, farach@dimacs.rutgers.edu, on August 3rd,
% 1993 to include the DIMACS logo produced by Mick Trick,
% trick@dimacs.rutgers.edu. %
%
% Adapted By Steve Mahaney, Aug 13, 1994 for publicity
%
% modified by Xiaodong Sun for new postscript figure inclusion
% July 1997
%
% modified by Sarah Donnelly to include the phrase ``for information
% on visiting...''
%
% This file defines some LaTeX commands to use in writing publicty flyers.
% Flyers written using these commands will be
% printed with a DIMACS letterhead incorporating a DIMACS logo.
% Information on how to use these commands appears in the file
% ???

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Commands to be invoked by the user.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\include{epsf}  %for pictures


% Specify whether or not to spread out the text on the page.  By default
% this is not done, because it causes problems with multi-page flyers.
\newcommand{\spreadout}{\renewcommand{\dimacsSpreadOut}{yes}}
\newcommand{\nospreadout}{\renewcommand{\dimacsSpreadOut}{}}

% Print the pages as a publicity flyer.
\newenvironment{publicity}[1]{
    \publicityhead
%   \ifx\dimacsNull\dimacsSpreadOut \else \vfill \fi
}{
%\vfill
\begin{center}
\vspace{4pt}
{\small DIMACS Center, CoRE Bldg., Rutgers University, 96 Frelinghuysen Road,
Piscataway, NJ 08854-8018}\\

TEL: 732-445-5928 $\bullet$ FAX: 732-445-5932 $\bullet$
EMAIL: {\tt center@dimacs.rutgers.edu}\\
Web: {\tt http://dimacs.rutgers.edu/}\\

\vspace{.1in}
{\scriptsize \em Founded as a National Science Foundation Science and Technology Center
and a Joint Project of Rutgers University,\\
%\vspace{-.08in}
Princeton University, AT\&T Labs - Research, Bell Labs, NEC Laboratories America and Telcordia Technologies\\[-.06in] 
with affiliated members Avaya Labs, HP Labs, IBM Research, Microsoft Research. }
\end{center}
}

%
%\newdimen\longindentation
%\longindentation=.5\textwidth
%\newdimen\indentedwidth
%\indentedwidth=\textwidth
%\advance\indentedwidth -\longindentation
% New stuff here
%
\def\smallrm{\scriptsize}
\def\smallbf{\tiny\bf}
%
%
\def\dimacs{{\shortstack[l]{
{\Huge \bf DIMACS}\\
%[7.9mm]
\it{Center for Discrete Mathematics \&}\\
\it{Theoretical Computer Science}
%\it{\hspace{-.03mm}A National Science Foundation Science and Technology
%Center}
}}}
%

% borrowed from DF sample.tex
\newcommand{\postscript}[2]
{\setlength{\epsfxsize}{#2\hsize}
{\epsfbox{#1}}}

\def\psfig{}
\def\dimacslogops{{\postscript{sdimacs_logo.ps}{0.131}}}
%



\newcommand{\dimacslogo}{
\begin{picture}(468,62)
%\put(275,0)\dimadd
\put(00,00)\dimacs  % Words "DIMACS" etc.
\put(403,0)\dimacslogops  % The grid logo
%\put(390,-40)\@date
\end{picture}\\[25pt]
}

%Specify whether or not the words `PLEASE POST' appeared on top of the
%page. Use \dimacsPost if you want these words.

\newcommand{\dimacsPost}{\newcommand{\dimacsPostFlag}{yes}}

% Generate a publicityhead, using the various items of information
\newcommand{\publicityhead}{
    \clearpage\setcounter{page}{1}\thispagestyle{empty}
    \hspace{-.5in}
    \vspace{-.9551in}
    \ifx\dimacsNull\dimacsPostFlag
    \vspace{-12pt}
    \begin{center} {\tt \phantom{PLEASE POST}} \end{center}
    \else
    \begin{center} {\tt PLEASE POST} \end{center}
    \fi
    \vspace{0.205in}
    \vspace{15pt}
    \dimacslogo
    \vspace{-.4in}
}

%%%%%%%%%%%%%%%%%%%%
% INTERNAL COMMANDS.
%%%%%%%%%%%%%%%%%%%%

\setlength{\oddsidemargin}{.05in}
\setlength{\evensidemargin}{.05in}
\setlength{\textheight}{9.32in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-.565in}
\setlength{\parindent}{0.4in}

\newlength{\dimacsArgWidth}
\newcommand{\dimacsFax}{(732) 932-5932}
\newcommand{\dimacsInternet}{center@dimacs.rutgers.edu}
\newcommand{\dimacsPhone}{(732) 445-5928}
\newcommand{\dimacsSpreadOut}{}

%\footheight 1.5cm \footskip 1cm


\def\dimacsFivePt{\@setsize\dimacsFivePt{6pt}\vpt\@vpt}
\def\dimacsTenPt{\@setsize\dimacsTenPt{12pt}\xpt\@xpt}
\def\dimacsTwentyFivePt{\@setsize\dimacsTwentyFivePt{30pt}\xxvpt\@xxvpt}

% Print arg 1, flushleft, if it is non-null.
\newcommand{\dimacsLeftJustify}[1]{
    \ifx\dimacsNull#1 \else
        \begin{flushleft}
        #1
        \end{flushleft}
    \fi
}

% Print arg 2 and arg 3 in separate columns, if arg 3 is non-null.
% Make the first column the width of arg 1.
\newcommand{\dimacsTwoColumn}[3]{
    \ifx\dimacsNull#3 \else
        \settowidth{\dimacsArgWidth}{#1}
        \setlength{\dimacsArgWidth}{-\dimacsArgWidth}
        \addtolength{\dimacsArgWidth}{\textwidth}
        \begin{tabbing}
        #1 \= \kill
        #2 \> \parbox[t]{\dimacsArgWidth}{\raggedright #3}
        \end{tabbing}
    \fi
}

%\input{psfig}

% to add dot lines for sections in toc
\renewcommand\l@section[2]{%
  \ifnum \c@tocdepth >\z@
    \addpenalty\@secpenalty
    \addvspace{1.0em \@plus\p@}%
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode {\bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1}\nobreak\ 
      \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
     \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
    \endgroup
  \fi}
