TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing an article using LaTeX. It is a research report about developing mathematics ebook using LaTeX. It contains directory list consists of folders and files, like this:

    - [folder_icon][folder_name]
      + [file_icon][file_name.extension]
      - [folder_icon][folder_name]

For example:

    - [icon][MatheBook]
      + [icon][math_ebook.tex]
      - [icon][Pictures]

How to do that? I am using MikTeX and TeXnicCenter.

share|improve this question
Duplicate of tex.stackexchange.com/questions/23647/… – TeXtnik Jun 28 '13 at 10:35
Do you have special requirements concerning the layout of the list? If not, I agree with @zunbeltz that this is a duplicate. Look also at ctan.org/pkg/dirtree – Charles Stewart Jun 28 '13 at 10:39
I've read your references, but these examples without including icon. – Edy Jo Jun 30 '13 at 4:02
Possible duplicate: Making a (simple) directory tree – Werner Jun 30 '13 at 4:10
@Werner a more explanatory duplicate: How to draw a hierarchical structure with edges? – Alan Munn Jun 30 '13 at 4:12

Since you seem to think that the dirtree solutions won't work, here's an example which I think will show you that they can.

You simply need to create a macro to generate the icon/name pair. Since I don't know how you are implementing your icons, I've made a mock-up here. You'd need to modify it to match the way your icons are actually generated.

% The following is a dummy icon command
% If you have actual icon images, use \includegraphics to include them
% If you are generating them, put in the appropriate code for them here
% now we make a command for a folder/file which inserts the icon and its label
% adjust this as needed. If you only have 2 icons, then you could create
% a \myfile and \myfolder command with the icon fixed.
\newcommand{\myfolder}[2]{\myicon{#1}\ {#2}}


.1 \myfolder{red}{Mathbook}.
.2 \myfolder{blue}{Pictures}.
.3 \myfolder{green}{math.png}.
.3 \myfolder{green}{math2.png}.
.2 \myfolder{blue}{Exercises}.
.4 \myfolder{brown}{Something}.


output of code

share|improve this answer
Thanks! quite helpful. – Edy Jo Jun 30 '13 at 11:31

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.