Hallo, ich möchte in der folgenden tikZ Grafik gerne ein Makro (einheit; siehe newcommand in der Präambel) einbinden. Dieses soll je nach Bedarf rechts neben dem Prozessschritt stehen. Beispielhaft wäre es schön, wenn es neben dem Prozessschritt "Rückmeldung beim Kunden" eingefügt wird. Ich habe es als style cheat versucht, weiss jedoch dass dies so nicht funktioniert.

Vielen Dank vorab ;-)

Open in writeLaTeX
\documentclass[11pt]{scrreprt}
\usepackage[top=2cm,left=3cm,right=3cm,bottom=4cm]{geometry}
\usepackage{graphicx}
\usepackage{tabularx}   % läd auch array
\usepackage{microtype} % besserer Randausgleich
\usepackage{booktabs} %für schöne Linien in Tabellen
\usepackage{paralist}           
\usepackage{tikz}
    \newcommand\einheit[1][]{\tikz{
        \draw (0,0) -- (0,2) -- (2,2) -- (2,0) to[out=90, in=-60] (0,0);
        \node[text width=2cm,align=center] at (1,1) {#1};
        }}
\usetikzlibrary{mindmap,trees}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{positioning,shadings}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.arrows}

\begin{document}
\begin{tikzpicture} [auto,
    base/.style         ={ rectangle, draw=blue, thick, fill=blue!20,
                                text width=5em, minimum height=2em,
                                text centered, rounded corners},
    block/.style        ={ rectangle, draw=blue, thick, 
                                fill=blue!20, text width=10em, text centered,
                                minimum height=2em },
    decision/.style ={ diamond, draw=blue, thick, fill=blue!20,
                                text width=5em, text badly centered,
                                inner sep=1pt},
    line/.style             ={ draw, thick, ->, shorten >=2pt },
    doc/.style          ={ einheit},
  ]
  % Define nodes in a matrix
  \matrix [column sep=5mm, row sep=10mm] {
                    & \node [base]      (start) {START};                & \\
                    & \node [block]     (ka)        {Kundenanfrage};    & \\
                    & \node [block]     (rk)        {Rückmeldung beim Kunden};  &\\
                    & \node [block]     (bo)        {Besichtigung vor Ort}; &\\
                    & \node [decision]  (p1)        {Prüfung der Forderungen}; &\\
                    & \node [block]     (ae)        {Angebot erstellen/bearbeiten}; &\\
                    & \node [decision]  (p2)        {Prüfung auf Korrektheit}; &\\
                    & \node [block]     (va)        {Versendung des Angebots}; &\\
                    & \node [base]      (end)       {ENDE}; &\\
                    & \node [doc]           (f)         {Checkliste};&\\
               };
  % connect all nodes defined above
  \begin{scope} [every path/.style=line]
    \path (start)       --      (ka);
    \path (ka)          --      (rk);
    \path   (rk)            --      (bo);
    \path (bo)          --      (p1);
    \path   (p1)            --++ (-3,0) node    [near start] {n.i.O.}   |- (rk);
    \path   (p1)            --      node [near start] {i.O.} (ae);
    \path   (ae)            --      (p2);
    \path   (p2)            --++ (-3,0) node    [near start] {n.i.O.}   |- (ae);
    \path   (p2)            --      node [near start] {i.O.} (va);
    \path   (va)            --      (end);
    \path (rk)          --      (f);
  \end{scope}
\end{tikzpicture}
\end{document}

Die Checkliste oder die möglichen Formulare sollen später rechts neben dem Flussdiagramm stehen.

gefragt 13 Mai '14, 14:39

sascha's gravatar image

sascha
17161017
Akzeptiert-Rate: 50%

konvertiert in Frage 14 Mai '14, 17:07


Die einfachste Lösung wäre die Verwendung einer schon definierten Form. tape aus der shapes.symbols Bibliothek kommt der von dir gezeichneten recht nahe:

Open in writeLaTeX
\documentclass[tikz, margin=5mm]{standalone}
\usepackage[utf8]{inputenc}

\usetikzlibrary{matrix}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.symbols}

