%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Virgil's LaTeX Environment macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % All of the macros and packages Virgil uses to make LaTeX experiences more pleasant %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesPackage{virgil_env} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Packages that often need to be turned ON/OFF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % We need amssymb for the symbol \lessgtr. However, it likes to conflict with other stuff ): \usepackage{amssymb} % AMS symbols. Disabled because it likes to conflict with other stuff. % Decimal point alignment of numeric cells \usepackage{dcolumn} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% End Packages that often need to be turned ON/OFF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Figure out what to do with these later %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Remove space to the vertical edges: %\begin{tabular}{@{}lll@{}} %\usepackage{calc} %% Adds pretty caligraphy fonts %\usepackage{mathrsfs} %\usepackage{amsfonts} %\usepackage{euler} %\DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n} %\DeclareMathAlphabet{\mathpzcm}{OT1}{pzcm}{mb}{it} %\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % add ifthen powers \usepackage{ifthen} % add color powers \usepackage[usenames,dvipsnames]{color} % For debugging during document creation %\usepackage{showkeys} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Fonts + text options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{ lmodern } % I prefer this over times %\usepackage{ times } % default \usepackage{parskip} % more skipping options % Support non-english characters \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Enable Graphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{graphicx} % Takes the ``[draft]'' option in \document class \DeclareGraphicsExtensions{.pdf,.eps,.png,.jpg} % search for .pdf, then .eps, then .pngs, then .jpg % look in these subdirectories for graphics referenced by \includegraphics % each entry must end with a / \graphicspath{{figs/}{figures/}{images/}{./}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Bibliography options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % natbibspacing availabe at: http://dcwww.camd.dtu.dk/~schiotz/comp/LatexTips/natbibspacing.sty %\usepackage{natbib} %\usepackage{natbibspacing} %\bibliographystyle{plain} %\bibliographystyle{unsrt} %\bibliographystyle{nature} %\bibliographystyle{apa} %\bibliographystyle{mslapa} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Math and Symbol packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{amsmath, mathtools} % you always want this \usepackage{amsthm} % for theorems % enables bold greek letters in math mode using the \bm{...} command. Supersedes package `amsbsy'. %% Enables blackboard-bold letters %\usepackage{bbold} % for \textbb{} %\usepackage{bm} %\usepackage{bbm} % blackboard bold with \mathbbm{} \usepackage{bm} %\usepackage{, wasysym} % lots of fancy symbols \usepackage{commath} \usepackage{marvosym} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Better page-formatting options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{afterpage} % better-behaved page-formating \usepackage{fancyhdr} % Change header and footer on any page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Better Math %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{array} % replacement for eqnarray. Must be BEFORE \usepackage{arydshln} \usepackage{units} % for \nicefrac{\alpha}{\beta} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Prettier tables %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{booktabs} % for much better looking tables \usepackage{arydshln} % For dashed-lines in tables %%%%% Adds a downward line "closing" what's inside the square-root. % New definition of square root: % it renames \sqrt as \oldsqrt \let\oldsqrt\sqrt % it defines the new \sqrt in terms of the old one \def\sqrt{\mathpalette\DHLhksqrt} \def\DHLhksqrt#1#2{% \setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0 \advance\dimen0-0.2\ht0 \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}% {\box0\lower0.4pt\box2}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% More customizable Figures %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{float} % necessary for fancy positioning \usepackage{wrapfig} % wrap text around your figures \usepackage{subfig} % supercedes subfigure % provides the capability to rename Figure -> Fig. throughout document % supercedes \usepackage{caption}. %\usepackage{ccaption} %\usepackage{boxedminipage} % for floating boxes. Haven't used this much. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% More customizable Lists %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Better symbols custom enumerative lists, define any symbol you'd like \usepackage{enumitem} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Custom Symbols %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \xspace at the end of custom macros never fucks up spacing. % example of best practice: \newcommand{\apples}{\textsf{AppLeS}\xspace} \usepackage{xspace} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Text formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % for different styles of underlines \usepackage{ulem} \normalem % \normalem is to keep \emph{} italics instead of underlined. \newcommand{\redwuline}[1]{ {\color{red}{ \uwave{\textcolor{black}{#1}} } } } \newcommand{\orangewuline}[1]{ {\color{BurntOrange}{ \uwave{\textcolor{black}{#1}} } } } % In-line lists. I've never used this but here's the package for it %\usepackage{paralist} %\textbf{\itshape Inline lists}, which are sequential in nature, just like enumerated %lists, but are \begin{inparaenum}[\itshape a\upshape)] %\item formatted within their paragraph; %\item usually labelled with letters; and %\item usually have the final item prefixed with `and' or `or', %\end{inparaenum} like this example. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% For prettier citations and hyperlinks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[pdftex, colorlinks=true, bookmarksnumbered=true, bookmarksopen=true, bookmarksopenlevel=3, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=black, ]{hyperref} % if \url isn't defined yet, define it using the `url' package. Else do nothing \ifthenelse{ \isundefined{\url} } { \usepackage{url} }{} \usepackage{cite} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Special customizations that I like %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Makes the tables prettier %\renewcommand{\arraystretch}{1.05} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SAVETREES - space saving options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % You'd probably want to put this right before your \documentclass{} in your .tex file % options: normaltitle, normalmargins, normalsections, normallists, normalfloats, normalindent, , normalleading, normalbib, normalbibnotes % use everything %\usepackage[]{savetrees} %\usepackage[normaltitle, normalsections, normalmargins, normalindent]{savetrees} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% For multi-line comments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{verbatim} \newcommand*{\bcomment}{ \begin{comment} } \newcommand*{\ecomment}{ \end{comment} } %\newcommand{\bCOMMENT}{ \begin{comment} } %\newcommand{\eCOMMENT}{ \end{comment} } %\newcommand*{\comment}[1]{} %\newcommand{\COMMENT}[1]{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Abbreviations you'll always want %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand*{\TODO}[1]{{\centering {\sffamily \color{red} #1} \vskip10pt }} \newcommand*{\todo}[1]{{\sffamily [{\color{red} #1}]}} \newcommand*{\fix}[1]{{\sffamily [{\textnormal{\color{red} #1}}]}} %----------------------------------------------------------------------------- % Cross references %----------------------------------------------------------------------------- % The following code defines how you make references to figures, tables, etc... % It is defined in one place only, and can be modified for all references % in the document at the same time. % Instead of typing each time: "see Fig. \ref{myfig}" you can create a command % \figref which will do the job. Then in text you only type \figref{myfig} and LaTeX % will do the rest. \newcommand{\tblref}[1]{Table~\ref{#1}} %\renewcommand*{\figref}[1]{Fig.~\ref{#1}} \newcommand{\equref}[1]{(\ref{#1})} \newcommand{\Tblref}[1]{Table~\ref{#1}} \newcommand{\Figref}[1]{Figure~\ref{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %----------------------------------------------------------------------------- % Misc symbols that I like %----------------------------------------------------------------------------- \newcommand*{\opname}[1]{\operatorname{#1}} \newcommand{\opnamewl}[1]{\operatornamewithlimits{#1}} \newcommand*{\bdot}{ {\color{Brown} \ensuremath{\newmoon} } } \newcommand*{\rdot}{ {\color{red} \ensuremath{\newmoon} } } \newcommand*{\gdot}{ {\color{green} \ensuremath{\newmoon} } } %\renewcommand*{\odot}{ {\color{Orange} \ensuremath{\newmoon} } } \renewcommand*{\:}{\ensuremath{\!:\!}} %\newcommand*{\dequal}{\overset{\Delta}{=}} %\newcommand{\red}{{\color{Red}\ding{108}}} %\newcommand{\blue}{{\color{NavyBlue}\ding{108}}} %\newcommand{\green}{{\color{Green}\ding{108}}} \newcommand*{\highcond}{ \uparrow } \newcommand*{\lowcond}{ \downarrow } \newcommand*{\bphi}{ \langle \phi \rangle } %\newcommand*{\bei}{ \ei } \newcommand*{\red}[1]{ \color{red} #1} \newcommand*{\RED}[1]{ \textbf{ \color{red} #1 } } \renewcommand*{\to}{\rightarrow} % Define over and under comment using braces \newcommand*{\overcomment}[2]{\ensuremath{\overbrace{#1}^{\mathclap{\textnormal{#2}}} }} \newcommand*{\undercomment}[2]{\ensuremath{\underbrace{#1}_{\mathclap{\textnormal{#2}}} }} % Define the Kullback-Leibler divergence notation \newcommand*{\DKL}[2]{\ensuremath{ \opname{D_{KL}} \! \left[ #1 \middle\|\, #2 \right] }} % Define a pretty Entropy H( ... ) \newcommand*{\ent}[1]{\opnamewl{H} \! \left( #1 \right)} % Define a pretty conditional Entropy H( ... | ... ) \newcommand*{\condent}[2]{\ent{#1\middle|#2}} % Define a pretty Mutual Information I( ... : ... ) \newcommand*{\info}[2]{ \opnamewl{I} \! \left( #1 \!:\! #2 \right)} \newcommand*{\infosemi}[2]{ \opnamewl{I} \! \left( #1 ; #2 \right)} % Define a pretty Conditional Mutual Information % Define a pretty Probability Pr( ... ) \newcommand*{\Prob}[1]{\ensuremath{\Pr \! \left( #1 \right)}} \renewcommand*{\flat}[1]{\ensuremath{\overline{#1}}} % Prettier Roman Numerals % \Roman is already defined, but I like this one better \makeatletter % turns ON allowing @ signs inside of commands \newcommand{\Rmn}[1]{\textbf{\expandafter\@slowromancap\romannumeral #1@}} \makeatother % turns OFF \makeatletter \newcommand{\argmax}{\operatornamewithlimits{argmax}} \newcommand{\argmin}{\operatornamewithlimits{argmin}}