%nodocumentroot
\documentclass[a4paper, 10pt]{article}
%% add 'fleqn' to the optons above for eq to be flushed left

% toitsch
\usepackage[latin1]{inputenc}
\usepackage{ngerman}

% maddematisch
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[amssymb,textstyle,thinspace,thinqspace]{SIunits}

\newcommand{\fracop}[2]{\ensuremath{\,\frac{\textrm{#1}}{\textrm{#2}}}}
\newcommand{\subrm}[1]{\ensuremath{_{\textrm{#1}}}}
\newcommand{\m}{\cdot}
\newcommand{\E}[1]{\ensuremath{\m 10^{#1}}}
\newcommand{\fracd}[3]{\frac{\textrm d^{#3} #1}{\textrm d #2^{#3}}}
\newcommand{\fracdel}[3]{\frac{\partial^{#3} #1}{\partial #2^{#3}}}
\newcommand{\fracdelta}[3]{\frac{\delta^{#3} #1}{\delta #2^{#3}}}
\newcommand{\fracD}[2]{\frac{\Delta #1}{\Delta #2}}
\newcommand{\relErr}[1]{\ensuremath{\frac{\left|\delta #1\right|}{\left|#1\right|}}}
\newcommand{\absErr}[1]{\ensuremath{\left|\delta #1\right|}}
\newcommand{\dif}{\,\textrm d}
\renewcommand{\div}{\operatorname{div}}
\newcommand{\rot}{\operatorname{rot}}
\newcommand{\grad}{\operatorname{grad}}
\newcommand{\const}{\operatorname{const}}
\newcommand{\qed}{\begin{flushright}\textbf{q.e.d.}\end{flushright}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
%\renewcommand{\iff}{\ensuremath{\Leftrightarrow}} % ``if and only if''
\newcommand{\I}{\int\limits}

% logisch
\usepackage{ifthen}

% layout
\usepackage{graphicx}
\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2cm,includeheadfoot]{geometry}

\usepackage{fancyhdr}
\lhead{\fancyplain{}{AP}} %% needs to redifined before 1st page-> env Deckblatt
\rhead{\fancyplain{}{\thepage}}
\cfoot{\fancyplain{}{}}
\pagestyle{fancyplain}

\setlength{\parskip}{5pt plus 5pt minus 1pt}
\setlength{\parindent}{0pt}
\flushbottom

%% version for web publish should define \phiOnlinePublish
%% before including APdefaults
\ifthenelse{\isundefined{\phiOnlinePublish}}
{}
{\cfoot{\textit{ Ich
      veröffentliche meine Protokolle in der Hoffnung, dass sie für
      andere Teilnehmer am AP hilfreich sind.} Und du?}
}

% indernett
\usepackage{url}


% gnumeric tables

\def\inputGnumericTable{}                                 

%\usepackage[latin1]{inputenc}                                 %%
\usepackage[monochrome]{color}                                            %%
\usepackage{array}                                            %%
\usepackage{longtable}                                        %%
\usepackage{calc}                                             %%
\usepackage{multirow}                                         %%
\usepackage{hhline}                                           %%
%\usepackage{ifthen}                                           %%
%%  optionally (for landscape tables embedded in another document): %%
%%    \usepackage{lscape}                                           %%
%%                                                                  %%
%%  In addition the following commands need to be executed in the   %%
%%  preamble:                                                       %%
%%                                                                  %%
\newlength{\gnumericTableWidth}                                 %%
\newlength{\gnumericTableWidthComplete}                         %%


% centered framed tabular env
\newenvironment{FTabular}[2]
  {
    \begin{center}
    \begin{tabular}{|#1|}
      \hline
      #2\\
      \hline
      \hline
  }{\\
    \hline
    \end{tabular}
    \end{center}
    \par
    \noindent
  }


% debug
\newcommand{\APdefaultsBox}[2]{\par\noindent\fbox{\textbf{#1} #2}\par}
\newcommand{\TODO}[1]{\APdefaultsBox{TODO}{#1}}
\newcommand{\READ}[1]{\APdefaultsBox{READ}{#1}}
\newcommand{\IMG}[1]{\APdefaultsBox{ADD IMAGE}{#1}}

%% bibliography
\newcommand{\BibItemWiki}
{\item
  Wikipedia, die freie Enzyklopädie\\
  \url{http://de.wikipedia.org}
}
\newcommand{\BibItemRunge}{
\item
  Bernd-Uwe Runge:
  Versuchsanleitungen zum physikalischen Anfängerpraktikum\\
  \url{http://ap.physik.uni-konstanz.de/Anleitungen.html}
}
\newcommand{\BibItemBeste}{
\item
  Beste:
  Versuchsanleitungen zum physikalischen Anfängerpraktikum\\
  1994
}
\newcommand{\BibItemGerthsen}{
\item
  Dieter Meschede: Gerthsen -- Physik\\
  21. Auflage, 2002, Springer
}
\newcommand{\BibItemStoecker}{
\item
  Horst Stöcker: Taschenbuch der Physik\\
  5. Auflage, 2004, Verlag Harri Deutsch
}



%%%% cover
%% no longer on a seperate page

% Usage:
% \begin{document}
% \begin{Deckblatt}{Versuch}{Datum}{name1}{name2}
% \end{Deckblatt}
% \end{document}


\newcommand{\APAuthorAbbr}[1]{
  \ifthenelse{\equal{#1}{jan}}
  {Jan Korger, Studiengang Physik-Diplom}
  {}
  \ifthenelse{\equal{#1}{sonja}}
  {Sonja Bernhardt, Studiengang Physik-Diplom}
  {}
  \ifthenelse{\equal{#1}{thomas}}
  {Thomas Lauermann, Studiengang Physik-Diplom}
  {}
  \ifthenelse{\equal{#1}{thomasW}}
  {Thomas Wurth, Studiengang Physik-Diplom}
  {}
  \ifthenelse{\equal{#1}{nina}}
  {Nina Laible, Studiengang Biologie-Diplom}
  {}
  \ifthenelse{\equal{#1}{marcW}}
  {Marc Weber, Studiengang Physik-Diplom}
  {}
  \ifthenelse{\equal{#1}{matS}}
  {Matthias Schork, Studiengang Physik, Mathematik (Lehramt)}
  {}
}

\newenvironment{Deckblatt}[4]{
  \begin{center}
    {\Large
      Physikalisches Anfängerpraktikum\\
      an der Universität Konstanz:\\
      \medskip
      % titel
      \textbf{#1}\\
    }
    {\large
      \bigskip
      Experiment durchgeführt am #2\\
      \bigskip
      \APAuthorAbbr{#3}
      \ifthenelse{\equal{#4}{}}
      {}
      {\\\APAuthorAbbr{#4}}
      \\
   }
  \end{center}
  %\maketitle
  \thispagestyle{plain}

  \bigskip
  %% \vfill

  %% redefine header to include title
  \lhead{\fancyplain{}{AP: #1}}
  \rhead{\fancyplain{}{#2 Seite \thepage}}
}{
%%  \pagebreak[4]
}
