tikz 中带边的箭头

tikz 中带边的箭头

我有一个用于概念模型的 tikz 图。我试图从上下文因素到输入绘制一个有边的箭头。不知道该怎么做

\begin{figure}[h]

\centering
\begin{tikzpicture}
[node distance = 1cm, auto,font=\footnotesize,
% STYLES
every node/.style={node distance=3cm},
% The comment style is used to describe the characteristics of each force
comment/.style={rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm, font=\scriptsize\sffamily},
% The force style is used to draw the forces' name
force/.style={rectangle, draw, fill=black!10, inner sep=5pt, text width=4cm, text badly centered, minimum height=1.2cm, font=\bfseries\footnotesize\sffamily}] 

% Draw forces
\node [force] (organization) {Organizational Structure};
\node [force, text width=3cm, dashed, below=1cm of organization, fill=red!30] (state) {Police Reform};
\node [force, left=1cm of organization] (input) {Inputs};
\node [force, right=1cm of organization] (output) {Outputs/Outcomes};
\node [force, above of=output] (external) {Contextual Factors};
%%%%%%%%%%%%%%%
% Change data from here

% ORGANIZATION STRUCTURE
\node [comment, above=0.25 of organization] (comment-rivalry) {-Adaptive Organization\\
-hierarchical\\
-horizontal};

% INPUTS
\node [comment, above=0.25cm of input] {-Labor $L$\\
- Capital $K$};

% EXOGENOUS FACTORS
\node [comment, above=0.25 of external] {-Regulatory framework\\ -Socioeconomic factors, \\
-Functioning of the public administration\\
-Organized crime};



%%%%%%%%%%%%%%%%

% Draw the links between forces
\path[->,thick] 
(state) edge (input)
(state) edge (organization)
(state) edge  (output)
(external) edge (output)
(input) edge (organization)
(organization) edge (output);

\end{tikzpicture} 
\caption{Conceptual Model}
\end{figure}

答案1

类似于此。由于内部名称 (external) 和 (input) 已定义,因此只需将以下几行(从 到 连接west of external)添加north of input到代码的最后一行即可。

 \draw [->,thick] (external.west) -| (input.north);

在此处输入图片描述

代码

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,arrows,positioning}

\tikzstyle{vertex}=[circle,draw,minimum size=1cm]
\tikzstyle{every node}=[vertex]

\begin{document}

\begin{figure}[h]

\centering
\begin{tikzpicture}
[node distance = 1cm, auto,font=\footnotesize,
% STYLES
every node/.style={node distance=3cm},
% The comment style is used to describe the characteristics of each force
comment/.style={rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm, font=\scriptsize\sffamily},
% The force style is used to draw the forces' name
force/.style={rectangle, draw, fill=black!10, inner sep=5pt, text width=4cm, text badly centered, minimum height=1.2cm, font=\bfseries\footnotesize\sffamily}] 

% Draw forces
\node [force] (organization) {Organizational Structure};
\node [force, text width=3cm, dashed, below=1cm of organization, fill=red!30] (state) {Police Reform};
\node [force, left=1cm of organization] (input) {Inputs};
\node [force, right=1cm of organization] (output) {Outputs/Outcomes};
\node [force, above of=output] (external) {Contextual Factors};
%%%%%%%%%%%%%%%
% Change data from here

% ORGANIZATION STRUCTURE
\node [comment, above=0.25 of organization] (comment-rivalry) {-Adaptive Organization\\
-hierarchical\\
-horizontal};

% INPUTS
\node [comment, above=0.25cm of input] {-Labor $L$\\
- Capital $K$};

% EXOGENOUS FACTORS
\node [comment, above=0.25 of external] {-Regulatory framework\\ -Socioeconomic factors, \\
-Functioning of the public administration\\
-Organized crime};

%%%%%%%%%%%%%%%%

% Draw the links between forces
\path[->,thick] 
(state) edge (input)
(state) edge (organization)
(state) edge  (output)
(external) edge (output)
(input) edge (organization)
(organization) edge (output);
\draw [->,thick] (external.west) -| (input.north);
\end{tikzpicture} 
\caption{Conceptual Model}
\end{figure}
\end{document}

相关内容