41

Is it possible (and not too difficult) to draw a table in the shape of an arrow? I think it's best explained giving an example:

enter image description here

I'd like to draw a table almost exactly like this. However, the 2nd, 3rd and 4th row don't have to be like that but can be just regular cells.

Is it possible to draw this easily or should I just make it in a vector program and import it in my LaTeXfile as a picture?

  • 1
    What is the reason to use the arrow shape? Why not only a vertical text on the last two cells? – Sigur May 5 '13 at 15:53
  • 4
    @Sigur: I'm guessing that it is meant to give a sense of 'flow' to the table. Even though I don't really get why it is used in this particular case, I think it is a good question in general. gieldl, I am sure someone will come by with a TikZ approach. – Bruno Le Floch May 5 '13 at 18:57
  • 2
    This is just a very common way of describing value chains, used in economics and business structures. It's pretty much always in exactly this shape. For more info: en.wikipedia.org/wiki/Value_chain – gieldops May 7 '13 at 22:54
68
+50

One possibility using TikZ:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,decorations.markings,decorations.pathreplacing}

\tikzset{ 
table/.style={
  matrix of nodes,
  row sep=-\pgflinewidth,
  column sep=-\pgflinewidth,
  nodes={rectangle,text width=2cm,align=center},
  text depth=1.25ex,
  text height=2.5ex,
  nodes in empty cells}
}

\begin{document}

\begin{tikzpicture}
\matrix (mat) [table]
{
& & & & &  \\
& & & & &  \\
& & & & &  \\
& & & & &  \\
& & & & &  \\
& & & & &  \\
& & & & &  \\
& & & & &  \\
};

% horizontal rules
\foreach \row in {2,3,4}
  \draw (mat-\row-1.north west) -- (mat-\row-6.north east);
\draw[ultra thick] (mat-8-1.south west) -- (mat-8-5.south east);
\draw[ultra thick] (mat-1-1.north west) -- (mat-1-5.north east);
\draw[ultra thick] (mat-5-1.north west) -- (mat-5-6.north east);

% vertical rules
\draw[ultra thick] (mat-1-1.north west) -- (mat-8-1.south west);
\foreach \col in {2,3,4,5}
{  \draw (mat-5-\col.north west) -- (mat-8-\col.south west);
    \draw[dash pattern=on 2pt off 1.5pt] (mat-2-\col.north west) -- (mat-5-\col.south west);
}
%\draw[dashed] (mat-2-5.north west) -- (mat-5-5.south west);

% The labels
\node at (mat-1-3) {Firm Infrastructure};
\node[fill=white] at (mat-2-3) {Human Resources Management};
\node[fill=white] at (mat-3-3) {Technology Development};
\node[fill=white,inner xsep=8pt] at (mat-4-3) {Procurement};
\node at ([yshift=-10pt]mat-6-1) {\parbox[t]{2cm}{\centering Inbound Logistics}};
\node at ([yshift=-10pt]mat-6-2) {\parbox[t]{2cm}{\centering Operations \\\mbox{}}};
\node at ([yshift=-10pt]mat-6-3) {\parbox[t]{2cm}{\centering Outbound Logistics}};
\node at ([yshift=-10pt]mat-6-4) {\parbox[t]{2cm}{\centering Marketing \& Sales}};
\node at ([yshift=-10pt]mat-6-5) {\parbox[t]{2cm}{\centering Service \\\mbox{}}};
\node[rotate = 90] at ([xshift=-52pt]mat-3-1.north) {SUPPORT ACTIVITIES};
\node at ([yshift=-19pt,xshift=-0.5cm]mat-8-3.south) {PRIMARY ACTIVITIES};

% Erase some visible lines outside the arrow
\fill[white] (mat-1-5.north east) -- (mat-5-6.north east) -- (mat-1-6.north east) -- cycle;

% Draw the arrow tip
\draw[fill=white,draw=black,ultra thick] (mat-1-5.north) -- (mat-5-6.north) -- (mat-8-5.south) -- (mat-8-5.east|-mat-8-5.south east) -- (mat-5-6.north east) -- (mat-1-5.east|-mat-1-5.north west) -- cycle;

% The slanted "Margin" labels
\begin{scope}[decoration={markings,mark=at position .5 with \node[transform shape] {Margin};}]
\path[postaction={decorate}] 
  ( $ (mat-1-5.north)!0.5!(mat-1-5.north east) $ ) -- ( $ (mat-5-6.north)!0.5!(mat-5-6.north east) $ );
\path[postaction={decorate}] 
  ( $ (mat-5-6.north)!0.5!(mat-5-6.north east) $ ) -- ( $ (mat-8-5.south)!0.5!(mat-8-5.south east) $ );
\end{scope}

% The braces
\draw[decorate,decoration={brace,mirror,raise=6pt}]
  (mat-1-1.north west) -- (mat-5-1.north west);
\draw[decorate,decoration={brace,mirror,raise=6pt}]
  (mat-8-1.south west) -- (mat-8-5.south);
\end{tikzpicture}

\end{document}

enter image description here

And a little variation, adding some color:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,decorations.markings,decorations.pathreplacing}

\definecolor{colone}{RGB}{209,220,204}
\definecolor{coltwo}{RGB}{204,222,210}
\definecolor{colthree}{RGB}{207,233,232}
\definecolor{colfour}{RGB}{248,243,214}
\definecolor{colfive}{RGB}{245,238,197}
\definecolor{colsix}{RGB}{243,235,179}
\definecolor{colseven}{RGB}{241,231,163}

