%%
%% This is file `Mathmode.ltx',
%%
%% IMPORTANT NOTICE:
%%
%% Herbert Voss <voss@pstricks.de>
%% 2005-06-30
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `Mathmode' is a document how the math mode works inside LaTeX
%%
\listfiles
\documentclass[11pt,a4paper,english]{article}
\usepackage{fixltx2e}%% the official fixes for LaTeX2e
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
%\usepackage{lmodern}
%
\usepackage{ifpdf}
\usepackage{ifvtex}
\ifvtex\pdffalse\fi
\usepackage{comment}
\usepackage{graphicx}
\usepackage{varwidth}
\usepackage{array}
\usepackage{delarray}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsopn}
\usepackage{bm}
\usepackage{upgreek}
\usepackage{cancel}
\newcommand\hcancel[2][black]{\setbox0=\hbox{#2}%
	\rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}}#2}
\DeclareMathOperator{\Res}{Res}
\usepackage{amscd}
\usepackage{accents}
\usepackage{dsfont}
\usepackage{multirow}
\usepackage{bigdelim}
\usepackage{framed}
\usepackage{longtable}
\usepackage{varioref}
%
\ifvtex
  \usepackage{pstricks}
  \usepackage{pst-node}
\else\ifpdf\usepackage{xcolor}\else
  \usepackage{pstricks}
  \usepackage{pst-node}
\fi\fi
\usepackage{makeidx}
\makeindex
\usepackage{url}
\usepackage{setspace}
\usepackage{framed}
%
%
\DeclareMathDelimiter{\Norm}
   {\mathord}{largesymbols}{"3E}{largesymbols}{"3E}
%
\makeatletter
\def\mathllap{\mathstrut\mathpalette\mathllapinternal}
%\def\mathllap{\mathpalette\mathllapinternal}
\def\mathllapinternal#1#2{%
	\llap{$\mathsurround=0pt#1{#2}$}%
}
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
\def\mathclap{\mathpalette\mathclapinternal}
\def\mathclapinternal#1#2{%
	\clap{$\mathsurround=0pt#1{#2}$}%
}

\def\mathrlap{\mathpalette\mathrlapinternal}
\def\mathrlapinternal#1#2{%
	\rlap{$\mathsurround=0pt#1{#2}$}%
}
\def\bijmap{\ensuremath{%
	\mathrlap{\rightarrowtail}\rightarrow}}
% extensible Arrow
\newcommand{\xLongLeftRightArrow}[2][]{%
    \ext@arrow 0055{\LongLeftRightArrowfill@}{#1}{#2}}
\def\LongLeftRightArrowfill@{%
	\arrowfill@\Leftarrow\Relbar\Rightarrow}
\newcommand\xlongleftrightarrow[2][]{%
    \ext@arrow 0055{\longleftrightarrowfill@}{#1}{#2}}
\def\longleftrightarrowfill@{%
	\arrowfill@\leftarrow\relbar\rightarrow}
%
%
\def\@bracketheight{2pt}
\def\underbracket{\@ifnextchar[{\@underbracket}{\@underbracket[\@bracketheight]}}
\def\@underbracket[#1]{\@ifnextchar[{\@under@bracket[#1]}{\@under@bracket[#1][0.4em]}}
\def\@under@bracket[#1][#2]#3{%\message {Underbracket: #1,#2,#3}
   \mathop {\vtop {\m@th \ialign {##\crcr $\hfil \displaystyle {#3}\hfil $%
      \crcr \noalign {\kern 3\p@ \nointerlineskip }\upbracketfill{#1}{#2}
      \crcr \noalign {\kern 3\p@ }}}}\limits}
\def\upbracketfill#1#2{$\m@th \setbox \z@ \hbox {$\braceld$}
   \edef\@bracketheight{\the\ht\z@}\bracketend{#1}{#2}
     \leaders \vrule \@height #1 \@depth \z@ \hfill
     \leaders \vrule \@height #1 \@depth \z@ \hfill \bracketend{#1}{#2}$}
\def\bracketend#1#2{\vrule height #2 width #1\relax}
\def\overbracket{\@ifnextchar[{\@overbracket}{\@overbracket[\@bracketheight]}}
%
\def\@overbracket[#1]{\@ifnextchar[{\@over@bracket[#1]}{\@over@bracket[#1][0.3em]}}
\def\@over@bracket[#1][#2]#3{%\message {Overbracket: #1,#2,#3}
   \mathop {\vbox {\m@th \ialign {##\crcr \noalign {\kern 3\p@
   \nointerlineskip }\downbracketfill {#1}{#2}
        \crcr \noalign {\kern 3\p@ }
        \crcr  $\hfil \displaystyle {#3}\hfil $%
        \crcr} }}\limits}
\def\downbracketfill#1#2{$\m@th \setbox \z@ \hbox {$\braceld$}
    \edef\@bracketheight{\the\ht\z@}\downbracketend{#1}{#2}
    \leaders \vrule \@height #1 \@depth \z@ \hfill
    \leaders \vrule \@height #1 \@depth \z@ \hfill
\downbracketend{#1}{#2}$}
\def\downbracketend#1#2{\vrule depth #2 width #1\relax}
%
\def\rightharpoondownfill@{%
	\arrowfill@\relbar\relbar\rightharpoondown}
\def\rightharpoonupfill@{%
	\arrowfill@\relbar\relbar\rightharpoonup}
\def\leftharpoondownfill@{%
	\arrowfill@\leftharpoondown\relbar\relbar}
\def\leftharpoonupfill@{%
	\arrowfill@\leftharpoonup\relbar\relbar}
\newcommand{\xrightharpoondown}[2][]{%
	\ext@arrow 0359\rightharpoondownfill@{#1}{#2}}
\newcommand{\xrightharpoonup}[2][]{%
	\ext@arrow 0359\rightharpoonupfill@{#1}{#2}}
\newcommand{\xleftharpoondown}[2][]{%
	\ext@arrow 3095\leftharpoondownfill@{#1}{#2}}
\newcommand{\xleftharpoonup}[2][]{%
	\ext@arrow 3095\leftharpoonupfill@{#1}{#2}}
\newcommand{\xleftrightharpoons}[2][]{\mathrel{%
	\raise.22ex\hbox{%
		$\ext@arrow 3095\leftharpoonupfill@{\phantom{#1}}{#2}$}%
	\setbox0=\hbox{%
		$\ext@arrow 0359\rightharpoondownfill@{#1}{\phantom{#2}}$}%
	\kern-\wd0 \lower.22ex\box0}%
}
\newcommand{\xrightleftharpoons}[2][]{\mathrel{%
	\raise.22ex\hbox{%
		$\ext@arrow 3095\rightharpoonupfill@{\phantom{#1}}{#2}$}%
	\setbox0=\hbox{%
		$\ext@arrow 0359\leftharpoondownfill@{#1}{\phantom{#2}}$}%
	\kern-\wd0 \lower.22ex\box0}%
}

\usepackage{empheq}% defines also harpoon macros

\newcommand*{\threesim}{%
  \mathrel{\vcenter{\offinterlineskip
  \hbox{$\sim$}\vskip-.35ex\hbox{$\sim$}\vskip-.35ex\hbox{$\sim$}}}}
%
\newcounter{subequation}
%
\newlength\mtabskip\mtabskip=-1.25cm
%
\newcommand\eqnCnt[1][]{%
	\refstepcounter{subequation}%
	\begin{align}#1\end{align}%
	\addtocounter{equation}{-1}%
}
\def\mtabLong{long}
\makeatletter
\newenvironment{mtabular}[2][\empty]{%
  \parindent=0pt%
  \def\@xarraycr{%
    \global\stepcounter{equation}%
    \setcounter{subequation}{0}%
    \@ifnextchar[\@argarraycr{\@argarraycr[\mtabskip]}%
  }
  \let\theoldequation\theequation%
  \renewcommand\theequation{\theoldequation.\alph{subequation}}
  \edef\mtabOption{#1}
  \setcounter{subequation}{0}%
  \tabcolsep=0pt
  \ifx\mtabOption\mtabLong\longtable{#2}\else\tabular{#2}\fi%
}{%
  \ifx\mtabOption\mtabLong\endlongtable\else\endtabular\fi%
  \let\theequation\theoldequation%
  \stepcounter{equation}
}
%
\makeatother
\def\zero{\multicolumn{1}{>{\columncolor{white}}c}{0}}
\def\colCell#1#2{\multicolumn{1}{>{\columncolor{#1}}c}{#2}}
%% For printing a cirumflex inside a formula
\newcommand{\mathcircumflex}[0]{\mbox{\^{}}}
\providecommand{\tabularnewline}{\\}
\usepackage{exscale}
\usepackage{relsize}
\usepackage{xspace}
\usepackage[mathscr]{eucal}
\usepackage{dsfont}
\usepackage[bottom]{footmisc}
\usepackage{esint}
\usepackage{esvect}
\usepackage{remreset}
\usepackage{calc}
\usepackage{xypic}
\usepackage{fancyhdr}
%
\pagestyle{fancy}
\lfoot{\footnotesize\ttfamily\jobname.tex}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
%
\definecolor{umbra}{rgb}{0.8,0.8,0.5}
\definecolor{gray90}{gray}{0.9}
%
\addtocontents{toc}{\hfill Page\endgraf\vspace{-4ex}}
\addtocontents{lof}{\ Figure\hfill Page}
\addtocontents{lot}{\ Table\hfill Page}
\let\myPart\part
\renewcommand\part[1]{\clearpage\myPart{#1}}
%
%%%%%%%%%%%%% Math symbols %%%%%%%%%%%%%%%%%
\newcommand{\mysin}{\operatorname{mysin}}
\newcommand{\eqdef}{\ensuremath{\stackrel{\mathrm{def}}{=}}}
\newcommand{\eqexcl}{\ensuremath{\stackrel{\mathrm{!}}{=}}}
\newcommand{\eqhat}{\ensuremath{\widehat{=}}}
%
\newlength{\fullwidth}
\setlength\fullwidth{\textwidth}
\addtolength\fullwidth{\marginparsep}
\addtolength\fullwidth{\marginparwidth}
%
\newlength{\LBoxWidth}
\newcommand{\LyXBox}[1]{%
  \settowidth{\LBoxWidth}{#1}
  \fbox{\parbox[c]{\LBoxWidth}{#1}}\xspace%
}
\let\mpar\marginpar
\renewcommand\marginpar[1]{%
  \mpar{\small #1}%
}
\newcommand{\logo}{%
  \bgroup
  \psset{unit=1in,linewidth=2pt}
  \psline(-2.5,2.5)(-2.5,-\paperheight)
  \psline(-2,2.5)(-2,-\paperheight)
  \rput[lb]{90}(-2.05,-0.7\paperheight){\red\Huge\textbf{\AllTeX}}
  \rput[lb]{90}(-2.15,-0.1\paperheight){\red\Huge\textbf{Documentation}}
  \egroup
}
\newcommand*{\CMD}[1]{\texttt{\textbackslash#1}}
%
\makeatletter
\def\La{%
  L\kern-.36em{%
    \setbox0\hbox{T}%
    \vbox to\ht0{%
      \hbox{$\m@th$%
        \csname S@\f@size\endcsname
        \fontsize\sf@size\z@
        \math@fontsfalse\selectfont A}%
      \vss%
    }%
  }%
}
\def\AllTeX{(\La\kern-.075em)\kern-.075em\TeX\xspace}
\def\AMS{American Mathematical Society\xspace}
\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
    {$\mathcal{M}$}\kern-.125em$\mathcal{S}$\xspace}
\def\AmSmath{\AmS{}math\xspace}
\def\AmSLaTeX{\AmS-\LaTeX\xspace}
\def\AmSTeX{\AmS-\TeX\xspace}
\makeatother
%
\def\cIndex#1{\index{#1@\CMD{#1}}}
%
\usepackage{showexpl}
\lstset{language=[AlLaTeX]TeX}
%
\usepackage[%
	pdftitle={TeX Mathmode},%
	pdfauthor={Herbert Voss},%
	urlcolor=blue,%
	linktocpage,%
	a4paper,%
	colorlinks=true]{hyperref}
\usepackage{hypcap}
\usepackage{babel}

\def\tIndex#1{\index{#1@{\UrlFont\texttt{#1}}}}
\def\cIndex#1{\index{#1@\CMD{#1}}}
\def\pIndex#1{\index{Parameter@\textbf{Parameter}!{\UrlFont\texttt{#1}}}}
\def\PIndex#1{\index{Paket@\textbf{Paket}!\texttt{#1}}}

\usepackage{braket}% there were problems when loading before other packages ...

\begin{document}

\input{Mathmode.tex}
%\input{test.tex}

\end{document}
