Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to make a simple directory tree representation in LaTeX. Something like:

 +-- ham
 +-- eggs
     +-- more spam
     +-- dead parrots

The tree won't be that long (say, 10--15 entries or so), with three or so levels, and is a one-off thing. So, quick-and-dirty solutions are welcome. When recommending tikz1, please note that I have almost no experience with it, so I'd appreciate a clean simple solution, even if it doesn't look quite perfect.

1 On Tex.SE tikz is almost like the jquery recurring joke on StackOverflow..

Edit: As per Thorsten's suggestion, dirtree is a nice and easy-to-use solution. The example from above could be written as:

.1 spam.
.2 ham.
.2 eggs.
.3 more spam.
.3 dead parrots.
share|improve this question

1 Answer 1

up vote 21 down vote accepted

The dirtree package is your friend.

share|improve this answer
Unfortunately dirtree is in conflict with algorithmic and pseudocode. So it's useless in many cases. –  user6052 Jun 9 '11 at 12:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.