# Package for energy budget trees

Is there a package that can typeset trees used for energy budgets?

The image is an extract from Dynamic Energy and Mass Budgets in Biological Systems by B.Kooijman which is easily identifiable as having been typeset using LaTeX. Unfortunately I have only a PDF of the book.

-
You could use the dirtree package or TikZ. Have a look at Drawing a directory listing a la the tree command in TikZ. – Stefan Kottwitz Jan 11 '12 at 8:55
@StefanKottwitz I am not familiar with TikZ, but the link you posted is almost what I need can you help with partial code for the down arrow in the first leaf to get me going? – Yiannis Lazarides Jan 11 '12 at 9:00
dirtree is very easy to use. Try it ! – projetmbc Jan 20 '12 at 17:53
@projetmbc I tried it and it works except the I couldn't get the first level downarrows. – Yiannis Lazarides Jan 20 '12 at 18:15

You can use the package pst-tree. The following example is taken from the homepage of pstricks and shows a directory tree. You can simple adapt this. I reduced th example a litte bit to provide the code in this answer.

\documentclass[12pt,a4paper]{article}% Walter Schmidt
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{mathpazo}
\usepackage{courier}
\usepackage{geometry,url}
\usepackage{pst-tree,pst-node}
\newcounter{leaves}
\newcounter{directories}

\newenvironment{directory}[2][\linewidth]%
{%
\setcounter{leaves}{0}%
\edef\directoryname{D\thedirectories}
\begin{minipage}[t]{#1}% <-------- !!!
\setlength{\parindent}{\linewidth}
\parskip0pt%
\noindent
\Rnode[href=-\dirshrink]{\directoryname}{\parbox[t]{#1}{#2}}%
\par
}
{\end{minipage}}

\newcommand{\file}[1]{%
\edef\leaflabel{L\theleaves\directoryname}%
\par
\Rnode{\leaflabel}{\parbox[t]{\dirshrink\linewidth}{#1}}%
\ncangle[angleA=270,angleB=180,armB=0,nodesep=1pt,arrows=->]
{\directoryname}{\leaflabel}%
\par}

\newcommand{\dirshrink}{.95}
\begin{document}
\def\url#1{#1}
\begin{directory}{\url{fontinst}}
\file{\begin{directory}{\url{doc/}}
\file{\begin{directory}{\url{manual/}}
\file{\url{fontinst.aux}}
\file{\url{fontinst.log}}
\file{\url{fontinst.pdf}}
\file{\url{fontinst.tex}}
\file{\url{fontinst.toc}}
\file{\url{intro98.tex }}
\file{\url{ltxguide.cfg}}
\end{directory}}
\file{\url{encspecs.zip }}
\end{directory}}
\file{\url{examples.zip }}
\file{\url{inputs.zip   }}
\file{\url{latex.zip    }}

Of course the same is possible with the package tikz/pgf or tikz-qtree.