von rais » So 23. Jun 2024, 22:50
Wenn Du Dir die Mühe gemacht hättest, den Code mal auf die ersten beiden Nodes zu reduzieren ((research) und (traditional)), wäre Dir vllt aufgefallen, daß bei
node distance=1.5cm and 2.5cm,
und
\node (research) {Research design};
\node (traditional) [below left=of research] {Traditional class};
die rechte, obere Ecke von (traditional) 1,5 cm unterhalb und 2,5 cm links von der unteren, linken Ecke von (research) gesetzt wird und bereits sehr von Deinem Bild abweicht. Da dann noch andere Nodes setzen zu wollen ist kontraproduktiv (und hat wohl schon den einen oder anderen Helfer hier abgeschreckt).
Mein Vorschlag:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, decorations.pathreplacing}
\newlength\braceoffset
\setlength\braceoffset{2.5mm}
\newif\ifshowinfo
\showinfotrue
\begin{document}
\begin{tikzpicture}[>=stealth,
node distance=1cm and 5mm, %1.5cm and 2.5cm,
every node/.style={draw, rectangle, text width=3cm, align=center, rounded corners, minimum height=1cm},
week/.style={thin, midway, text width=2cm},
wide/.style={minimum width=7cm, text width=5cm},
class/.style={fill=blue!20},
my brace/.style={semithick, decorate, decoration={brace, amplitude=3mm}},
my line/.style={black!50, thick},
info/.style={minimum height=1ex, text width={}, draw=none, blue!75!black},
pre/.style={my line, ->},
rev/.style={my line, <-}
]
\node (research) [text width=4cm] {Research design};
\coordinate [below=2cm of research] (hrd); %Stützpunkt
\coordinate [below=7.5mm of research] (hrdl); %Stützpunkt für Linien
\node (traditional) [left=of hrd, class] {Traditional class};
\node (flipped) [right=of hrd, class] {Flipped class};
\node (pretest) [below=3.5cm of hrd, wide] {Pre-test algebra proficiency\\ Pre-test self-efficacy};
%\coordinate [below=1.5cm of pretest] (hpt); %Stützpunkt
\node (training) [below=of flipped] {\footnotesize Training sessions on the flipped approach};
\node (flipped_lessons) [below right=of pretest.south, class] {Flipped lessons};
% Arrows
\draw[my line] (research) -- (hrdl);
\draw[pre, rounded corners=3mm] (hrdl) -| (traditional);
\draw[pre, rounded corners=3mm] (hrdl) -| (flipped);
\draw[pre] (traditional)
-- ($(pretest.north west)!(traditional)!(pretest.north)$);
% siehe `texdoc pgfmanual', Abschnitt ``The Syntax of Projection Modifiers''
\draw[pre] (flipped) -- (training);
\draw[pre] (training)
-- ($(pretest.north)!(training)!(pretest.north east)$);
\draw[rev] (flipped_lessons)
-- ($(pretest.south)!(flipped_lessons)!(pretest.south east)$);
% Braces + Annotations:
\coordinate[above=\braceoffset of training.north east, xshift=\braceoffset] (bbrc);
\coordinate[below=\braceoffset of pretest.south east] (ebrca);
\coordinate[right=1.5cm of ebrca] (ebrcb);
\draw[my brace] (bbrc) -- ($(ebrca)!(bbrc)!(ebrcb)$)
node[week, right=5mm]{Weeks 1 + 2};% und mittig zur Klammer den Text nach rechts
% nur zur Demo:
\ifshowinfo
\draw[blue!30, ->] (training.north east) |- (bbrc) node[info, near start, left]{$\delta$ (above)}
node[info, near end, above]{$\delta$ (xshift)};
\draw[blue!30, ->] (pretest.south east) -- (ebrca)
node[info, midway, left]{$\delta$ (below)};
\foreach \i in {hrd,hrdl,bbrc,ebrca,ebrcb}{%
\draw[red!50] (\i) circle[radius=0.25mm];
\draw[red!20] (\i) -- +(330:1) node[info, below, red!75!black]{(\i)};
}
\draw[red!20] ($(pretest.north west)!(traditional)!(pretest.north)$) -- +(310:5)
node[info, below, red!75!black]{(\$(pretest.north west)!(traditional)!(pretest.north)\$)};
\draw[blue!30, dashed] (ebrca) -- (ebrcb) node[info, right]{gedachte Linie};
\draw[blue!30, <->] (pretest.south) -- +(0,-1) node[info, midway, left]{node distance};
\draw[blue!30, <->] (flipped_lessons.north west) -- +(-0.5,0) node[info, midway, below]{node distance (and)};
\fi
\end{tikzpicture}
\end{document}
(meine Hilfslinien/Koordinaten kannst Du durch Auskommentieren von \showinfotrue unterdrücken)
VG
Rainer
Wenn Du Dir die Mühe gemacht hättest, den Code mal auf die ersten beiden Nodes zu reduzieren ((research) und (traditional)), wäre Dir vllt aufgefallen, daß bei
[code]
node distance=1.5cm and 2.5cm,
[/code]
und
[code]
\node (research) {Research design};
\node (traditional) [below left=of research] {Traditional class};
[/code]
die rechte, obere Ecke von (traditional) 1,5 cm unterhalb und 2,5 cm links von der unteren, linken Ecke von (research) gesetzt wird und bereits sehr von Deinem Bild abweicht. Da dann noch andere Nodes setzen zu wollen ist kontraproduktiv (und hat wohl schon den einen oder anderen Helfer hier abgeschreckt).
Mein Vorschlag:
[code]
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, decorations.pathreplacing}
\newlength\braceoffset
\setlength\braceoffset{2.5mm}
\newif\ifshowinfo
\showinfotrue
\begin{document}
\begin{tikzpicture}[>=stealth,
node distance=1cm and 5mm, %1.5cm and 2.5cm,
every node/.style={draw, rectangle, text width=3cm, align=center, rounded corners, minimum height=1cm},
week/.style={thin, midway, text width=2cm},
wide/.style={minimum width=7cm, text width=5cm},
class/.style={fill=blue!20},
my brace/.style={semithick, decorate, decoration={brace, amplitude=3mm}},
my line/.style={black!50, thick},
info/.style={minimum height=1ex, text width={}, draw=none, blue!75!black},
pre/.style={my line, ->},
rev/.style={my line, <-}
]
\node (research) [text width=4cm] {Research design};
\coordinate [below=2cm of research] (hrd); %Stützpunkt
\coordinate [below=7.5mm of research] (hrdl); %Stützpunkt für Linien
\node (traditional) [left=of hrd, class] {Traditional class};
\node (flipped) [right=of hrd, class] {Flipped class};
\node (pretest) [below=3.5cm of hrd, wide] {Pre-test algebra proficiency\\ Pre-test self-efficacy};
%\coordinate [below=1.5cm of pretest] (hpt); %Stützpunkt
\node (training) [below=of flipped] {\footnotesize Training sessions on the flipped approach};
\node (flipped_lessons) [below right=of pretest.south, class] {Flipped lessons};
% Arrows
\draw[my line] (research) -- (hrdl);
\draw[pre, rounded corners=3mm] (hrdl) -| (traditional);
\draw[pre, rounded corners=3mm] (hrdl) -| (flipped);
\draw[pre] (traditional)
-- ($(pretest.north west)!(traditional)!(pretest.north)$);
% siehe `texdoc pgfmanual', Abschnitt ``The Syntax of Projection Modifiers''
\draw[pre] (flipped) -- (training);
\draw[pre] (training)
-- ($(pretest.north)!(training)!(pretest.north east)$);
\draw[rev] (flipped_lessons)
-- ($(pretest.south)!(flipped_lessons)!(pretest.south east)$);
% Braces + Annotations:
\coordinate[above=\braceoffset of training.north east, xshift=\braceoffset] (bbrc);
\coordinate[below=\braceoffset of pretest.south east] (ebrca);
\coordinate[right=1.5cm of ebrca] (ebrcb);
\draw[my brace] (bbrc) -- ($(ebrca)!(bbrc)!(ebrcb)$)
node[week, right=5mm]{Weeks 1 + 2};% und mittig zur Klammer den Text nach rechts
% nur zur Demo:
\ifshowinfo
\draw[blue!30, ->] (training.north east) |- (bbrc) node[info, near start, left]{$\delta$ (above)}
node[info, near end, above]{$\delta$ (xshift)};
\draw[blue!30, ->] (pretest.south east) -- (ebrca)
node[info, midway, left]{$\delta$ (below)};
\foreach \i in {hrd,hrdl,bbrc,ebrca,ebrcb}{%
\draw[red!50] (\i) circle[radius=0.25mm];
\draw[red!20] (\i) -- +(330:1) node[info, below, red!75!black]{(\i)};
}
\draw[red!20] ($(pretest.north west)!(traditional)!(pretest.north)$) -- +(310:5)
node[info, below, red!75!black]{(\$(pretest.north west)!(traditional)!(pretest.north)\$)};
\draw[blue!30, dashed] (ebrca) -- (ebrcb) node[info, right]{gedachte Linie};
\draw[blue!30, <->] (pretest.south) -- +(0,-1) node[info, midway, left]{node distance};
\draw[blue!30, <->] (flipped_lessons.north west) -- +(-0.5,0) node[info, midway, below]{node distance (and)};
\fi
\end{tikzpicture}
\end{document}
[/code]
(meine Hilfslinien/Koordinaten kannst Du durch Auskommentieren von \showinfotrue unterdrücken)
VG
Rainer