0

I have this problem that I'm trying to solve which is writing in the parallel line of each arrow linking the top level with the bottom level

enter image description here

Here is the code I'm using

% Dependent Variables
\node[draw, shape=rectangle, text width=2cm, align=center, below of=softs] (employment_rate) {Employment Rate};

% Arrows \draw[->] (education) -- (employment_rate)

\draw[->] (softs) -- (employment_rate);

\draw[->] (chom) -- (employment_rate);

imnothere
  • 14,215
HellBoy
  • 101
  • 2
    Please provide a minimal working example of the code so that people who might want to help you don't have to guess at the rest of the code you're using. It would also be helpful if you include a copy of the output of the code, not just a picture of the code you want, so that the differences are apparent. – Charles B. Cameron Jan 05 '24 at 01:17
  • Try adding node[midway, sloped, above] {text} before the semicoln on the sloped arrows. – John Kormylo Jan 05 '24 at 02:40
  • have a look here - https://tex.stackexchange.com/a/558016/197451 and here -- https://tex.stackexchange.com/questions/610877/how-place-sloped-text-along-a-bended-arrow/610879#610879 - and for writing above and below here -- https://tex.stackexchange.com/questions/603650/writing-flowchart/603652#603652 – js bibra Jan 05 '24 at 06:05

1 Answers1

3

Welcome to TeX.SE!

  • You should always provide minimal working example (MWE), a minimal small document beginning with \documentclass ... and ending with \end{document} which can people willing to help you, copy to their computers and test as it is.
  • MWE should load in preamble only to your problem relevant package and own definitions, which are needed in compilation, and in document body only to problem relevant code (in your case complete image code).
  • By this you help people to help you. You should be aware, that they do this voluntary in their spare time, and that guessing, what is your document usual lead to result you not expected and consequently is just wasting of time.
  • from your code fragment and problem description is not clear what is your problem. Below is MWE, where I just guess, what you after:
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,
                quotes}

\begin{document} \begin{tikzpicture}[ node distance = 12mm and 4mm, N/.style = {draw, text width=2cm, minimum height=2em, align=center}, ] \node (n1) [N] {some text}; \node (n2) [N, right=of n1] {text}; \node (n3) [N, right=of n2] {some text}; \node (n4) [N, below=of n2] {Employment Rate}; % \draw[->] (n1) to["label", sloped] (n4); % observe option sloped \draw[->] (n2) to["label", sloped] (n4); \draw[->] (n3) to["label", sloped] (n4); \end{tikzpicture} \end{document}

enter image description here

Of course above code can written on more concise way, but I thought that for starting point is more appropriate as it is.

Zarko
  • 296,517