\tikzset{ 
table/.style={
  matrix of nodes,
  row sep=-\pgflinewidth,
  column sep=-\pgflinewidth,
  nodes={rectangle,text width=2cm,align=center},
  text depth=1.25ex,
  text height=2.5ex,
  nodes in empty cells}
}

\begin{document}

\begin{tikzpicture}
\matrix (mat) [table]
{
|[fill=colfour]| & |[fill=colfour]| & |[fill=colfour]| & |[fill=colfour]| & |[fill=colfour]| &  \\
|[fill=colfive]| & |[fill=colfive]| & |[fill=colfive]| & |[fill=colfive]| & |[fill=colfive]| &  \\
|[fill=colsix]| & |[fill=colsix]| & |[fill=colsix]| & |[fill=colsix]| & |[fill=colsix]| & |[fill=colsix]| \\
|[fill=colseven]| & |[fill=colseven]| & |[fill=colseven]| & |[fill=colseven]| & |[fill=colseven]| & |[fill=colseven]| \\
|[fill=colone]| & |[fill=coltwo]| & |[fill=colthree]| & |[fill=coltwo]| & |[fill=colone]| & |[fill=colone]|  \\
|[fill=colone]| & |[fill=coltwo]| & |[fill=colthree]| & |[fill=coltwo]| & |[fill=colone]| & |[fill=colone]|  \\
|[fill=colone]| & |[fill=coltwo]| & |[fill=colthree]| & |[fill=coltwo]| & |[fill=colone]| & \\
|[fill=colone]| & |[fill=coltwo]| & |[fill=colthree]| & |[fill=coltwo]| & |[fill=colone]| &  \\
};

% horizontal rules
\foreach \row in {2,3,4}
  \draw[white] (mat-\row-1.north west) -- (mat-\row-6.north east);
\draw[white,ultra thick] (mat-1-1.north west) -- (mat-1-6.north east);
\draw[white,ultra thick] (mat-5-1.north west) -- (mat-5-6.north east);

% vertical rules
\foreach \col in {2,3,4,5}
  \draw[white] (mat-5-\col.north west) -- (mat-8-\col.south west);

% The labels
\node[fill=colfour] at (mat-1-3) {Firm Infrastructure};
\node[fill=colfive] at (mat-2-3) {Human Resources Management};
\node[fill=colsix] at (mat-3-3) {Technology Development};
\node[fill=colseven] at (mat-4-3) {Procurement};
\node at ([yshift=-10pt]mat-6-1) {\parbox[t]{2cm}{\centering Inbound Logistics}};
\node at ([yshift=-10pt]mat-6-2) {\parbox[t]{2cm}{\centering Operations \\\mbox{}}};
\node at ([yshift=-10pt]mat-6-3) {\parbox[t]{2cm}{\centering Outbound Logistics}};
\node at ([yshift=-10pt]mat-6-4) {\parbox[t]{2cm}{\centering Marketing \& Sales}};
\node at ([yshift=-10pt]mat-6-5) {\parbox[t]{2cm}{\centering Service \\\mbox{}}};
\node[rotate = 90] at ([xshift=-52pt]mat-3-1.north) {SUPPORT ACTIVITIES};
\node at ([yshift=-19pt,xshift=-0.5cm]mat-8-3.south) {PRIMARY ACTIVITIES};

% Erase some visible lines outside the arrow
\fill[white] (mat-1-5.north east) -- (mat-5-6.north east) -- (mat-1-6.north east) -- cycle;
\fill[white] (mat-8-5.north east) -- (mat-5-6.north east) -- (mat-8-6.north east) -- cycle;

% Draw the arrow tip
\shade[top color=colfour!70,bottom color=colfour!70,middle color=colseven,draw=white,ultra thick] 
  (mat-1-5.north) -- (mat-5-6.north) -- (mat-8-5.south) -- 
  (mat-8-5.south east) -- (mat-5-6.north east) -- (mat-8-5.south east) -- 
  (mat-5-6.north east) -- (mat-1-5.north east) -- cycle;

% The slanted "Margin" labels
\begin{scope}[decoration={markings,mark=at position .5 with \node[transform shape] {Margin};}]
\path[postaction={decorate}] 
  ( $ (mat-1-5.north)!0.5!(mat-1-5.north east) $ ) -- ( $ (mat-5-6.north)!0.5!(mat-5-6.north east) $ );
\path[postaction={decorate}] 
  ( $ (mat-5-6.north)!0.5!(mat-5-6.north east) $ ) -- ( $ (mat-8-5.south)!0.5!(mat-8-5.south east) $ );
\end{scope}

% The braces
\draw[decorate,decoration={brace,mirror,raise=6pt}]
  (mat-1-1.north west) -- (mat-5-1.north west);
\draw[decorate,decoration={brace,mirror,raise=6pt}]
  (mat-8-1.south west) -- (mat-8-5.south);
\end{tikzpicture}

\end{document}

enter image description here

  • 16
    I think this diagram could be a candidate for addition into the ctan.org/pkg/smartdiagram package – R. Schumacher May 6 '13 at 17:42
  • 5
    @GonzaloMedina such a nice end result. – percusse May 6 '13 at 19:50
  • 2
    Nice +1. -I am thinking that it might be possible to make a 'normal' table, and only use TikZ to append the arrow. -in that way the look from other tables is preserved. I do not know how to that myself. -it involves exact anchor points, and line widths. – hpekristiansen May 6 '13 at 20:11
  • 3
    @gieldl You're welcome! I updated my answer providing a version using colors, similar to the image in Wikipedia you linked to. – Gonzalo Medina May 8 '13 at 3:25
  • 9
    That is one of the most beautiful figures I've seen. Very clean and crisp. – recluze May 8 '13 at 3:58

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.