Ich bin gerade dabei, mir einen Programmablaufplan zu erstellen. Dabei stoße ich noch auf ein paar Probleme.

  1. Ich hätte gerne, dass alle Rechtecke wie Prozess, Start/Ende und vordefinierte Prozess die gleiche Breite haben. Ich bekomme dies zwar hin indem ich mit text width arbeite jedoch habe ich das gefühl, dass dies nicht wirklich elegant ist.

  2. Ich möchte dazu noch an den Rechtecken, egal ob links oder rechts, Kommentare hinzufügen. Dies habe ich bereits schon probiert und mit shift gearbeitet. Das ist aber auch nicht wirklich von Vorteil, weil ich so nicht den gleichen Abstand bei allen hinbekomme.

  3. Besteht eine Möglichkeit die Pfeilspitze zu vergrößern?

Hier einmal der Code und die Ausgabe:

Open in Online-Editor
\documentclass[tikz,border=5pt]{standalone}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%--------------------------------------------------------------------------------
% Anpassung an die Landessprache
%--------------------------------------------------------------------------------
\usepackage[ngerman]{babel}
\usepackage[babel, german=quotes]{csquotes}

\usepackage{tikz}
\usetikzlibrary{positioning,calc,shapes,arrows,shapes.multipart}

% Define block styles
\tikzset{
   papDecision/.style = {
         diamond,
         draw, 
         text width = 20 mm, 
         align = center, 
         text badly centered,
         inner sep = 1 pt,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papStart/.style = {
         rectangle,
         draw, 
         align = center, 
         text width = 3cm, 
         text badly centered,
         inner sep = 4 pt,
         rounded corners=10pt,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papEnd/.style = {
         rectangle,
         draw, 
         align = center, 
         text width = 3cm, 
         text badly centered,
         inner sep = 4 pt,
         rounded corners=10pt,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papData/.style = {
         trapezium,
         draw, 
         align = center, 
         text width = 20 mm, 
         text badly centered,
         inner sep = 4 pt,
         trapezium left angle=70,
         trapezium right angle=110,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papPredProc/.style = {
         draw,
         rectangle split,
         rectangle split horizontal,
         rectangle split parts = 3,
         rectangle split empty part width=-8pt,
         align = center, 
 %       text width = 4.5 em, 
         text badly centered,
 %        inner sep = 4 pt,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papProcess/.style = {
         rectangle,
         draw,
         align = center, 
         text width = 3cm, 
         text badly centered,
         %inner sep = 2 pt,
         font=\ttfamily\footnotesize,
         %line width = 1,
         minimum width = 30mm,
         minimum height = 7mm,
      },
   papLine/.style = {
         draw,
         -stealth,
         font=\ttfamily\footnotesize,
         %line width = 1,
      },
}

\newcommand{\papYes}{ja}
\newcommand{\papNo}{nein}

\begin{document}

\begin{tikzpicture}[node distance = 2cm, auto]

% Place nodes
\node [papStart] (Start1){Start};
\node [papProcess, below of = Start1,label={[shift={(2.7,-0.6)}]\footnotesize\textit{label 1}}] (pro1){Prozess};
\node [papProcess, below of = pro1,label={[shift={(3,-0.6)}]\footnotesize\textit{label 2}}](pro2){Prozess};
\node [papDecision, below of = pro2, yshift= -9mm](dec1){Entscheidung};
\node [papPredProc,  right of = dec1, xshift=25mm](predproc1){\nodepart{two}\shortstack{vordefinierter\\Prozess}};
\node [papProcess, below of = predproc1,label={[shift={(2.3,-0.6)}]\footnotesize\textit{label 3}}](pro3){Prozess};
\node [papEnd, below of = dec1, yshift= -20mm] (End) {Ende};

% Place joins
\coordinate [below of = dec1, yshift= -10mm] (join1);

% Draw edges
\path [papLine] (Start1) -- (pro1);
\path [papLine] (pro1) -- (pro2);
\path [papLine] (pro2) -- (dec1);
\path [papLine] (dec1) -- node [right] {\papYes} (End);
\path [papLine] (dec1) -- node [above] {\papNo} (predproc1);
\path [papLine] (predproc1) -- (pro3);
\path [papLine] (pro3) |- (join1);

\end{tikzpicture}

\end{document}

alt text

gefragt 19 Okt '16, 10:19

Giovario's gravatar image

Giovario
413102126
Akzeptiert-Rate: 0%

bearbeitet 31 Okt '16, 12:41

stefan's gravatar image

stefan ♦♦
18.1k143048

2

Du solltest für drei Fragen auch wirklich drei Fragen mit individuell passendem VM stellen! Außerdem schadet es nichts, wenn Du die Tipps zum Verfassen beachtest und Überflüssigkeiten wie "Hallo" einfach weglässt.

(19 Okt '16, 10:53) saputello

Wenn Du für Rechtecknoden eine feste Breite möchtest, dann ist die Vorgabe von text width schon der richtige Weg. Zur Textbreite kommen aber immer links und rechts inner xsep hinzu. Gegebenenfalls müsste auch noch die Linienstärke berücksichtigt werden. Einen Rechtecknode mit 3cm Breite bekommst Du mit

Open in Online-Editor
text width=3cm-2*\pgfkeysvalueof{/pgf/inner xsep}

wobei da die Linienstärke vernachlässigt wurde.

Deine zweite Frage wurde sehr ähnlich unter Wie weise ich einem label neben einem node einen festen Punkt zu? gestellt und dort auch beantwortet.

Die Breite und Länge der Pfeilspitzen kannst Du beeinflussen, wenn Du die Bibliothek arrows.meta lädst und dann beispielsweise {Stealth[length=9pt,width=6pt]} verwendest.

Open in Online-Editor
    \documentclass[tikz,border=5pt]{standalone}
    \usetikzlibrary{positioning,arrows.meta}

    % Define block styles
    \tikzset{
        pap/.style={
            draw,
            minimum height=7mm,
            font=\ttfamily\footnotesize,
            align=flush center,
            on grid
        },
        paprectangle/.style={
            pap,
            text width=3cm-2*\pgfkeysvalueof{/pgf/inner xsep},
            inner sep=4pt
        },
        papStart/.style = {
             paprectangle,
             rounded corners=10pt,
        },
        papEnd/.style = {papStart},
        papProcess/.style = {paprectangle},
        papLine/.style = {
             draw,
             -{Stealth[length=9pt,width=6pt]},
          },
        papLabel/.style={
            label distance=.5cm,
            font=\footnotesize\itshape
        }
    }

    \begin{document}
    \begin{tikzpicture}[node distance = 2cm, auto]
    \draw[very thin,lightgray](-2,-9)grid[step=.5cm]+(6,10);

    % Place nodes
    \node [papStart] (Start1){Start};
    \node [papProcess, below = of Start1,label={[papLabel]right:label 1}](pro1){Prozess};
    \node [papProcess, below = of pro1,label={[papLabel]right:label 2}](pro2){Prozess};
    \node [papEnd, below = of pro2, yshift= -20mm] (End) {Ende};

    % Draw edges
    \path [papLine] (Start1) -- (pro1);
    \path [papLine] (pro1) -- (pro2);
    \path [papLine] (pro2) -- (End);
    \end{tikzpicture}
    \end{document}

alt text

Permanenter link

beantwortet 19 Okt '16, 15:12

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:

×728
×13

gestellte Frage: 19 Okt '16, 10:19

Frage wurde gesehen: 13,718 Mal

zuletzt geändert: 19 Okt '16, 15:12