\documentclass[pdftex,ngerman,a4paper,titlepage,oneside,11pt,
               abstractoff,pagesize,bibtotoc,pointlessnumbers]{scrartcl}
               % liststotoc, openbib?
\usepackage[automark,headsepline]{scrpage2}   % page layout, head & foot
\usepackage{lastpage}   % ermöglicht \pageref{LastPage}
\usepackage{setspace}   % \singlespacing, \onehalfspacing, \doublespacing
\usepackage{afterpage}

%\setlength{\topmargin}{-0.4in}
%\setlength{\topskip}{0.3in}    % between header and text
%\setlength{\textheight}{9.5in} % height of main text
%\setlength{\textwidth}{6in}    % width of text
%\setlength{\oddsidemargin}{0.75in} % odd page left margin
%\setlength{\evensidemargin}{0.75in} % even page left margin
%\usepackage[left=2cm,top=1cm,bottom=2cm,right=3cm,
%            nohead,nofoot]{geometry}

%%%\usepackage[left=3.0cm,right=4cm]{geometry}

%\addtolength{\evensidemargin}{1cm}
%\addtolength{\oddsidemargin}{0.5cm}
%%\addtolength{\textwidth}{-1.5cm}
%%\addtolength{\textheight}{2cm}

\usepackage{layout}     % ermöglicht \layout zum Anzeigen der
                        % Seitengeometrie
\usepackage{babel}      % dt. Übersetzungen f. ``Kapitel'', etc.
\usepackage[latin1]{inputenc}   % Umlaute
\usepackage{ngerman}            % hyphenation
%\usepackage[multiple,marginal]{footmisc}   % [hyperfootnotes=false]hyperref
%\setlength{\footnotemargin}{1em}

\usepackage[T1]{fontenc}
\usepackage{textcomp} 

\usepackage{mdwlist}    % compact itemize* environments
\usepackage{booktabs}   % hübschere Tabellen
%\usepackage{flafter}    % float-Umgebungen immer hinter der Deklaration

\usepackage{lmodern}
\usepackage{courier}     % 
%\usepackage{newcent}    % New Century Schoolbook + Avant Garde + Courier
%\usepackage{bookman}    % Bookman + Avant Garde + Courier
%\usepackage[scaled=0.92]{helvet} % use with newcent and mathpazo
%\usepackage{pslatex}    % Times, Helvetica, (narrow) Courier
%\usepackage{avant}
%\usepackage{pxfonts}   % Palatino

%\renewcommand{\ttdefault}{pxtt}        % Palatino
%%%\usepackage{charter}
%%%\usepackage[scaled=0.90]{berasans}
%%%\usepackage[scaled=0.85]{beramono}
%
%%%%\usepackage[scaled=0.90]{beraserif}

\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}

%\usepackage{alltt}
%\usepackage{calc}

\usepackage[activate,final]{microtype} % optischer Randausgleich

\usepackage{nameref} % \nameref -> titel
\usepackage[square]{natbib}
\bibliographystyle{natdin} % -> natdin.bst
%\bibpunct   {} {} {;}{a}{} {,}
%\bibpunct[,]{(}{)}{;}{a}{,}{,} % default

\usepackage{varioref}
\usepackage[final]{listings}
\lstset{
  basicstyle=\ttfamily \small,
  keywordstyle=\bfseries,
  identifierstyle=,
  commentstyle=\itshape,
  stringstyle=,
  escapeinside={"""}{"""},
  showstringspaces=false,
  breaklines=true,
  breakatwhitespace=true,
  numbers=left,
  stepnumber=1,
  firstnumber=auto,
  numberfirstline=true,
  numberstyle=\tiny,
  extendedchars=true,
  backgroundcolor=\color{white!75!gray},
%  aboveskip=1.5em,
%  belowskip=0.5em,
  float=tbp,
  captionpos=b,
  frame=single,
  framerule=0.0em,
  language=Python
}
%\usepackage{syntax} % evtl. für BNF
\usepackage[hyphens]{url} % allow line breaks in urls after a hyphen
%\UrlNoBreaks=\do\:
\usepackage[backref=none,colorlinks]{hyperref}
\hypersetup{%
  pdfsubject={Moderne Softwaretechnologien},
  pdftitle={Python},
  pdfauthor={Jochen Schulz <jrschulz@well-adjusted.de>},
  pdfkeywords={python, types, objects, attribute, descriptor,
               decorator, metaclass, operator overloading,
               Nordakademie, Moderne Softwaretechnologien},
  plainpages=false, % notwendig, wenn man verschiedene
                    %  Seitennumerierungsstile benutzt
  colorlinks=true,
  bookmarksnumbered,
  bookmarksopen=false,
  breaklinks=true,
  pdfstartview={FitH},
  urlcolor=MidnightBlue,
  linkcolor=Sepia,
  anchorcolor=black,
  citecolor=Brown,
  pagecolor=red,
}%


%\deffootnote{1em}{1em}{\thefootnotemark\ }
%%%\deffootnote{1.5em}{1em}{%
%%%\makebox[1.5em][l]{\thefootnotemark}}


%\renewcommand{\thepage}{\Roman{page}}
%\renewcommand{\thepage}{\arabic{page}}
%\setcounter{page}{1}


\newpagestyle{nak}
% (OLL,OLD){GS}{US}{ES}(ULL,ULD)
% (OLL,OLD){GS}{US}{ES}(ULL,ULD)
{ {}
  {}
  {\hfill\headmark}
  %%%{\rlap{}\hfill
  %%%\includegraphics[height=1.0\headsep]{img/NAlogoneu.jpg}\hfill\llap\headmark}
  %{\includegraphics[height=1.0\headsep]{img/NAlogoneu.jpg}\hfill\llap\headmark}
}
{ {}
  {}
  {\hfill \thepage}
}

\setheadtopline{0pt}
\setheadsepline{0.5pt}
\setfootsepline{0.5pt}
%\setfootbotline{0.5pt}
\setfootwidth[0pt]{head}

%\addtolength{\headheight}{\baselineskip} % needed with pagestyle nak
\pagestyle{nak}
\automark{section}

%\ihead[scrplain-innen]{scrheadings-innen}
%\chead[scrplain-zentriert]{scrheadings-zentriert}
%\ohead[scrplain-außen]{scrheadings-außen}
%\ifoot[scrplain-innen]{scrheadings-innen}
%\cfoot[scrplain-zentriert]{scrheadings-zentriert}
%\ofoot[scrplain-außen]{scrheadings-außen}

%\ifoot{\title}
%\cfoot{}
%\ofoot{\pagemark}

\hyphenation{Unix}


%% Definition for Big letter at the beginning of a paragraph
%\def\PARstart#1#2{\begingroup\def\par{\endgraf\endgroup\lineskiplimit=0pt}
%    \setbox2=\hbox{#2}\newdimen\tmpht \tmpht \ht2
%    \advance\tmpht by \baselineskip\font\hhuge=cmr10 at \tmpht
%    \setbox1=\hbox{{\hhuge #1}}
%    \count7=\tmpht \count8=\ht1\divide\count8 by 1000 \divide\count7 by\count8
%    \tmpht=.001\tmpht\multiply\tmpht by \count7\font\hhuge=cmr10 at \tmpht
%    \setbox1=\hbox{{\hhuge #1}} \noindent \hangindent1.05\wd1
%    \hangafter=-2 {\hskip-\hangindent \lower1\ht1\hbox{\raise1.0\ht2\copy1}%
%    \kern-0\wd1}\copy2\lineskiplimit=-1000pt}

% \PARstart{H}ello world!
