\documentstyle[titlepage,fdg,german]{article}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\parindent}{0mm}
\setlength{\textwidth}{15.5cm}
\addtolength\topmargin{-27pt}
\addtolength\textheight{68pt}
 
\newcommand\exa{\nopagebreak \begin{flushleft}\smallskip \nopagebreak}
\newcommand\exb{\hspace{1cm}\begin{minipage}[b]{8cm}\sloppy }
\newcommand\exc{\end{minipage} \smallskip\end{flushleft}}
 
\newcommand\oben[1]{\begin{center}\begin{minipage}{#1}\hrule\medskip}
\newcommand\unten{\hrule \end{minipage}\end{center}}
 

\title{Flu"sdiagramme mit \TeX}

\author{Jens Franzen}

\date{30. M"arz\\              % Keep this date current
F"ur \LaTeX\ Version 2.09} 

\begin{document}

\maketitle

\tableofcontents

\newpage
\section{Einf"uhrung}
Am Laboratorium f"ur Informationstechnologie steht eine spezielle 
Documentstyle-Option {\bf fdg } zum Erstellen von Flu"sdiagrammen zur 
Verf"ugung.

\section{Aufbau}

Zur Dokumentation wird "uber das auf dem Papier vorgezeichnete Flu"sdiagramm
ein Raster gelegt, anhand dessen dann die einzelnen Elemente plaziert werden 
k"onnen. Die obere linke Ecke erh"alt die Postion {\tt (1,1)}, die dritte
von oben in der vierten Spalte von links {\tt (4,3)}. Mit dem Kommando
\verb|\fdgput(4,3)| wird die aktuelle Position auf {\tt (4,3)} gesetzt, 
dort wird das n"achste Element plaziert. Anfangs ist die aktuelle Position 
{\tt (1,1) }, nach jedem gesetzten Element wird die darunter liegende
Position zur aktuellen. Mit den Kommandos 
\oben{7.5cm}
\begin{verbatim}
\begin{frameflowchart}{4}{4}{1cm}
                  \fdganwtb{Anw. (1,1) }
     \fdgput(4,3) \fdganwtb{Anw. (4,3) }
                  \fdganwtb{Anw. (4,4) }
\end{frameflowchart}
\end{verbatim}
\unten
wird das folgende $4 cm$ hohe und $8 cm$ breite ''Flu"sdiagramm'' erzeugt :
\begin{center}
\begin{frameflowchart}{4}{4}{1cm}
\fdganwtb{Anw. (1,1) }
\fdgput(4,3) \fdganwtb{Anw. (4,3)}
             \fdganwtb{Anw. (4,4)}
\put(2,0){\line(0,1){4}}
\put(4,0){\line(0,1){4}}
\put(6,0){\line(0,1){4}}
\put(0,3){\line(1,0){8}}
\put(0,2){\line(1,0){8}}
\put(0,1){\line(1,0){8}}
\end{frameflowchart}
\end{center}
In diesem Bild sind die Hilfslinien zus"atzlich dargestellt.
Die Umrandung wird mit dem {\tt frameflowchart}-Environment erzeugt,
ein Flu"sdiagramm ohne Umrandung erh"alt man mit dem 
{\tt flowchart}-Environment.
Das {\tt flowchart}-Environment ist "ahnlich wie ein 
{\tt picture}-Environment aufgebaut. Daher k"onne auch die 
Standard-Graphik-Elemente des {\tt picture}-Environments verwendet werden,
allerdings sind die Koordinaten dann entsprechend der f"ur das 
{\tt picture}-Environment g"ultigen Konvention anzugeben. Im obigem
Flu"sdiagramm entspricht das \verb|\fdgput(4,3)| weitgehend einem 
\verb|\put(8,1)| ( wegen $8=2*4$, $1=4-3$ ), allerdings wird die aktuelle 
Position durch das \verb|\put(8,1)| nicht korrekt gesetzt.

Zus"atzlich zu den im n"achsten Abschnitt genannten Element gibt es noch weitere
Makros, die {\tt if-then-else, repeat-until} u. "a. Strukturen einfach
erzeugen k"onnen.
   
\section{Elemente}
Alle in diesem Abschnitt genannten Element belegen ein Element des Rasters.
Die letzten Buchstaben der Namen geben die Lagen von Pfeilen oder Linien an :
\begin{center}
\begin{tabular}{|c|l|}\hline
t & oben \\
b & unten \\
r & rechts \\
l & links \\ \hline
\end{tabular}
\end{center}

\subsection{Einfache Verbindungen}

\exa
\begin{frameflowchart}{2}{3}{1cm}
\fdgbr 
\fdgbl\fdgtr
\fdgput(2,1) \fdgtb\fdglr\fdgtl
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{2}{3}{1cm}
\fdgbr\fdgbl\fdgtr
\fdgput(2,1) \fdgtb\fdglr\fdgtl
\end{frameflowchart}
\end{verbatim}
\exc

\subsection{Einfache Zusammenf"uhrungen}

\exa\small\begin{frameflowchart}{3}{4}{1cm}
\fdgcontrbol\fdgconltrob
\fdgconbltor\fdgconrblot
\fdgput(2,1)
\fdgcontrol\fdgcontbol
\fdgconblor\fdgconbtor
\fdgput(3,1)
\fdgconltor\fdgconrbot
\fdgconrlot\fdgconblot
\end{frameflowchart}    
\exb\begin{verbatim}
\begin{frameflowchart}{2}{4}{1cm}
\fdgcontrbol\fdgconltrob
\fdgconbltor\fdgconrblot
\fdgput(2,1)
\fdgcontrol\fdgcontb
\fdgconblor\fdgconbtor
\fdgout(3,1)
\fdgconltor\fdgconrbot
\fdgconrlot\fdgconblot
\end{frameflowchart}
\end{verbatim}
\exc

\subsection{Label}
\exa\small\begin{frameflowchart}{2}{4}{1cm}
\fdgsoutt{fdgsoutt} \fdgsoutb{fdgsoutb}
\fdgsoutl{fdgsoutl} \fdgsoutr{fdgsoutr}
\fdgput(2,1)\fdggoutt{fdggoutt} \fdggoutb{fdggoutb}
\fdggoutl{fdggoutl}  \fdggoutr{fdggoutr}
\end{frameflowchart}    
\exb\begin{verbatim}
\begin{frameflowchart}{2}{4}{1cm}
            \fdgsoutt{fdgsoutt} 
            \fdgsoutb{fdgsoutb}
            \fdgsoutl{fdgsoutl} 
            \fdgsoutr{fdgsoutr}
\fdgput(2,1)\fdggoutt{fdggoutt} 
            \fdggoutb{fdggoutb}
            \fdggoutl{fdggoutl}  
            \fdggoutr{fdggoutr}
\end{frameflowchart}
\end{verbatim}
\exc

\subsection{Anweisungen}
\exa\small\begin{frameflowchart}{3}{4}{1cm}
\fdganwlt{fdganwlt}
\fdganwlb{fdganwlb}
\fdganwlr{fdganwlt}
\fdganwrt{fdganwrt}
\fdgput(2,1) \fdganwrb{fdganwrb}  
\fdganwrl{fdganwrl}
\fdganwbt{fdganwbt}
\fdganwbl{fdganwbl}
\fdgput(3,1)\fdganwbr{fdganwbt}
\fdganwtl{fdganwtl}
\fdganwtb{fdganwtb}
\fdganwtr{fdganwtr}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{3}{4}{1cm}
\fdganwlt{fdganwlt}
\fdganwlb{fdganwlb}
\fdganwlr{fdganwlt}
\fdganwrt{fdganwrt}
\fdgput(2,1) \fdganwrb{fdganwrb}  
\fdganwrl{fdganwrl}
\fdganwbt{fdganwbt}
\fdganwbl{fdganwbl}
\fdgput(3,1)\fdganwbr{fdganwbt}
\fdganwtl{fdganwtl}
\fdganwtb{fdganwtb}
\fdganwtr{fdganwtr}
\end{frameflowchart}
\end{verbatim}
\exc

\exa
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgtwoanwlt{fdgtwoanwlt}{zweizeilig}
\fdgtwoanwlb{fdgtwoanwlb}{zweizeilig}
\fdgtwoanwlr{fdgtwoanwlt}{zweizeilig}
\fdgtwoanwrt{fdgtwoanwrt}{zweizeilig}
\fdgput(2,1)\fdgtwoanwrb{fdgtwoanwrb}{zweizeilig}
\fdgtwoanwrl{fdgtwoanwrl}{zweizeilig}
\fdgtwoanwbt{fdgtwoanwbt}{zweizeilig}
\fdgtwoanwbl{fdgtwoanwbl}{zweizeilig}
\fdgput(3,1)\fdgtwoanwbr{fdgtwoanwbt}{zweizeilig}
\fdgtwoanwtl{fdgtwoanwtl}{zweizeilig}
\fdgtwoanwtb{fdgtwoanwtb}{zweizeilig}
\fdgtwoanwtr{fdgtwoanwtr}{zweizeilig}
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{3}{4}{1cm}
\fdgtwoanwlt{fdgtwoanwlt}{zweizeilig}
\fdgtwoanwlb{fdgtwoanwlb}{zweizeilig}
\fdgtwoanwlr{fdgtwoanwlt}{zweizeilig}
\fdgtwoanwrt{fdgtwoanwrt}{zweizeilig}
\fdgput(2,1)\fdgtwoanwrb{fdgtwoanwrb}{zweizeilig}
\fdgtwoanwrl{fdgtwoanwrl}{zweizeilig}
\fdgtwoanwbt{fdgtwoanwbt}{zweizeilig}
\fdgtwoanwbl{fdgtwoanwbl}{zweizeilig}
\fdgput(3,1)\fdgtwoanwbr{fdgtwoanwbt}{zweizeilig}
\fdgtwoanwtl{fdgtwoanwtl}{zweizeilig}
\fdgtwoanwtb{fdgtwoanwtb}{zweizeilig}
\fdgtwoanwtr{fdgtwoanwtr}{zweizeilig}
\end{frameflowchart}
\end{verbatim}
\exc

\subsection{Unterprogramme}
\exa\small\begin{frameflowchart}{3}{4}{1cm}
\fdgsublt{fdgsublt}
\fdgsublb{fdgsublb}
\fdgsublr{fdgsublt}
\fdgsubrt{fdgsubrt}
\fdgput(2,1)\fdgsubrb{fdgsubrb}
\fdgsubrl{fdgsubrl}
\fdgsubbt{fdgsubbt}
\fdgsubbl{fdgsubbl}
\fdgput(3,1)\fdgsubbr{fdgsubbt}
\fdgsubtl{fdgsubtl}
\fdgsubtb{fdgsubtb}
\fdgsubtr{fdgsubtr}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgsublt{fdgsublt}
\fdgsublb{fdgsublb}
\fdgsublr{fdgsublt}
\fdgsubrt{fdgsubrt}
\fdgput(2,1)\fdgsubrb{fdgsubrb}
\fdgsubrl{fdgsubrl}
\fdgsubbt{fdgsubbt}
\fdgsubbl{fdgsubbl}
\fdgput(3,1)\fdgsubbr{fdgsubbt}
\fdgsubtl{fdgsubtl}
\fdgsubtb{fdgsubtb}
\fdgsubtr{fdgsubtr}
\end{frameflowchart}
\end{verbatim}
\exc

\exa
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgtwosublt{fdgtwosublt}{zweizeilig}
\fdgtwosublb{fdgtwosublb}{zweizeilig}
\fdgtwosublr{fdgtwosublt}{zweizeilig}
\fdgtwosubrt{fdgtwosubrt}{zweizeilig}
\fdgput(2,1)\fdgtwosubrb{fdgtwosubrb}{zweizeilig}
\fdgtwosubrl{fdgtwosubrl}{zweizeilig}
\fdgtwosubbt{fdgtwosubbt}{zweizeilig}
\fdgtwosubbl{fdgtwosubbl}{zweizeilig}
\fdgput(3,1)\fdgtwosubbr{fdgtwosubbt}{zweizeilig}
\fdgtwosubtl{fdgtwosubtl}{zweizeilig}
\fdgtwosubtb{fdgtwosubtb}{zweizeilig}
\fdgtwosubtr{fdgtwosubtr}{zweizeilig}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgtwosublt{fdgtwosublt}{zweizeilig}
\fdgtwosublb{fdgtwosublb}{zweizeilig}
\fdgtwosublr{fdgtwosublt}{zweizeilig}
\fdgtwosubrt{fdgtwosubrt}{zweizeilig}
\fdgput(2,1)\fdgtwosubrb{fdgtwosubrb}{zweizeilig}
\fdgtwosubrl{fdgtwosubrl}{zweizeilig}
\fdgtwosubbt{fdgtwosubbt}{zweizeilig}
\fdgtwosubbl{fdgtwosubbl}{zweizeilig}
\fdgput(3,1)\fdgtwosubbr{fdgtwosubbt}{zweizeilig}
\fdgtwosubtl{fdgtwosubtl}{zweizeilig}
\fdgtwosubtb{fdgtwosubtb}{zweizeilig}
\fdgtwosubtr{fdgtwosubtr}{zweizeilig}
\end{frameflowchart}
\end{verbatim}
\exc

\subsection{EIN- und Ausgabe}
\exa\small\begin{frameflowchart}{3}{4}{1cm}
\fdgiolt{fdgiolt}
\fdgiolb{fdgiolb}
\fdgiolr{fdgiolt}
\fdgiort{fdgiort}
\fdgput(2,1)\fdgiorb{fdgiorb}
\fdgiorl{fdgiorl}
\fdgiobt{fdgiobt}
\fdgiobl{fdgiobl}
\fdgput(3,1)\fdgiobr{fdgiobt}
\fdgiotl{fdgiotl}
\fdgiotb{fdgiotb}
\fdgiotr{fdgiotr}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgiolt{fdgiolt}
\fdgiolb{fdgiolb}
\fdgiolr{fdgiolt}
\fdgiort{fdgiort}
\fdgput(2,1)\fdgiorb{fdgiorb}
\fdgiorl{fdgiorl}
\fdgiobt{fdgiobt}
\fdgiobl{fdgiobl}
\fdgput(3,1)\fdgiobr{fdgiobt}
\fdgiotl{fdgiotl}
\fdgiotb{fdgiotb}
\fdgiotr{fdgiotr}
\end{frameflowchart}
\end{verbatim}
\exc

\exa
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgtwoiolt{fdgtwoiolt}{zweizeilig}
\fdgtwoiolb{fdgtwoiolb}{zweizeilig}
\fdgtwoiolr{fdgtwoiolt}{zweizeilig}
\fdgtwoiort{fdgtwoiort}{zweizeilig}
\fdgput(2,1)\fdgtwoiorb{fdgtwoiorb}{zweizeilig}
\fdgtwoiorl{fdgtwoiorl}{zweizeilig}
\fdgtwoiobt{fdgtwoiobt}{zweizeilig}
\fdgtwoiobl{fdgtwoiobl}{zweizeilig}
\fdgput(3,1)\fdgtwoiobr{fdgtwoiobt}{zweizeilig}
\fdgtwoiotl{fdgtwoiotl}{zweizeilig}
\fdgtwoiotb{fdgtwoiotb}{zweizeilig}
\fdgtwoiotr{fdgtwoiotr}{zweizeilig}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{3}{4}{1cm}
\fdgtwoiolt{fdgtwoiolt}{zweizeilig}
\fdgtwoiolb{fdgtwoiolb}{zweizeilig}
\fdgtwoiolr{fdgtwoiolt}{zweizeilig}
\fdgtwoiort{fdgtwoiort}{zweizeilig}
\fdgput(2,1)\fdgtwoiorb{fdgtwoiorb}{zweizeilig}
\fdgtwoiorl{fdgtwoiorl}{zweizeilig}
\fdgtwoiobt{fdgtwoiobt}{zweizeilig}
\fdgtwoiobl{fdgtwoiobl}{zweizeilig}
\fdgput(3,1)\fdgtwoiobr{fdgtwoiobt}{zweizeilig}
\fdgtwoiotl{fdgtwoiotl}{zweizeilig}
\fdgtwoiotb{fdgtwoiotb}{zweizeilig}
\fdgtwoiotr{fdgtwoiotr}{zweizeilig}
\end{frameflowchart}
\end{verbatim}
\exc
\subsection{Abfragen}
\exa\small\begin{frameflowchart}{2}{3}{1cm}
\fdgiftlr{fdgiftlr}
\fdgiftlb{fdgiftlb}
\fdgiftrl{fdgiftrl}
\fdgput(2,1)\fdgiftrb{fdgiftrb}
\fdgiftbl{fdgiftbl}
\fdgiftbr{fdgiftbr}
\end{frameflowchart}
\exb
\begin{verbatim}
\small\begin{frameflowchart}{2}{3}{1cm}
\fdgiftlr{fdgiftlr}
\fdgiftlb{fdgiftlb}
\fdgiftrl{fdgiftrl}
\fdgput(2,1)\fdgiftrb{fdgiftrb}
\fdgiftbl{fdgiftbl}
\fdgiftbr{fdgiftbr}
\end{frameflowchart}
\end{verbatim}
\exc

\section{If-Then-Else etc.}

Im Gegensatz zu den bisher beschriebenen Elementen haben die durch die Makros
\oben{9cm}
\begin{verbatim}
  \fdgwhiledo(1,1)[0.5]{Fertig ?}{ 
               ....   }
  \fdgrepeat(1,1)[0.5]{ 
                .... 
  }until{Fertig ?}
  \fdgdo(1,1)[0.5]{ 
               ..... 
  }while{Weiter ?}
  \fdgifthen(1,1)[0.5]{Links ?}{ 
               ...... }
  \fdgifelse(1,1){Links ?}{ 
           .......
        }{ ....... }
\end{verbatim}
\unten
erzeugten Strukturen keine feste Gr"o"se und unter ihnen bleibt zu 
definierender Platz frei ( hier jeweils
eine Fl"ache f"ur $1 * 1$ Elemente. Der Parameter in eckigen Klammern 
gibt an, wie 
weit die senkrechte Linie in die rechts folgende Spalte hineinragt, damit
k"onnen ohne weitere Spalten zu opfern, mehrere Schleifen "ubereinander 
gelegt werden. 
Die Plazierung der Anweisung in und nach den Befehlen wird automatisch 
richtig gemacht, vorausgestzt, die geschweiften Klammer sind 
richtig gesetzt.
Alle weitere Information wird am besten den Beispielen entnommen.

\exa
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgdo(1,1)[0.5]{
     \fdganwtb{Otto}
}while{Weiter ?}
\fdgput(1,5)\fdggoutt{Ende}
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgdo(1,1)[0.5]{
     \fdganwtb{Otto}
}while{Weiter ?}
\fdgput(1,5)\fdggoutt{Ende}
\end{frameflowchart}
\end{verbatim}
\exc


\exa
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgifthen(1,1)[0.5]{Links ?}{ \fdganwtb{Otto} } 
\fdggoutt{Ende}
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgifthen(1,1)[0.5]{Links ?}{ 
           \fdganwtb{Otto}   } 
\fdggoutt{Ende}
\end{frameflowchart}
\end{verbatim}
\exc


\exa
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgifelse(1,1){Links ?}{ 
           \fdganwtb{Otto} 
}{ \fdganwtb{Emil} }
\fdggoutt{Ende}
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{2}{5}{1cm}
\fdgginb{Start}
\fdgifelse(1,1){Links ?}{ 
           \fdganwtb{Otto} 
        }{ \fdganwtb{Emil} }
\fdggoutt{Ende}
\end{frameflowchart}
\end{verbatim}
\exc



\exa
\begin{frameflowchart}{3}{11}{1cm}
\fdgput(2,1)\fdgginb{Start}
\fdgwhiledo(1,2)[0.5]{Fertig ?}{
      \fdganwtb{Anw. 1}
      \fdganwtb{Anw. 2} }
\fdgbr
\fdganwtb{Anw. 3}
\fdganwtb{Anw. 4}
\fdgtb
\fdgdo(1,2)[0.5]{
     \fdganwtb{Otto}
     \fdganwtb{Otto}
}while{Weiter ?}
\fdggoutt{Ende}
\end{frameflowchart}
\exb
\begin{verbatim}
\begin{frameflowchart}{3}{11}{1cm}
\fdgput(2,1)\fdgginb{Start}
\fdgwhiledo(1,2){0.5}{Fertig ?}{
      \fdganwtb{Anw. 1}
      \fdganwtb{Anw. 2} }
\fdgbr
\fdganwtb{Anw. 3}
\fdganwtb{Anw. 4}
\fdgtb
\fdgdo(1,2)[0.5]{
   \fdganwtb{Anw. 5}
   \fdganwtb{Anw. 6}
}while{Weiter ?}
\fdggoutt{Ende}
\end{frameflowchart}
\end{verbatim}
\exc


\exa
\begin{frameflowchart}{3}{9}{1cm}
\fdgput(2,1)\fdgginb{Start}
\fdgwhiledo(1,5)[1]{\small Weiter ?}{
       \fdgdo(1,3)[0.5]{
           \fdganwtb{Hard Work}
           \fdganwtb{ Work}
           \fdganwtb{Soft Work}
       }while{\small Fertig ?}
}
\fdgbr
      \fdganwtb{Arbeit !}
      \fdganwtb{Arbeit !}
\fdgrepeat(1,1)[0]{
      \fdganwtb{Arbeit !}
}until{Fertig ?}
\fdggoutt{Ende}
\end{frameflowchart}
\exb
\begin{verbatim}
\fdgput(2,1)\fdgginb{Start}
\fdgwhiledo(1,5)[1]{\small Weiter ?}{
       \fdgdo(1,3)[0.5]{
           \fdganwtb{Hard Work}
           \fdganwtb{ Work}
           \fdganwtb{Soft Work}
       }while{\small Fertig ?}
}
\fdgbr
      \fdganwtb{Arbeit !}
      \fdganwtb{Arbeit !}
\fdgrepeat(1,1)[0]{
      \fdganwtb{Arbeit !}
}until{Fertig ?}
\fdggoutt{Ende}
\end{frameflowchart}
\end{verbatim}
\exc

\end{document}
