%------------------------------------------------------------------------------
% Contents: Commands, package loading and page settings
% Id: projects.sty
%------------------------------------------------------------------------------
% By Bo Lind
%------------------------------------------------------------------------------
\ProvidesPackage{projects}
%--------------------------------------------------------
% Page setup and page style
%--------------------------------------------------------
\setlrmarginsandblock{1.5in}{0.8in}{*} % Sets the inner and outer margins
\setulmarginsandblock{1in}{1.3in}{*} % Sets the top and bottom margins
%\setmarginnotes{0.2in}{1.7in}{0.3in}
\checkandfixthelayout
\setlength{\droptitle}{3cm} % Sets the length before the title
\aliaspagestyle{title}{empty} % no page number on the front page
\newcommand{\published}[1]{
\gdef\puB{#1}
}
\newcommand{\puB}{}
\renewcommand{\maketitlehookd}{
\vskip 30em
\begin{center}
\puB
\end{center}
}
\newcommand{\subtitle}[1]{
\gdef\suB{#1}
}
\newcommand{\suB}{}
\renewcommand{\maketitlehookb}{
\begin{center}
\LARGE\scshape\suB
\end{center}
}
\pretitle{\begin{center}\Huge\bfseries}
\posttitle{\par\end{center}\vskip 0.5em}
\preauthor{\begin{center}
\large\bfseries \vskip 8em%
\begin{tabular}[t]{c}}
\postauthor{\end{tabular}\end{center}}
\predate{\begin{center}\large}
\postdate{\par\end{center}}
\cftsetindents{chapter}{1.5em}{6.0em}
%\cftsetindents{subsection}{5.5em}{6.0em}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterpresnum}{\chaptername\ }
\maxsecnumdepth{subsection}
\setsecnumdepth{subsection}
\maxtocdepth{subsection}
\captiondelim{. }
\captionnamefont{\small\scshape}
\captiontitlefont{\small}
%\tightlists % suppress space between list entries
\pagestyle{plain}
\renewcommand{\baselinestretch}{1.1} % 1.1 line-distance
\usepackage[danish]{varioref} % More inteligent refrences.
\usepackage[round]{natbib} % Use author-date citation.
%--------------------------------------------------------
% Fonts and layout
%--------------------------------------------------------
\usepackage[latin1]{inputenc} % Input encoding. Makes it possible to type special characters.
\usepackage[danish]{babel} % Danish hyphenation and changes Figures, Chapter etc to Danish.
\usepackage{lmodern} % Makes the Latin Modern fonts the default for LaTeX.
\usepackage[T1]{fontenc} % Standard font encoding.
\usepackage{textcomp} % TS1-encoding symbols.
\usepackage{amssymb}
\usepackage{amsfonts} % Better math fonts.
\usepackage{amsmath} % Provides various features to facilitate writing math formulas and to improve the typographical quality of their output.
\usepackage{bm} % Blackboard Bold font.
\usepackage{url}
\usepackage{units} % To typeset units use the command \unit{m^2}.
%--------------------------------------------------------
% Enviroments, theorems etc.
%--------------------------------------------------------
\usepackage[amsmath,thmmarks]{ntheorem}
\theoremstyle{plain}
\theoremheaderfont{\normalfont\bfseries}
\theorembodyfont{\itshape}
\newtheorem{thm}{Sætning}[chapter]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{kor}[thm]{Korollar}
\newtheorem{eks}[thm]{Eksempel}
\theorembodyfont{\normalfont}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exerc}{\O{}velse}[chapter]
\theoremstyle{nonumberplain}
\theoremheaderfont{\normalsize\normalfont\scshape}
\theorembodyfont{\upshape}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Bevis}
\newcommand{\refthm}[1]{S\ae{}tning~\ref{#1}}
\newcommand{\reflemma}[1]{Lemma~\ref{#1}}
\newcommand{\refcor}[1]{Korollar~\ref{#1}}
\newcommand{\refdefn}[1]{Definition~\ref{#1}}
\newcommand{\refexerc}[1]{\O{}velse~\ref{#1}}
\newcommand{\refexample}[1]{Eksempel~\ref{#1}}
%--------------------------------------------------------
% Useful commands
%------------------------------------------------------------------------- Misc
\newcommand{\itemMath}[1]{\raisebox{-\abovedisplayshortskip}{%
\parbox{0.75\linewidth}{%
\[#1\]}}}
%---------------------------------------------------------- Figure preferences:
% The following four numbers are to make TeX more likely to put figures on the
% same page rather than on a separate figures page. Can tinker with these, but
% make sure floatpagefraction<topfraction.
% Values recommended by the web page I found were 0.15, 0.85, 0.65, 0.60. The
% default values are 0.2, 0.7, 0.3, 0.5
%\renewcommand{\textfraction}{0.2}
%\renewcommand{\topfraction}{0.7}
%\renewcommand{\bottomfraction}{0.3}
%\renewcommand{\floatpagefraction}{0.5}
%---------------------------------------------------------------------- Figures
\newcommand\tabcaption{\def\@captype{table}\caption}
\newcommand\figcaption{\def\@captype{figure}\caption}
\usepackage[dvips]{graphicx}
\usepackage{sidecap}
\usepackage{psfrag}
\newlength{\marginwidth} % Let a length to use for margin figures
\setlength{\marginwidth}{\marginparwidth}
\addtolength{\marginwidth}{\marginparsep}
% \begin{adjustwidth*}{0in}{-\marginwidth} ... \end{adjustwidth*} needs to be
% placed OUTSIDE the table environment to work, while it can be placed INSIDE
% in the figure enviroment. (In memoir).
\newcommand{\fig}[3]{ %\fig{filename}{caption}{optional commands}
\begin{figure}[htbp]
#3
\center
\includegraphics{#1}
\figcaption{#2} %
\label{fig:#1} %
\end{figure}
}
\newcommand{\sidefig}[3]{ %\sigfig{filename}{caption}{optional commands}
\begin{SCfigure}[][htbp]
#3
\includegraphics[width=0.5\textwidth]{#1}
\caption{#2} %
\label{fig:#1} %
\end{SCfigure}
}
%---------------------------------------------------------------------- Physics
\newcommand{\Hamiltonian}{\mathcal{H}}
\newcommand{\Lagrangian}{\mathcal{L}}
\newcommand{\mean}[1]{\langle #1 \rangle}
%------------------------------------------------------------------------- Sets
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\emtyset}{\varnothing}
\newcommand{\set}[1]{\ensuremath{\{#1\}}}
\newcommand{\suchthat}{\bigm|}
\newcommand{\union}{\cup}
\newcommand{\Union}{\bigcup}
\newcommand{\intersection}{\cap}
\newcommand{\Intersection}{\bigcap}
% Other set commands:
% \complement
% \setminus
% \in
\newcommand{\map}[3]{\ensuremath{#1\colon #2\to #3}}
%---------------------------------------------------------------------- Vectors
\renewcommand{\vec}[1]{\bm{\mathrm{#1}}}
\newcommand{\uvec}[1]{\vec{e}_{#1}}
\newcommand{\ket}[1]{\, |#1\rangle}
\newcommand{\bra}[1]{\langle #1 |\,}
\newcommand{\rr}{\vec{r}}
\newcommand{\vv}{\vec{v}}
\newcommand{\aaa}{\vec{a}}
\newcommand{\zero}{\ensuremath{\mathbf{0}}}
%------------------------------------------------------------------ Derivatives
\newcommand{\D}[2]{\frac{d #1}{d #2}}
\newcommand{\DD}[2]{\frac{d^2 #1}{d #2^2}}
\newcommand{\PD}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\PDD}[2]{\frac{\partial^2 #1}{\partial #2^2}}
%-------------------------------------------------------------------- Integrals
\newcommand{\oiint}{\int\hspace{-2ex}\int\hspace{-3.04ex}\bigcirc~}
\renewcommand{\iint}{\int\hspace{-1.5ex}\int}
\renewcommand{\iiint}{\int\hspace{-1.5ex}\int\hspace{-1.5ex}\int}