%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  Style file for the B physics at the Tevatron workshop report  %%%
%%%  Send comments to zligeti@lbl.gov --- last modified: 11/18/01  %%%
%%%  Everything used below are standard LaTeX2e packages           %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\usepackage{epsfig}
\usepackage{fancyheadings}
\usepackage{makeidx}
%%\usepackage{side}  %% landscape tables and figures - not in latex2e

\usepackage[nospace]{cite}
\usepackage[sectionbib]{chapterbib}
\renewcommand\bibname{References}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define page layouts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% latex defaults are (5, 7.4, 0.25, 1.25)
\setlength{\textwidth}{6in}
\setlength{\textheight}{8.5in}
\setlength{\oddsidemargin}{.5in}
\setlength{\evensidemargin}{0in}
\setlength{\topmargin}{-.2in}
\setlength{\headsep}{26pt}
\setlength{\footskip}{34pt}

\renewcommand\footnoterule{%
  \kern6\p@ 				%% book.cls defaults are -3pt
  \hrule\@width.25\columnwidth		%% and .4\columnwidth
  \kern2.6\p@}

\arraycolsep 2pt
\tabcolsep 2pt
\parskip = 6pt plus 1pt minus 1pt
%%\parskip = 8pt
%%\parindent=0pt

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\renewcommand{\arraystretch}{1.25}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define header and footer structures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancyplain}
\addtolength{\headheight}{1.6pt}
\lhead[\fancyplain{}{\bf\thepage}]%
      {\fancyplain{}{\small\bf\rightmark}}
\rhead[\fancyplain{}{\small\bf\leftmark}]%
      {\fancyplain{}{\bf\thepage}}
\cfoot[\fancyplain{\bf\thepage}{}]%
      {\fancyplain{\bf\thepage}{}}
\lfoot[\fancyplain{}
      {\mbox{\sc\small {\epsfxsize 0.35cm \epsffile{fnal.ps}}~
		Report of the $B$ Physics at the Tevatron Workshop}}]%
      {\fancyplain{}{}}
\rfoot[\fancyplain{}{}]%
      {\fancyplain{}{\mbox{\sc\small 
		Report of the $B$ Physics at the Tevatron Workshop
		~{\epsfxsize 0.35cm \epsffile{fnal.ps}}}}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Alter chapter headings a bit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\@makechapterhead#1{%
%%  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
%%        \vskip 20\p@
\hbox to\hsize{\leaders\hrule height 3pt\hfil}
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}

\def\@makeschapterhead#1{%
  \vspace*{28\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Alter section headings and make appendices look like sections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\sectionrule#1{$\setbox\z@\hbox{#1}\dp\z@\z@
  \m@th \vbox{ \hbox{\box\z@} \vspace*{-10pt}
  \hbox to\hsize{\leaders\hrule height .8pt\hfil} } $}

%%\renewcommand\section{\@startsection {section}{1}{\z@}%
%%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
%%                                   {2.3ex \@plus.2ex }%
%%                                   {\normalfont\Large\bfseries \sectionrule} }


%% appendix def from article.cls, so that it's section level and not chapter
\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \renewcommand\thesection{\@Alph\c@section}}

\newcommand\appendixend{
	\renewcommand \thesection {\thechapter.\@arabic\c@section}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Alter figure and table captions  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength\abovecaptionskip{0\p@}  %% default is 10pt

\long\def\@makecaption#1#2{%
  \addtolength{\hsize}{-1in}
    \vskip\abovecaptionskip
    \sbox\@tempboxa{\small {\bf #1:} #2}%
  \ifdim \wd\@tempboxa >\hsize
%%    \hspace*{.5in}\parbox{\hsize}{\small {\bf #1:} #2}\par
    \addtolength{\hsize}{1in}
    \parbox{\hsize}{\leftskip .5truein \rightskip .5truein \small{\bf #1:} #2}\par
  \else
    \global \@minipagefalse
%%    \hspace*{.5in}\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \addtolength{\hsize}{1in}
    \parbox{\hsize}{\hfil\small{\bf #1:} #2\hfil}\par
  \fi
  \vskip\belowcaptionskip}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define author, address, abstract (may not need some)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\author#1{\begin{center} {} {\sl #1} \end{center} \vskip 20pt}
\def\authors#1{\begin{center} {} {\sl #1} \end{center} \vskip 20pt}

\def\address#1{\begin{center} {\small #1} \end{center} }

\def\abstract#1{
  \begin{center}  {\bf Abstract:} \\[6pt]
  \addtolength{\hsize}{-1in}
  \parbox{\hsize}{#1} 
  \addtolength{\hsize}{1in} \end{center} \par}

\def\authorfootnote{\protected@xdef\@thefnmark{$\dagger$}%
     \@footnotemark\@footnotetext}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Define mathletters environment as in RevTeX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcount\@indentflag \global\@indentflag=1 %
\newdimen\@eqtoeqnum \@eqtoeqnum=6pt %
\def\@indentamount{%
\ifcase\@indentflag 0pt\or\@centering\or0pt plus1fil\fi\relax
}

\newcounter{eqletter} \setcounter{eqletter}{0}

\def\@eqnnum{\hbox{\reset@font\rm(\theequation)}}
\let\make@eqnnum=\@eqnnum %
\def\eqnum#1{\dec@eqnnum \global\def\make@eqnnum{\reset@font\rm(#1)}%
\def\@currentlabel{#1}%
}
\def\inc@eqnnum{\addtocounter{equation}{1}}
\def\dec@eqnnum{\addtocounter{equation}{-1}}
\@definecounter{equation}%
\@addtoreset{equation}{chapter} %
\def\theequation@prefix{\thechapter.} %

\def\theequation{\theequation@prefix\arabic{equation}}%

\def\mathletters{%
\inc@eqnnum  \setcounter{eqletter}{0}%
\edef\@currentlabel{\theequation}%
\def\theequation{\theequation@prefix\arabic{equation}\alph{eqletter}}%
\def\inc@eqnnum{\addtocounter{eqletter}{1}}%
\def\dec@eqnnum{\addtocounter{eqletter}{-1}}%
}

\let\endmathletters\relax

\def\eqnarray{\par\vskip-\lastskip\vskip\abovedisplayskip
\inc@eqnnum\let\@currentlabel=\theequation
\global\@eqnswtrue\m@th
\global\@eqcnt\z@
\tabskip\@totalleftmargin\advance\tabskip by\@indentamount\let\\\@eqncr
\halign to\hsize\bgroup\hskip\@centering
$\displaystyle\tabskip\z@{##{}}$&\global\@eqcnt\@ne
\hfil${{}##{}}$\hfil
&\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil
\tabskip\@centering \if@eqnsw\phantom{\make@eqnnum\kern\@eqtoeqnum}\fi
&\llap{##}\tabskip\z@\cr}

\def\endeqnarray{%
\@@eqncr\egroup
\vskip\belowdisplayskip\noindent
\dec@eqnnum\global\@indentflag=1
\global\let\make@eqnnum\@eqnnum %
\global\@ignoretrue
}

\def\@@eqncr{\let\@tempa\relax
\ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}%
\else \def\@tempa{&}\fi
\@tempa \if@eqnsw\make@eqnnum\inc@eqnnum\fi
\global\@eqnswtrue\global\@eqcnt\z@\global\let\make@eqnnum=\@eqnnum\cr
}

\@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}%
\def\label##1{\@revmess{warning}{\string\label{##1} used
in eqnarray* environment before (\theequation)}}%
\eqnarray}

