# How to create a Leontief-Gozintograph with tikz?

I'm looking for a way to create a leontief-gozintograph that looks similar to this one:

I searched at http://www.texample.net/tikz/examples/ without success. Is there anyone who already have been creating something like this?

• The official tikz/pgf manual has tutorials based on use cases Jan 19, 2014 at 13:46
• But I think 'How to draw commutative diagrams in LaTeX with TikZ' is more similar to your diagram. just need to draw a box around each node by putting option draw=black Jan 19, 2014 at 13:49
• –1: Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
– Tobi
Jan 19, 2014 at 17:01

This is a tikz solution.

Code

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}
\tikzset{
nn/.style={rectangle,minimum width=210, minimum height=20,draw,thick},
}

\begin{tikzpicture}
\node (UR) [adim] at (5,4)  {B60};
\node (UL) [adim] at (-1,4) {A80};
\node (C)  [adim] at (2,2)  {C100};
\node (B)  [nn]   at (2,0)  {Konsum};
\draw[thick,->] (UL.north)  to[out=90, in=180, looseness=6]node[above]{a} (UL.west);
\draw[thick,->] (UR.north) to[out=90, in=0, looseness=6] node[above]{36} (UR.east);
\draw[thick,->] ($(UR.west)+(0,0.2)$) -- ($(UL.east)+(0,0.2)$) node[midway,above]{18};
\draw[thick,->] ($(UL.east)+(0,-0.2)$) -- ($(UR.west)+(0,-0.2)$) node[midway,below]{4};
\draw[thick,->] (UR) -- ($(B.north)+(3,0)$) node[midway,right]{15};
\draw[thick,->] (UL) -- ($(B.north)+(-3,0)$) node[midway,left]{14};
\draw[thick,->] (C) -- ($(B.north)+(0,0)$) node[midway,left]{48};
\draw[thick,<-] (UR.south west) -- (C.north east) node[midway,above]{6};
\draw[thick,->] (UR.south) -- (C.south east) node[midway,below]{b};
\draw[thick,<-] (UL.south east) -- (C.north west) node[midway,above]{c};
\draw[thick,->] (UL.south) -- (C.south west) node[midway,left]{40};
\draw[thick,->] ($(C.north east)+(-0.2,0)$) to[out=100,in=80] node[above]{30} ($(C.north west)+(0.2,0)$);
\end{tikzpicture}
\end{document}

• Thank your very much for sharing this. During the last two hours I also tried to handle it with Tikz. But the solution of mine isn't as close to the gozintograph as yours. Jan 19, 2014 at 15:59
• @user39628 -- Glad I can help. Thank you too. Jan 19, 2014 at 16:04

A PSTricks solution:

\documentclass{article}

\def\DoubleArrow[#1]#2#3#4#5{%
{\psset{offset = #1, arrows = ->}
\ncline{#2}{#3}
\ncline{#3}{#2}}
{\psset{offset = 8pt, linestyle = none}
\pcline(#2)(#3)
\ncput{\small #4}
\pcline(#3)(#2)
\ncput{\small #5}}%
}
\def\SingleArrow(#1,#2)(#3,#4)#5{%
\pcline{->}(#1,#2)(#3,#4)
{\psset{offset = -8pt, linestyle = none}
\pcline(#1,#2)(#3,#4)
\ncput{\small #5}}%
}

\begin{document}

\psset{unit = 0.5}
\begin{pspicture}(19.3,12)
\psTextFrame(1,0)(18,1){Konsum}
\psTextFrame(1,10)(3,11){A~80}
\psarc{->}(1,11){0.8}{0}{270}
\rput(0.1,11.9){a}
\psTextFrame(8.3,5.5)(10.7,6.5){C~100}
\psarc{->}(9.5,6.05){0.8}{30}{150}
\rput(9.5,7.3){\small 30}
\psTextFrame(16,10)(18,11){B~60}
\psarc{<-}(18,11){0.8}{-90}{180}
\rput(19.1,11.8){\small 36}
\pnodes{P}(0,0)(3,10)(8.3,6.5)(10.7,6.5)(16,10)(3,10.5)(16,10.5)
\DoubleArrow[-2pt]{P1}{P2}{40}{c}
\DoubleArrow[2pt]{P3}{P4}{6}{b}
\DoubleArrow[2pt]{P5}{P6}{18}{4}
\SingleArrow(2,10)(2,1){14}
\SingleArrow(17,10)(17,1){15}
\SingleArrow(9.5,5.5)(9.5,1){48}
\end{pspicture}

\end{document}


• +1: Can you make it with psmatrix such that no absolute coordinates are used explicitly? :-) Jan 20, 2014 at 6:53
• @CodeMocker Probably. :) However, I have almost no time the next two days so you are (of course) welcome to give an answer. Jan 20, 2014 at 7:03

Here's another tikz solution that is based on Jesse's code:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,automata,positioning,calc}
\begin{document}
\begin{center}
\tikzset{adim/.style={rectangle,minimum width=50,minimum height= 20,draw,thick}, nn/.style={rectangle,minimum width=210, minimum height=20,draw,thick},}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=7cm, thick,main node/.style={draw,font=\sffamily\Large\bfseries}]
\node (B) [adim] at (5,4)  {B 60};
\node (A) [adim] at (-1,4) {A 80};
\node (C)  [adim] at (2,2)  {C 100};
\node (K)  [nn]   at (2,0)  {Konsum};
\path[every node/.style={font=\sffamily\small}]
($(C.north west)+(0,-0.2)$) edge [bend right=8] node[right] {c} (A)
($(C.north east)+(0,-0.2)$) edge [bend left=8] node[midway,above,left] {6}(B)
(C)   edge node {150}(K)
($(C.north east)+(-0.2,0)$) edge [out=100,in=80] node[above]{30} ($(C.north west)+(0.2,0)$)
(A) edge [bend right=8] node[midway,below,left]  {40} ($(C.south west)+(0,0.275)$)
edge [bend left=8] node[midway,above] {104}(B)
edge node[midway,left]{14} ($(K.north)+(-3,0)$)
($(A.north east)+(-0.2,0)$) edge [out=100,in=80] node[above]{a} ($(A.north west)+(0.2,0)$)
(B) edge [bend left=8] node[midway,below,right]  {105} ($(C.south east)+(0,0.275)$)
edge [bend left=8] node[midway,below] {106}(A)
edge node[midway,right]{15} ($(K.north)+(3,0)$)
($(B.north east)+(-0.2,0)$) edge [out=100,in=80] node[above]{30} ($(B.north west)+(0.2,0)$);
\end{tikzpicture}
\end{center}
\end{document}


• You should provide a complete MWE. :-) Jan 20, 2014 at 0:12