\RequirePackage[normalem]{ulem}

% Default mods

% Center figure contents
\g@addto@macro\@floatboxreset\centering

% No extra space between list items by default.
\let\origitemize=\itemize
\def\itemize{%
  \origitemize
  \setlength{\itemsep}{0pt}%
}

\newcommand\resetnumbering{%
  \setcounter{page}{1}%
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \setcounter{subsubsection}{0}%
  \setcounter{paragraph}{0}%
  \setcounter{subparagraph}{0}%
  \setcounter{footnote}{0}%
}

\def\bazlhead{}
\def\bazrhead{}
\def\bazlfoot{}
\def\bazrfoot{}
\newcommand\headers[4]{%
  \def\bazlhead{#1}\lhead{#1}%
  \def\bazrhead{#2}\rhead{#2}%
  \def\bazlfoot{#3}\lfoot{#3}%
  \def\bazrfoot{#4}\rfoot{#4}%
}

% Originally from gametex.sty's \sheettitle
\newcommand\chapter[1]{%
  \clearpage%
  \begingroup%
  \baselineskip0pt%
  \lineskip3pt%
  \parskip3pt%
  \def\baselinestretch{0}%
  \let\\\par%
  \parindent0pt%
  \centering%
  \hbox to\textwidth{%
    \hfill%
    \vbox{%
      \hsize\textwidth%
      \advance\hsize-1in%
      \hrulefill%
      \vskip\lineskip%
      {\bfseries#1\par}%
      \vskip\lineskip%
      \hrulefill}%
    \hfill}%
  \vskip5pt%
  \vskip\parskip%
  \endgroup%
}

% href that also makes a footnote with the url 
% (unless the link text is the url)
\newcommand\fnhref[2]{%
  \href{#1}{#2}%
  \ifthenelse{\equal{#1}{#2}}{}{\footnote{\url{#1}}}}

\newcommand\dbox[2][2in]{%
  \setlength{\fboxsep}{3pt}%
  \fbox{\setlength{\fboxsep}{8pt}%
    \fbox{%
      \begin{minipage}{#1}%
        \begin{center}%
          #2%
        \end{center}%
      \end{minipage}}%
  }%
}

% TODO(xavid): these skips should be specific to the quote environments, not
%              general.
\newenvironment{thincenter}{%
  \par\smallskip\begingroup\centering
}{%
  \par\endgroup
}
\newenvironment{thinright}{%
  \par\begingroup\raggedleft
}{%
  \par\endgroup\smallskip
}

\newenvironment{bazquote}{%
  \begingroup
  \advance\leftmargini 2em%
  \begin{quotation}\noindent\ignorespaces
}{%
  \end{quotation}%
  \endgroup
}

\long\def\starttable#1\endtable#2{%
  \begin{tabular}{#2}
  #1
  \end{tabular}
}

% For tabularx, not tabulary
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{w}[1]{@{}>{\centering\arraybackslash}m{#1}@{}}
\long\def\starttablex#1\endtablex#2{%
  \begin{tabularx}{\textwidth}{#2}
  #1
  \end{tabularx}
}

\def\ignore#1{}
