2

I am trying to add the label "H3" onto the arrow coming from Financial Slack to Financial Performance. Here is my current code:

\documentclass{report}    
\usepackage{tikz}
\begin{document}
\begin{figure}
\usetikzlibrary{calc}
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
    \node[rectangle] (Sequence Patterns) at (0,0) {Sequence Patterns};
    \node[rectangle] (Acquisition) at (0,1.5) {Acquisition};
    \node[rectangle] (Divestment) at (0,-1.5) {Divestment};
    \node[rectangle] (Extra-Entrainment) at (0,-3) {Extra-Entrainment};
    \node[rectangle] (Financial Performance) at (10,0) {Financial Performance};
    \node[rectangle] (Financial Slack) at (7,3) {Financial Slack};
    \node[rectangle] (Controls) at (10,-1.5) {Controls};
\end{scope}

\begin{scope}[->={Stealth[black]},
              every node/.style={fill=white},
              every edge/.style={draw=black,very thick}]
    \path [->] (Sequence Patterns) edge node {$H2$} (Financial Performance);
    (Controls) edge (Financial Performance)
    \path [->] (Acquisition) edge (Sequence Patterns);
    \path [->] (Divestment) edge  (Sequence Patterns);
    \path [->] (Acquisition) edge node {$H1a$} (Financial Performance);
    \path [->] (Divestment) edge node {$H1b$} (Financial Performance);
    \path [->] (Extra-Entrainment) edge node {$H4$} (Financial Performance);
    \path [->] (Controls) edge (Financial Performance);
    \path [->] (Financial Slack) edge ($(Sequence Patterns)!0.7!(Financial Performance)$);
\end{scope}
\end{tikzpicture}
\end{figure}
\end{document}

Anyone knows how to do that?

Also: Is there a possibility to align the labels "H1a, "H1b","H2", and "H4" to the left side and above the arrows instead of in between them?

Thanks a lot!

3
  • 2
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – Stephen
    May 27 at 11:41
  • Thanks for the tip, I just adjusted it. Should work now.
    – xxoptionxx
    May 27 at 12:17
  • You can upload a (hand-drawing) figure that you want; just click to Edit, and choose Image tab
    – Black Mild
    May 27 at 18:01

2 Answers 2

1

With use of TikZ libraries chains, positioning and quotes libraries. Library arrows.meta is used for draw nicer arrow heads:

\documentclass[border=3.141592]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                positioning,
                quotes}
                
\begin{document}
    \begin{tikzpicture}[
node distance = 4mm and 55mm,
  start chain = n going below,
     N/.style = {draw, semithick, minimum width=9em, align=center},
every edge/.style = {draw, -Stealth},
every edge quotes/.style = {auto, inner sep=2pt, font=\footnotesize, pos=0.3, sloped}
                        ]
    \begin{scope}[nodes={N, on chain=n}]
\node   {Acquisition};       % n-1
\node   {Sequence Patterns};
\node   {Divestment};
\node   {Extra-Entrainment}; % n-2
    \end{scope}
\node[N, right=of n-2] (n-5)    {Financial\\ Performance};
\node[N, below=of n-5] (n-6)    {Controls};
% arrows
\path   (n-1.east) edge ["$H_{1a}$"]    (n-5.174)
        (n-1) edge  (n-2)
        (n-2.east) edge ["$H_2$"] coordinate[pos=0.66] (aux) (n-5.178)
        (n-3.east) edge ["$H_{1b}$"]    (n-5.182)
        (n-3) edge (n-2)
        (n-4.east) edge ["$H_4$"]       (n-5.186)
        (n-6) edge (n-5)
        (n-2.west) edge [bend right] (n-4.west)
        ;
\node[N, above=of n-1.north -| aux] (n-7) {Financial Slack};
\path   (n-7) edge ["$H3$" sloped=false] (aux);
    \end{tikzpicture}
\end{document}

enter image description here

3
  • Thanks! I forgot that there is also supposed to be an arrow coming from "sequence patterns" going to "extra entrainment". Do you happen to know how I can put that one in there with a left bend? Thanks!
    – xxoptionxx
    May 28 at 12:36
  • 1
    @xxoptionxx, as you described in comment. Try do this yourself. For exercises :-). I will edit answer ASAP.
    – Zarko
    May 28 at 13:47
  • 1
    once you see the code, it makes sense... thank you so much, all issues are resolved! :)
    – xxoptionxx
    May 28 at 14:38
1

Welcome to texSE!

Here is my suggestion. A simple figure should be drawn by a simple way. TikZ has a natural syntax, almost as natural as English language, so when you read a TikZ code, you can guess the meaning of the code. Enjoy reading pgfmanual.

Update: Your description is no so clear for me. I only can guess you want a dotted arrow from FS touching to a poin on the line connecting SP and FP. If so, just say

\draw[densely dotted] (FS)-(FS|-FP) node[pos=.5,right]{$H_3$}; 

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[thick]
\tikzset{n/.style={draw,align=center,inner sep=3mm,fill=yellow!30}} 
\path[nodes={n}] 
(0,0)     node (SP) {Sequence Patterns}
(0,1.5)   node (A)  {Acquisition}
(0,-1.5)  node (D)  {Divestment}
(0,-3)    node (EE) {Extra-Entrainment}
(7,3)     node (FS) {Financial Slack}
(10,0)    node (FP) {Financial\\[3mm]Performance}
+(0,-2)   node (C)  {Controls};

\begin{scope}[-stealth]
\draw (SP)--(FP) coordinate[pos=.3] (H2);
\draw (A)--(SP);
\draw (D)--(SP);
\draw (A)--(FP.165); 
\draw (D)--(FP.190); 
\draw (EE)--(FP.205);
\draw (C)--(FP);
%\draw (SP)-|(FS) node[pos=.75,right]{$H_3$};
\draw[densely dotted] (FS)-(FS|-FP) node[pos=.5,right]{$H_3$};
\end{scope}

\path 
(H2) node[above right]{$H_2$}
+(0,4) coordinate (H2top) +(0,-4) coordinate (H2bot)
(intersection of H2top--H2bot and A--FP)  node[above right]{$H_{1a}$}
(intersection of H2top--H2bot and D--FP)  node[above right]{$H_{1b}$}
(intersection of H2top--H2bot and EE--FP) node[above right]{$H_4$}
;
\end{tikzpicture}
\end{document}
7
  • 1
    Thanks for your input, that helps quite a bit! I am new to Latex and this is the first time I am working with tikz. Is there a way to add a H3 to the arrow going from FS to the arrow with H2. And can I take the labels H1a, H1b, H2 and H4 to the left side of the arrow, closer to the rectangles? Thanks!
    – xxoptionxx
    May 27 at 12:30
  • You are welcome ^^ Please see my edit. Is that $H_3$ you are expecting?
    – Black Mild
    May 27 at 12:38
  • Almost, the arrow for H3 has to be flipped around. Also the question whether it is possible to take the H's on the left side and put them closer to the rectangles on the left side, and all issues are resolved :) Thanks so far, it helped a lot!
    – xxoptionxx
    May 27 at 12:40
  • as I said, when reading the code, you can guess its meaning, and make some changes as you think fit. To change the labels Hs, just change the number in \draw (SP)--(FP) coordinate[pos=.3] (H2); , for example pos=.2
    – Black Mild
    May 27 at 12:43
  • Sorry, one last time. I tried to figure it out myself, but I am not sure how to flip the arrow the other way around and how to make it a dotted arrow instead. Would you know how to do that as well? Thanks! :)
    – xxoptionxx
    May 27 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.