This is highly dependent on your work flow. For example, I do all of my plotting in pgfplots
so data is central to me rather than plot images. A typical paper that I'm writing will have
- A master folder with the
.tex
file. Inside the master folder are:
- A folder for images, figures and externalized (it using TikZ/
pgfplots
) figures.
- A folder for data. Keep this away from your programs!
- A folder for scripts and programs. Don't write directly to the data folder!
However, each paper is a very simple document. For something much larger like my thesis I had an elaborate directory structure, with each chapter in its own folder. The master .tex
file sat in a special folder called build
rather than at the top of the structure. Each chapter was otherwise treated like a paper in the simple structure above, and there were a couple of other special folders to contain the preamble and macros etc.
For (very) simple documents it may not be worth having any structure at all, opting for a pool of files in a single folder.
Putting aside my paranoia about having data to be published in the same directory as scripts and programs that can overwrite it, modern operating systems offer simple ways to view the contents of a directory by type in the UI. In a *nix terminal this is trivial too with something like
ls *.dat
to view just data files. One could therefore make a case for no special directory structure at all for all but the largest documents.
A final note; for large documents, consider using version control. I suggest Git, but that's a matter of taste. It's saved my skin more times than I care to mention.
There are several reasons:
(In the following sections see “package” in a broader meaning including also scripts, binaries etc.)
The TeX distributions do not install all available packages known in the TeX world. TeX Live includes only packages, which come with a free licence; MiKTeX is not that strict about that, but, as far as I see, both distributions do include only packages, which are available on CTAN. Still today an uncountable amount of packages is obtainable only on their own web sites. You could include these packages into the normal tree, but very likely you would lose them on a distribution update. Also they would not automatically be updated by the package managers, you need to do this manually for your own. In a local texmf tree in my humble opinion this is obvious, hidden in the main texmf tree this can easily be forgotten.
For a couple of packages you can get test versions. These should in no way go into the normal package tree (with overwriting the stable version!). The local texmf directory is always searched first, and so, if there exist two versions of the same package, the test version ist found before the regular.
For some packages and utilities you can configure preferred settings, which will be saved in configuration files and are to be contained on an update of the TeX distribution. So they must be in a local tree. (Note: For this purpose there are special local trees pre-installed.)
Best Answer
Here's one possibility using
forest
andTikZ
:The code:
The command
\myfolder
has one mandatory argument for the label of the folder and an optional argument for the color.