\documentclass[pdftex,11pt,a4paper,oneside]{report}
%\documentclass[pdftex,11pt,a4paper,oneside]{report}
\pdfcompresslevel=1

%%%% Pacages
\usepackage{bibtopic}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel}
\usepackage[dvipdfm]{graphicx}
\usepackage{mdwtab}
\usepackage{makeidx}
\usepackage{listings}
\usepackage[final]{pdfpages}
\usepackage{fancyhdr}
%\usepackage{fixme}
\usepackage[usenames]{color}
\usepackage{geometry}
\usepackage{courier}
\usepackage{amsfonts}

%\usepackage[T1]{fontenc}
%\usepackage{newcent}
%\usepackage{times}

\usepackage{wrapfig}
\usepackage[danish,refpage]{nomencl}
\usepackage{parskip}

\bibliographystyle{alpha}

%% Margins
\geometry{paper=a4paper, top=2.5cm, bottom=2.5cm, left=3.9cm, right=3.7cm}
%\renewcommand{\headrulewidth}{0.5pt}
%\setlength{\footskip}{10pt}
%\setlength{\headheight}{6pt}
%\addtolength{\headheight}{1.5pt} % make space for the rule

\pagestyle{fancy}

%%%% hyperlink-setup
\usepackage{hyperref}
\hypersetup{colorlinks=true,plainpages=true,urlcolor=black}
\hypersetup{citecolor=black, anchorcolor=black}
\hypersetup{pagecolor=black, filecolor=black, linkcolor=black}
\def\pdffit{fit}
\definecolor{gray}{rgb}{0.8,0.8,0.8}

\hypersetup{
pdfauthor = {Ulf Holm Nielsen, Mads Danquah, Thomas Riisbjerg og Troels Krogh},
pdftitle = {Multiplayer netværksspil i C++},
pdfsubject = {},
pdfkeywords = {c++, java, opengl, game, multiplayer, network},
pdfcreator = {1337 rapport bygger},
pdfproducer = {1337 rapport bygger}}

% define left and right header
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}} 
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

\addto\captionsdanish{% Change from chapter -> Afsnit
  \renewcommand{\chaptername}{Afsnit}
  \renewcommand{\appendixname }{Appendiks}
}

%%%% Head/footer setup
\fancyhf{} % delete current setting for header and footer

% "normal" font
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\leftmark}{}

% use different font i page-header
%\fancyhead[LE,RO]{{\fontfamily{phv}\selectfont \thepage}}
%\fancyhead[R]{{\fontfamily{phv}\selectfont \rightmark}}
%\fancyhead[L]{{\fontfamily{phv}\selectfont \leftmark}}

%\fancyfoot[R]{{\fontfamily{phv}\selectfont \thepage}}

%\fancypagestyle{plain}{
%\fancyhead{} % get rid of headers on plain pages
%\renewcommand{\headrulewidth}{0pt} % and the line
%}


% Different font in captions
\newcommand{\captionfonts}{\small}

%\newenvironment{intro}{\sffamily}{\vspace*{2ex minus 1.5ex}}
% Use slanted (somewhere between italic and normal) text in intro 
\newenvironment{intro}{\slshape}{\vspace*{2ex minus 1.5ex}}

\makeatletter  % Allow the use of @ in command names
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{{\captionfonts #1: #2}}%
  \ifdim \wd\@tempboxa >\hsize
    {\captionfonts #1: #2\par}
  \else
    \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\makeatother   % Cancel the effect of \makeatletter


%%%% Listing - settings

% rename listings
\renewcommand{\lstlistlistingname}{Kode-lister} 


\lstset{
%    %language=Java,  % Language
    flexiblecolumns=true,
    breaklines=true,
    breakautoindent=true,
    keywords={for, hvis, ellers, i, returner, sålænge},      
    keywordstyle=\bfseries,
    extendedchars=true, 
    basicstyle=\ttfamily,
    stringstyle=\ttfamily,
    tabsize=3,
    stepnumber=3,
%    linewidth=0.8\linewidth,
%    fontadjust=true,
    mathescape=true,
    escapechar=¤
}     
