\newcommand{\bc}[1]{\ensuremath{\bm{\mathcal{#1}}}}
%           ^^^- fails inside \section{} with package{hyperref}
\newcommand{\code}[1]{\texttt{\small #1}}
\newcommand{\package}[1]{\texttt{\small #1}}
\newcommand{\abs}{\operatorname{abs}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\rank}{\operatorname{rank}}
\newcommand{\R}{\textsf{R}}
\newcommand{\inv}{\ensuremath{^{-1}}}
\newcommand{\invtrans}{\ensuremath{^{-\mathsf{T}}}}
\newcommand{\trans}{\ensuremath{^{\mathsf{T}}}}
\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontsize=\small}
% to loosen float placements:
\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
