[Tex/LaTex] Visualization backend for simple diagrams

diagrams

Could someone recommend a solution for coding this kind of diagram into a TeX document?

example of simple diagram

Background: Looking for further ways to make everything in my papers replicable or at least communicable in an open format, I am trying to stop using OmniGraffle for simple diagrams like the one above, which are common in sociology, political science and probably other disciplines.

From a previous question, I understand that Graphviz and igraph might fit, but I do not understand exactly how more integrated to my TeX documents they would make my diagrams.

The best for me would probably be to understand how to replicate these graphs with TikZ, but I am not sure that this would work out easily, as I have been unable to locate a tutorial on the topic (trying to adapt commutative diagrams with TikZ to that kind of diagrams did not work out well).

Best Answer

One way to draw such a diagram is to use node positioning. Here is a version that you can play around with.

\documentclass{minimal}

\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.markings}


\begin{document}

\begin{tikzpicture}[every node/.style={align=center,minimum width=4cm,minimum height=2cm,rectangle,outer sep=0pt},>=latex,
  decoration={
    markings,%  switch on markings
    mark=at position 0.25  with {\draw (-4pt,-4pt) -- (4pt,4pt);\draw (4pt,-4pt) -- (-4pt,4pt);}}
    ]


\node (empty) {};
\node[below=of empty] (mech-1) {mechanism\\descriptor};
\node[below=of mech-1] (mech-2) {mechanism\\descriptor};

\node[right=of empty] (event) {\textbf{event}\\caption};

\node[draw,right=of mech-1] (process-1-1) {\textbf{process}\\caption};
\node[draw,right=of process-1-1] (process-1-2) {\textbf{process}\\caption};

\node[draw,right=3cm of mech-2] (process-2-1) {\textbf{intermediate process}};
\node[draw,right=of process-2-1] (process-2-2) {\textbf{intermediate process}};

\node[below=of process-2-1] (failure) {\textbf{failure}};
\node[below=of process-2-2] (success) {\textbf{success}};

\draw[->] (event) -- (process-1-1);
\draw[->] (process-1-1.south) -- (process-2-1.north);
\draw[->] (process-2-1.north) -- (process-1-2.south);
\draw[->] (process-1-2.south) -- (process-2-2.north);

\draw[postaction={decorate}] (process-2-1) -- (failure);
\draw[->] (process-2-2) -- (success);

\end{tikzpicture}

\end{document}

The result is

enter image description here

Related Question