Ich möchte gerne per LaTeX ein PAP erstellen und eigentlich klappt auch alles wie gewollte.
Nur habe ich zwei Probleme.
- Platzmangel: Meine PAP ist etwas größer geworde, als erwartet. Wie bekomme ich das etwas kleiner hin bzw. würde den PAP nach oben links verschieben wollen, sodass alles auf eine Seite passt?
- Ich habe in der PAP ein Block, was "Back to ..." (grün) heißt. Dieser dient eigentlich nur dazu, dass ich zurück zu meiner "decision" zurückkomme. Würde gerne den Block weglassen. Und ist es möglich, den Pfeil auf einen anderen Pfeil zu führen? Das wäre der Pfeil, über "decision".
Hier ist einmal mein Code:
\documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty} % Define block styles \tikzstyle{decision} = [diamond, draw, fill=yellow!20, text width=5.3em, text badly centered, node distance=3cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em] \tikzstyle{process} = [rectangle, draw, fill=green!20, text width=5em, text centered, rounded corners, minimum height=2em] \begin{tikzpicture}[node distance = 2cm, auto] % Place nodes \node [cloud] (init) {Start}; \node [block, below of=init] (time) {END\_TIME = 30s}; \node [decision, below of=time] (timestamp) {timestamp $<$ END\_TIME}; \node [block, below of=timestamp, node distance=3.5cm] (output) {Output $<$ TIME\_END}; \node [process, left of=output, node distance=3.5cm] (loop) {Back to the loop}; \node [block, right of=timestamp, node distance=4.5cm] (passedtime) {passed\_time = monotonic - timestamp}; \node [decision, below of=passedtime] (if0) {passed\_time $<=$ 6s}; \node [block, below of=if0, node distance=3.5cm] (SAMPLE0) {print passed\_time, sample\_0}; \node [process, left of=SAMPLE0, node distance=2.5cm] (loopelif) {Back to the if-Statement}; \node [decision, right of=if0, node distance=4.5cm] (elif1) {passed\_time $<=$ 12s}; \node [block, right of=elif1, node distance=3.5cm] (SAMPLE1) {print passed\_time, sample\_1}; % Draw edges \path [line] (init) -- (time); \path [line] (time) -- (timestamp); \path [line] (timestamp) -- node {yes}(output); \path [line] (output) -- (loop); \path [line] (loop) |- (timestamp); \path [line] (timestamp) -- node {no}(passedtime); \path [line] (passedtime) -- (if0); \path [line] (if0) -- node {yes}(SAMPLE0); \path [line] (SAMPLE0) -- (loopelif); \path [line] (loopelif) |- (if0); \path [line] (if0) -- node {no}(elif1); \path [line] (elif1) -- node {yes}(SAMPLE1); \end{tikzpicture} \end{document}
Grüße
Robert