Skip to content

Commit

Permalink
feat: optimize diagramm code
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Dünkelmann <nc-duenkekl3@netcologne.de>
  • Loading branch information
MartinX3 committed Jun 23, 2024
1 parent 6a5e55e commit f8b8c20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions abschnitte/Auswertung.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ \section{Flowchart-Diagramm}\label{sec:flowchart-diagramm}
\node (pro1) [process, below of=in1] {Process 1};
\draw [arrow] (in1) -- (pro1);

\node (dec1) [decision, below of=pro1, yshift=-1cm] {Decision 1};
\node (dec1) [decision, below of=pro1, yshift=-1.5cm] {Decision 1};
\draw [arrow] (pro1) -- (dec1);

\node (pro2a) [process, below of=dec1, yshift=-1.5cm] {Process 2a with a long text};
\node (pro2a) [process, below of=dec1, yshift=-2cm] {Process 2a with a long text};
\draw [arrow] (dec1) -- node[anchor=east] {yes} (pro2a);

\node (out1) [io, below of=pro2a, yshift=-0.5cm] {Output};
\draw [arrow] (pro2a) -- (out1);

\node (subpro1) [subprocess=33mm, right of=dec1, xshift=2.5cm] {A very long subprocess};
\node (subpro1) [subprocess, right of=dec1, xshift=2.5cm] {A very long subprocess};
\draw [arrow] (dec1) -- node[anchor=south] {no} (subpro1);

\node (stop) [startstop, below of=out1] {Stop};
Expand Down
24 changes: 11 additions & 13 deletions aussehen/hbrs-inf-diagrams.sty
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,45 @@
\tikzstyle{decision} = [
diamond,
draw=black, fill=green!30,
minimum height=1cm, minimum width=3cm,
text centered, text width=2cm
minimum height=1cm,
text centered, text width=3cm
]

\tikzstyle{io} = [
trapezium,
draw=black, fill=blue!30,
minimum height=1cm, minimum width=3cm,
text centered, text width=2cm,
minimum height=1cm,
text centered, text width=3cm,
trapezium left angle=70, trapezium right angle=110,
trapezium stretches=true
]

\tikzstyle{process} = [
rectangle,
draw=black, fill=orange!30,
minimum height=1cm, minimum width=3cm,
text centered, text width=2cm
minimum height=1cm,
text centered, text width=3cm
]

\tikzstyle{startstop} = [
rectangle,
draw=black, fill=red!30,
minimum height=1cm, minimum width=3cm,
minimum height=1cm,
rounded corners,
text centered, text width=2cm
text centered, text width=3cm
]

\newcommand\ppbb{path picture bounding box}
\tikzset{
subprocess/.style = {
rectangle,
align=flush center,
draw=black, fill=orange!30, semithick,
minimum height=1cm, minimum width=#1, inner xsep=3mm,
draw=black, fill=orange!30,
minimum height=1cm,
path picture={
\draw
([xshift=-2mm] \ppbb.north east) -- ([xshift=-2mm] \ppbb.south east)
([xshift=2mm] \ppbb.north west) -- ([xshift=2mm] \ppbb.south west);
},
text width =\pgfkeysvalueof{/pgf/minimum width}-2*\pgfkeysvalueof{/pgf/inner xsep}
text centered, text width=3cm
},
subprocess/.default = 24mm
}

0 comments on commit f8b8c20

Please sign in to comment.