Thursday, July 16, 2009

Visualizing the Source Tree of a Project with the Command `tree'

The Unix command `tree' is nice for visualizing a project that spans multiple directories.

I use the following to get the tree structure for a MATLAB project:

tree -P "*.m" > lstree.tex

This creates a file lstree.tex with the tree structure. Then, to give it a XeLaTeX structure, prepend with the following:

 \documentclass[twocolumn]{article}
\usepackage{verbatim}
\usepackage{fullpage}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Gentium}
\setmonofont[Mapping=tex-text]{Gentium}
\begin{document}
\begin{verbatim}

and append the following:

\end{verbatim}
\end{document}
 

Compile with the command xelatex.
You will need xelatex, tree and gentium packages installed for these to work.

No comments: