\providecommand{\A}{\ensuremath{\mathcal{A}}\xspace}
\providecommand{\C}{\ensuremath{\mathcal{C}}\xspace}
\providecommand{\N}{\ensuremath{\mathbbm{N}}\xspace}
\providecommand{\No}{\ensuremath{\mathbbm{N}_0}\xspace}
\providecommand{\grad}{\ensuremath{^\circ}}

\providecommand{\Punkte}[2][0]{%
  \hspace{\stretch{1}\hbox{%
      (#2 Punkt%
      \ifnum #2=1\else
      e\fi)%
      }}%
  \ifnum #1<2\newline\textbf{Lösung}:\fi
  \ifnum #1<1\newline\fi
  }
\providecommand{\Punkt}[1]{\hspace{\stretch{1}\hbox{(#11 Punkt)}}\\}
\providecommand{\Punkts}[1]{\hspace{\stretch{1}\hbox{(#1 Punkte)}}\\}

\ifx\main\undefined
  \documentclass[10pt,german,a4paper,draft]{article}

  \usepackage[T1]{fontenc}
  \usepackage[latin1]{inputenc}
  \usepackage{babel}
  \usepackage{booktabs}
  \usepackage{enumerate,array}
  \usepackage{euler,bbm,ulsy,latexsym,amsmath,amssymb}
  \usepackage{pstricks}
  \usepackage{floatflt}
  \usepackage{fancyhdr}
  \pagestyle{fancy}
  \usepackage{xspace}

  \addtolength{\oddsidemargin}{-1cm}
  \addtolength{\textwidth}{2cm}
  \renewcommand{\headwidth}{\textwidth}
  \setlength{\headheight}{12.6pt}

  %%\addtolength{\labelsep}{-2cm}
  \addtolength{\itemindent}{2cm}

  \newcounter{blattnr}
  \newenvironment{mydocument_low}[2]{
    \fancyhead[L]{Adam Duck ($1729047$)}
    \fancyhead[C]{#2}
    \setcounter{blattnr}{#1}
    \ifx\main\undefined
      \author{Adam Duck}
      \begin{document}
      \ifnum #1=0
        \title{#2\\Alle Lösungsblätter}
      \else
        \title{#2\\#1. Übungsblatt}
      \fi
      \maketitle
      \ifnum #1=0
        \begin{center}
          \tableofcontents
        \end{center}
      \fi
    \else
      \section{Übungsblatt}
    \fi
    \fancyhead[R]{#1. Übungsblatt}
    }{
%    \ifx\main\undefined
%      \end{document}
%    \fi
    }
\fi
\renewcommand{\labelenumi}{%
  \bfseries\theblattnr.\arabic{enumi}%
  \addcontentsline{toc}{subsection}{Aufgabe \theblattnr.\arabic{enumi}}%
  }
\makeatletter
\@addtoreset{equation}{enumi}
\renewcommand{\theequation}{\arabic{enumi}.\arabic{equation}}
\let\savetheequation\theequation
\makeatother