annotate smc2013_cameraReady/tools.sty @ 58:a63c438b3f65 tip

Squeezed it into the 6 page limit
author Henrik Ekeus <hekeus@eecs.qmul.ac.uk>
date Tue, 11 Jun 2013 15:17:21 +0100
parents 2cad1d57f7e2
children
rev   line source
hekeus@55 1 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
hekeus@55 2 \ProvidesPackage{tools}[2007/12/25 v1.1 Samer's general LaTeX tools]
hekeus@55 3 \DeclareOption{detbar}{\def\detbar{y}}
hekeus@55 4 \DeclareOption{innerparen}{\def\inneropt{paren}}
hekeus@55 5 \DeclareOption{innerdot}{\def\inneropt{dot}}
hekeus@55 6 \DeclareOption{innermat}{\def\inneropt{mat}}
hekeus@55 7 \DeclareOption{nodesc}{\def\nodesc{y}}
hekeus@55 8 \ExecuteOptions{innerparen}
hekeus@55 9 \ProcessOptions
hekeus@55 10
hekeus@55 11 \providecommand{\comment}[1] {}
hekeus@55 12 \usepackage{xspace,units,array,amsmath,graphicx}
hekeus@55 13 \ifx\ifpdf\undefined
hekeus@55 14 \usepackage{ifpdf}
hekeus@55 15 \fi
hekeus@55 16 \ifpdf
hekeus@55 17 \usepackage{epstopdf}
hekeus@55 18 \else
hekeus@55 19 \fi
hekeus@55 20
hekeus@55 21 % PSTricks things
hekeus@55 22 %\usepackage{pstcol,pstricks,pst-node,pst-plot}
hekeus@55 23 %\psset{linewidth=0.4pt,labelsep=3pt,dotsize=1.2mm,%
hekeus@55 24 % arrowsize=2pt 2.5,arrowlength=1,arrowinset=0.2,%
hekeus@55 25 % gridwidth=0.4pt,griddots=10,subgriddiv=1,gridlabels=7pt,gridcolor=gray}
hekeus@55 26
hekeus@55 27 \let\oldS=\S
hekeus@55 28 \newcommand{\sect}[1] {$\oldS\,#1$}
hekeus@55 29 \newcommand{\shim}[2] {\hspace{#1mm plus #2mm}}
hekeus@55 30 \newcommand{\ie} {i.e.\@\xspace}
hekeus@55 31 \newcommand{\vrs} {vs.\@\xspace}
hekeus@55 32 \newcommand{\eg} {e.g.\@\xspace}
hekeus@55 33 \newcommand{\etc} {etc.\@\xspace}
hekeus@55 34 \newcommand{\latin}[1] {\emph{#1}\xspace}
hekeus@55 35 \newcommand{\figrf}[1] {fig.~\ref{f:#1}}
hekeus@55 36 \newcommand{\Figrf}[1] {Fig.~\ref{f:#1}}
hekeus@55 37 %\newcommand{\eqrf}[1] {eq.~\ref{eq:#1}}
hekeus@55 38 \newcommand{\eqrf}[1] {(\ref{eq:#1})}
hekeus@55 39 \newcommand{\secrf}[1] {\sect{\ref{s:#1}}}
hekeus@55 40 \newcommand{\chaprf}[1] {Chapter~\ref{ch:#1}}
hekeus@55 41 \newcommand{\ed}[1] {\texttt{[#1]}}
hekeus@55 42 \newcommand{\role} {role\xspace}%{r\^{o}le\xspace}
hekeus@55 43 \newcommand{\naive} {naive\xspace}
hekeus@55 44 \newcommand{\german}[1] {\emph{#1}}
hekeus@55 45 \newcommand{\degr}[1] {$#1^\circ$}
hekeus@55 46 %\newcommand{\nth}[1] {$#1$\hskip 0.1ex th\xspace}
hekeus@55 47 \newcommand{\nth}[1] {$#1$\hspace*{0.2ex}\raisebox{0.35em}{\scriptsize th}\xspace}
hekeus@55 48 \newcommand{\textnth}[1]{#1\hskip 0.2ex \raisebox{0.35em}{\scriptsize th}\xspace}
hekeus@55 49 \newcommand{\const}{\text{const.}}
hekeus@55 50 \newcommand{\D}[1] {$#1$-D\xspace}
hekeus@55 51 \newcommand{\sh} {$\sharp$}
hekeus@55 52 \newcommand{\fl} {$\flat$}
hekeus@55 53 \newcommand{\Hmax}{H_\mathrm{max}}
hekeus@55 54 \newcommand{\Imax}{I_\mathrm{max}}
hekeus@55 55
hekeus@55 56 % centred dot with space either side for separating things
hekeus@55 57 %\def\nicedot{\hspace{0.7em}\textperiodcentered\hspace{0.7em}}
hekeus@55 58 \newlength\nicedotspace
hekeus@55 59 \setlength\nicedotspace{0.6em plus 0.1em minus 0.2em}
hekeus@55 60 \def\nicedot{\hspace{\nicedotspace}\textperiodcentered\hspace{\nicedotspace}}
hekeus@55 61
hekeus@55 62 %\newcommand{\margnote}[1] {\marginpar{\raggedright\itshape\small#1}}
hekeus@55 63
hekeus@55 64 % names
hekeus@55 65 \newcommand{\Hyvarinen}{Hyv\"arinen\xspace}
hekeus@55 66 \newcommand{\Kohler}{K\"ohler\xspace}
hekeus@55 67 \newcommand{\Pragnanz}{Pr\"{a}gnanz\xspace}
hekeus@55 68
hekeus@55 69 % environments
hekeus@55 70 \ifx\nodesc\undefined
hekeus@55 71 \renewenvironment{description}
hekeus@55 72 {\begin{list}{}{%
hekeus@55 73 \setlength{\labelwidth}{1.5em}
hekeus@55 74 \setlength{\leftmargin}{1.5em}
hekeus@55 75 \let\makelabel\descriptionlabel
hekeus@55 76 }}
hekeus@55 77 {\end{list}}
hekeus@55 78 \fi
hekeus@55 79
hekeus@55 80 \newenvironment{smallquote}
hekeus@55 81 { \begin{quote} \small}
hekeus@55 82 { \end{quote}}
hekeus@55 83
hekeus@55 84 \providecommand{\figplacement}{tbp}
hekeus@55 85 \newenvironment{fig}[2][\figplacement]
hekeus@55 86 {%
hekeus@55 87 \newcommand{\bbfig}[1]{\begin{figure}[##1]}
hekeus@55 88 \expandafter\bbfig\expandafter{#1}
hekeus@55 89 \def\fglbl{f:#2}
hekeus@55 90 \let\ocap=\caption
hekeus@55 91 \renewcommand{\caption}[2][]{\ocap[##1]{\small ##2}}
hekeus@55 92 \centering\small
hekeus@55 93 }{%
hekeus@55 94 \label{\fglbl}
hekeus@55 95 \end{figure}
hekeus@55 96 }
hekeus@55 97
hekeus@55 98 \newenvironment{fig*}[2][\figplacement]
hekeus@55 99 {%
hekeus@55 100 \newcommand{\bbfig}[1]{\begin{figure*}[##1]}
hekeus@55 101 \expandafter\bbfig\expandafter{#1}
hekeus@55 102 \def\figlabel{f:#2}
hekeus@55 103 \let\ocap=\caption
hekeus@55 104 \renewcommand{\caption}[2][]{\ocap[##1]{\small ##2}}
hekeus@55 105 \centering\small
hekeus@55 106 }{%
hekeus@55 107 \label{\figlabel}
hekeus@55 108 \end{figure*}
hekeus@55 109 }
hekeus@55 110
hekeus@55 111 \newenvironment{eq}[1]
hekeus@55 112 {\begin{equation}\def\eqlabel{eq:#1}}
hekeus@55 113 {\label{\eqlabel}\end{equation}}%
hekeus@55 114
hekeus@55 115
hekeus@55 116
hekeus@55 117
hekeus@55 118 % ------------- standard mathematics -----------------
hekeus@55 119
hekeus@55 120 % --- calculus
hekeus@55 121 \let\oldint\int \def\int#1\dd{\oldint#1\;\dd}
hekeus@55 122 \let\oldiint\iint \def\iint#1\dd#2\dd{\oldiint#1\;\dd#2\;\dd}
hekeus@55 123 \let\oldiiint\iiint \def\iiint#1\dd#2\dd#3\dd{\oldiiint#1\;\dd#2\;\dd#3\;\dd}
hekeus@55 124 \newcommand{\infint}[2] {\int_{-\infty}^\infty#2\dd#1}
hekeus@55 125 \newcommand{\partiald}[2] {\frac{\partial#1}{\partial#2}}
hekeus@55 126 \newcommand{\pd}[2] {\dfrac{\partial#1}{\partial#2}}
hekeus@55 127 \newcommand{\dd} {\mathrm{d}}
hekeus@55 128 \newcommand{\hdbyd}[2][] {\dd{#1}/\dd{#2}}
hekeus@55 129 \newcommand{\dbyd}[2][] {\frac{\dd#1}{\dd#2}}
hekeus@55 130 \newcommand{\dbydt}[1] {\frac{\dd#1}{\dd t}}
hekeus@55 131 \newcommand{\hpd}[2] {{\partial#1}/{\partial#2}}
hekeus@55 132 \newcommand{\grad} {\boldsymbol{\nabla}}
hekeus@55 133 \newcommand{\hfrac}[2] {#1/#2}
hekeus@55 134 \newcommand{\hpfrac}[2] {(#1/#2)}
hekeus@55 135
hekeus@55 136 % --- statistics
hekeus@55 137 \newcommand{\savg}[2][] {%
hekeus@55 138 \def\sub{#1} % optional subscript
hekeus@55 139 \ifx\sub\empty {\langle #2 \rangle}
hekeus@55 140 \else {\langle #2 \rangle}_{#1}
hekeus@55 141 \fi}
hekeus@55 142
hekeus@55 143 \newcommand{\avg}[2][] {%
hekeus@55 144 \def\sub{#1} % optional subscript
hekeus@55 145 \ifx\sub\empty {\left\langle #2 \right\rangle}
hekeus@55 146 \else {\left\langle #2 \right\rangle}_{#1}
hekeus@55 147 \fi}
hekeus@55 148
hekeus@55 149 \newcommand{\expect}[2][] {%
hekeus@55 150 \def\sub{#1} % optional subscript
hekeus@55 151 \ifx\sub\empty \operatorname{E} \, #2
hekeus@55 152 \else \operatorname{E}_{#1} #2
hekeus@55 153 \fi
hekeus@55 154 }
hekeus@55 155 \newcommand{\sqbr}[1] {[\,#1]}
hekeus@55 156 \newcommand{\var}[1] {\operatorname{var}\, #1}
hekeus@55 157 \newcommand{\cov}[2] {\operatorname{cov}[#1,#2]}
hekeus@55 158 \newcommand{\cc}[2] {\operatorname{corr}[#1,#2]}
hekeus@55 159 %\newcommand{\KL}[2] {\mathrm{KL}[\, #1 \|\, #2]}
hekeus@55 160 \newcommand{\KL}[2] {D(#1 \|\, #2)}
hekeus@55 161 \newcommand{\define} {\overset{\text{\tiny def}}{=}}
hekeus@55 162 \newcommand{\distr} {\sim}
hekeus@55 163
hekeus@55 164 % --- sets
hekeus@55 165 \newcommand{\union} {\cup}
hekeus@55 166 \newcommand{\diff} {\backslash}
hekeus@55 167 \newcommand{\intersect} {\cap}
hekeus@55 168 \newcommand{\integers} {\mathbb{Z}}
hekeus@55 169 \newcommand{\reals} {\mathbb{R}}
hekeus@55 170 \newcommand{\complexes} {\mathbb{C}}
hekeus@55 171 %\newcommand{\C} {\mathbb{C}}
hekeus@55 172 \newcommand{\naturals} {\mathbb{N}}
hekeus@55 173 %\renewcommand*{\emptyset} {\varnothing}
hekeus@55 174
hekeus@55 175 % --- misc
hekeus@55 176 \def\rowvec(#1,#2){\begin{pmatrix} #1 & #2 \end{pmatrix}}
hekeus@55 177 \def\colvec(#1,#2){\begin{pmatrix} #1 \\ #2 \end{pmatrix}}
hekeus@55 178
hekeus@55 179 \ifx\detbar\undefined\else\def\det#1{|#1|}\fi
hekeus@55 180
hekeus@55 181 \newcommand{\sqtp}{\sqrt{2 \pi}}
hekeus@55 182 \DeclareMathOperator{\sech}{sech}
hekeus@55 183 \DeclareMathOperator{\sgn} {sgn}
hekeus@55 184 \DeclareMathOperator{\trace} {tr}
hekeus@55 185 \newcommand{\repart}{\Re\,}
hekeus@55 186 \newcommand{\impart}{\Im\,}
hekeus@55 187 \newcommand{\assign} {\leftarrow}
hekeus@55 188 \newcommand*\half {\tfrac{1}{2}}
hekeus@55 189 \newcommand{\fun}[1] {$#1(\cdot)$\xspace}
hekeus@55 190 \newcommand{\ffun}[1] {$#1(\cdot,\cdot)$\xspace}
hekeus@55 191 \newcommand{\tends} {\rightarrow}
hekeus@55 192 \renewcommand*{\vec}[1] {\mathbf{#1}}
hekeus@55 193 \providecommand{\abs}[1] {\lvert#1\rvert}
hekeus@55 194 \providecommand{\norm}[1] {\lVert#1\rVert}
hekeus@55 195 \if\inneropt{paren}
hekeus@55 196 \newcommand{\inner}[2] {(#1,#2)}
hekeus@55 197 \fi
hekeus@55 198 \if\inneropt{dot}
hekeus@55 199 \newcommand{\inner}[2] {#1\cdot#2}
hekeus@55 200 \else
hekeus@55 201 \newcommand{\inner}[2] {{#1}^T#2}
hekeus@55 202 \fi
hekeus@55 203
hekeus@55 204 % --- psfig bits
hekeus@55 205 \newcommand{\psmath}[2] {\psfrag{#1}{\scriptsize $#2$}}
hekeus@55 206 \newcommand{\psmathbig}[2] {\psfrag{#1}{\small $#2$}}
hekeus@55 207
hekeus@55 208
hekeus@55 209 % \linespread{1.1}
hekeus@55 210
hekeus@55 211
hekeus@55 212 % top-aligned boxes
hekeus@55 213 \newbox\thehbox
hekeus@55 214 \newcommand{\hangbox}[1]{%
hekeus@55 215 \savebox{\thehbox}{#1}%
hekeus@55 216 \raisebox{-\ht\thehbox}[0pt][\ht\thehbox]{\usebox{\thehbox}}%
hekeus@55 217 % \raisebox{-\ht\thehbox}[0pt][-\ht\thehbox]{\usebox{\thehbox}}%
hekeus@55 218 }
hekeus@55 219
hekeus@55 220 \newenvironment{hanging}{%
hekeus@55 221 \begingroup
hekeus@55 222 \newbox\thebox
hekeus@55 223 \begin{lrbox}{\thebox}
hekeus@55 224 }{%
hekeus@55 225 \end{lrbox}%
hekeus@55 226 \raisebox{-\ht\thebox}[0pt][\ht\thebox]{\usebox{\thebox}}%
hekeus@55 227 \endgroup
hekeus@55 228 }%
hekeus@55 229
hekeus@55 230 % Hacky indentation - FIXME!
hekeus@55 231 \newenvironment{indented}
hekeus@55 232 {\vspace{-0.6em}\begin{quote}}
hekeus@55 233 {\end{quote}\vspace{-0.6em}}
hekeus@55 234