There are excellent discussions on TeX.SE on how and where to store own LaTeX packages locally. In short:
- You need to store the files in the specific folder structure
texmf/tex/latex/mystuff, where LaTex will look for
texmf at some specific place, on Ubuntu with TeXLive usually
~/texmf. Continue reading
- You can change the location of this
texmf folder, e.g. to
~/.texmf (such that it will not be displayed in the file browser). Continue reading
However, your own package files will always need to be in this nested folder structure, and you might wish your packages folder to be somewhere else near your other LaTeX files. So here is a solution that works on Ubuntu (and other Unix-like operating systems), but not on Windows.
Your folder structure is like this:
~/texmf/tex/latex/mystuff, from where the packages are included in your LaTeX documents
~/Documents/coding/mystuff (or similar), where you want to edit and manage your package files
The idea is to create a symbolic link (excellent introduction in German) such that the
mystuff directory in one of the two places links to the other place. You can then access and edit the very same files using both paths.
So to create a symbolic link (read more), simply execute one of the two following commands in a terminal:
ln -s ~/texmf/tex/latex/mystuff ~/Documents/coding/mystuff
ln -s ~/Documents/coding/mystuff ~/texmf/tex/latex/mystuff
You first specify the source directory and second location and name of the link. Thus, using the first line,
mystuff is stored in
texmf with a symbolic link in
Documents, while using the second line gives it the other way around.