\begin{document}
\begin{tikzpicture} [auto,thick,
    base/.style ={ draw=blue, fill=blue!20,
                   text width=5em, minimum height=2em, 
                   text centered, rounded corners},
    block/.style ={ draw=blue, fill=blue!20,
                    text width=10em, text centered, minimum height=2em },
    decision/.style ={ diamond, draw=blue, fill=blue!20,
                       text width=5em, text badly centered, inner sep=1pt},
    line/.style ={ draw, ->, shorten >=2pt },
    doc/.style ={ draw, tape,tape bend top=none,tape bend height=5mm,
                     minimum height=2cm,text width=2cm-.2em, inner xsep=.1em,
                     align=center}
  ]
  % Define nodes in a matrix
  \matrix [matrix of nodes,column sep=5mm, row sep=10mm] {
    |[base](start)| START\\
    |[block](ka)| Kundenanfrage\\
    |[block,anchor=center](rk)| Rückmeldung beim Kunden&|[doc](f)|Checkliste\\
    |[block](bo)| Besichtigung vor Ort\\
    |[decision](p1)| Prüfung der Forderungen\\
    |[block](ae)| Angebot erstellen/bearbeiten\\
    |[decision](p2)| Prüfung auf Korrektheit\\
    |[block](va)| Versendung des Angebots\\
    |[base](end)| ENDE\\
  };
  % connect all nodes defined above
  \begin{scope} [every path/.style=line]
    \path (start) -- (ka);
    \path (ka) -- (rk);
    \path (rk) -- (bo);
    \path (bo) -- (p1);
    \path (p1) --++ (-3,0) node[near start] {n.i.O.} |- (rk);
    \path (p1) -- node [near start] {i.O.} (ae);
    \path (ae) -- (p2);
    \path (p2) --++ (-3,0) node[near start] {n.i.O.} |- (ae);
    \path (p2) -- node [near start] {i.O.} (va);
    \path (va) -- (end);
  \end{scope}
\end{tikzpicture}
\end{document}

alt text

Permanenter link

beantwortet 14 Mai '14, 18:24

esdd's gravatar image

esdd
17.7k254256
Akzeptiert-Rate: 62%

Ich habe verzweifelt genau nach diesem Symbol gesucht und es einfach nicht gefunden. maaaaannn. DANKE :-)

(14 Mai '14, 19:13) sascha

Alternative mit Definition eines pic (braucht mindestens pgf/TikZ Version 3.0.0):

Open in writeLaTeX
\documentclass[tikz,margin=5mm]{standalone}
\usepackage[utf8]{inputenc}

\usetikzlibrary{matrix}
\usetikzlibrary{shapes.geometric}

\begin{document}
\begin{tikzpicture} [auto,thick,
    base/.style ={ draw=blue, fill=blue!20,
                   text width=5em, minimum height=2em, 
                   text centered, rounded corners},
    block/.style ={ draw=blue, fill=blue!20,
                    text width=10em, text centered, minimum height=2em },
    decision/.style ={ diamond, draw=blue, fill=blue!20,
                       text width=5em, text badly centered, inner sep=1pt},
    line/.style ={ draw, ->, shorten >=2pt },
    symbol/.pic={%
        \node[minimum height=2cm,text width=2cm-.2em, inner xsep=.1em,
             align=center](-symb){\tikzpictext};% node bekommt Namen <picname>-symb
        \useasboundingbox([yshift=-2mm]-symb.south west)rectangle(-symb.north east);
        \draw(-symb.south west)--(-symb.north west)--(-symb.north east)--
            (-symb.south east)to[out=90,in=-60](-symb.south west);
        },
  ]
  % Define nodes in a matrix
  \matrix [matrix of nodes,column sep=5mm, row sep=10mm] {
    |[base](start)| START\\
    |[block](ka)| Kundenanfrage\\
    |[block,anchor=center](rk)| Rückmeldung beim Kunden&\pic[pic text=Checkliste](f){symbol};\\
    |[block](bo)| Besichtigung vor Ort\\
    |[decision](p1)| Prüfung der Forderungen\\
    |[block](ae)| Angebot erstellen/bearbeiten\\
    |[decision](p2)| Prüfung auf Korrektheit\\
    |[block](va)| Versendung des Angebots\\
    |[base](end)| ENDE\\
  };
  % connect all nodes defined above
  \begin{scope} [every path/.style=line]
    \path (start) -- (ka);
    \path (ka) -- (rk);
    \path (rk) -- (bo);
    \path (bo) -- (p1);
    \path (p1) --++ (-3,0) node[near start] {n.i.O.} |- (rk);
    \path (p1) -- node [near start] {i.O.} (ae);
    \path (ae) -- (p2);
    \path (p2) --++ (-3,0) node[near start] {n.i.O.} |- (ae);
    \path (p2) -- node [near start] {i.O.} (va);
    \path (va) -- (end);
  \end{scope}
\end{tikzpicture}
\end{document}

alt text

Permanenter link

beantwortet 14 Mai '14, 18:33

esdd's gravatar image

esdd
17.7k254256
Akzeptiert-Rate: 62%

Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×28
×18
×2

gestellte Frage: 13 Mai '14, 14:39

Frage wurde gesehen: 9,935 Mal

zuletzt geändert: 14 Mai '14, 19:13