I've got a program which is split into some files located in two main folders, src and include, with the header .h files in the include folder while .cpp and .cu files in the other. Here is a little drawing for the whole routine
Note#1 this is not exactly what I want to achieve but it may be a starting point.
Note#2 here you can find the meaning of the word routine, but here I mean just a complex application split into multiple files.
Is there a standard way to represent the tree of the files which a program is composed of? I mean the file tree, along with the folders tree. I'm looking for some solution to even add some of the relations within the files with some arrows. I'd like to use tikz if possible.
Right now this is my poor, far-to-be-optimized tikz image I realized:
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning}
\usetikzlibrary{calc}
\tikzset{
%Define standard arrow tip
>=stealth',
pil/.style={
->,
thick,
shorten <=2pt,
shorten >=2pt,},
gpufile/.style={
rectangle,
rounded corners,
draw=red, very thick,
minimum height=2em,
minimum width=8em,
text centered
},
cpufile/.style={
rectangle,
rounded corners,
draw=black, thick,
minimum height=2em,
text centered
},
header/.style={
rectangle,
draw=gray, thin,
minimum height=2em,
minimum width=5em,
text centered
},
folder/.style={
rectangle,
draw=yellow, thin,
minimum height=3em,
minimum width=5em,
text centered
}
}
\begin{document}
\begin{tikzpicture}[node distance=1.5cm, auto,]
\tikzstyle{every path}=[-latex,thick]
\node[
folder,
xshift=-2cm] (src) {src};
\node[
cpufile,
right of=src,
xshift=40pt] (main) {\texttt{main.cpp}};
\node[
gpufile,
right of=main,
xshift=40pt,
yshift=0pt] (trbdf2) {\texttt{tr-bdf2.cu}}
;
\node[
gpufile,
right of=trbdf2,
xshift=40pt,
yshift=0cm
] (jacobian) {\texttt{jacobian.cu}};
\node[
gpufile,
right of=jacobian,
xshift=60pt
] (inversion) {\texttt{matrix\_inversion.cu}};
\node[
gpufile,
right of=inversion,
xshift=60pt] (tr) {\texttt{newton\char`_tr.cu}};
\node[
gpufile,
right of=tr,
xshift=60pt] (bdf2) {\texttt{newton\char`_bdf2.cu}};
\node[
folder,
below of=src,
yshift=-1cm] (include) {include};
\node[
header,
right of=include,
xshift=40pt] (libs) {\texttt{libs.h}};
\node[
header,
right of=libs,
xshift=40pt] (constants) {\texttt{constants.h}};
\node[
header,
right of=constants,
xshift=40pt] (fdefs) {\texttt{functions\char`_defs.h}};
\node[
header,
right of=fdefs,
xshift=40pt] (defs) {\texttt{defs.h}};
\node[
header,
right of=defs,
xshift=40pt] (linsolver) {\texttt{linear\char`_solver.h}};
;
\end{tikzpicture}
\end{document}
I need to highlight .cu files in the project, they have a different meaning from the clasic .cpp files.
While sliding through the tikz library samples the closest I found to what I mean is this example, which is recommended just for a filesystem directory tree though.


make). During this, you want to highlight the current used (and included) files. If this is the case, i would use a different approach. Drop the notion of two different folders, just show that files are included. But then, i don't know what a standard representation would be, and i feel that there is none. – pschulz Feb 11 '17 at 18:32Makefileshould be useful and I'll consider it – Eugenio Feb 11 '17 at 18:45ls -r(possibly differently formatted)? This is something like your image at the end that lists the files and the directories that contain them. What's wrong with that? Or do you want to print the contents of yourMakefile? Or do you want one of those options plus some arrows connecting some of the files? And do you want this to happen automatically, or are you willing to type in the files and the relations? – Teepeemm Feb 11 '17 at 19:50dirtreedoesn't support TikZ, but Forest'sfolderstyle certainly does.) – cfr Feb 11 '17 at 23:50