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.

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

My question is simple, are there some predefined directories (in the texmf file system) where I can save my .tex files for further inclusions ?

If yes :

  • which ones are they ?
  • Can I defined mine manually editing a configuration file ?

If not :

  • Is there some way to include a .tex file (placed anywhere on the disk) in a .tex file I write (anywhere on the disk too) ?

For instance :

I'm writing a document located at /media/XXX/documents/latex/foo/bar.tex And I need to include a file let's say located at ~/texmf/includes/style1.tex

ps : and between include or input, which one seems more appropriate in my case ?

share|improve this question
Your local ~/texmf should mimic the structure of your installed 'tex tree'. That means your personal LaTeX .sty files (and the like) should be located in ~/texmf/tex/latex/ (with further personal subdivisions if you like/need). .bib files could be put in ~/texmf/bibtex/bib/. And so on. I made the following, e.g.: mkdir -p ~/texmf/{bibtex,doc,fonts,tex,texdoc} (some of these have sub-directories as well). – jon Feb 21 '13 at 19:36
thanks for your answer but that doesn't really help to answer my question. where should I include my .tex include file ? – 발렌탕 Feb 21 '13 at 20:30
If it is a 'style' file as the name suggests, you 'should' give it a .sty extension (= style) and put it where I said the first time around. If it is a regular .tex file containing text that will be printed as part of the main file, I would keep it in the same directory as your 'masterfile'. And you should 'include' a .sty file in the preamble of your document; e.g., \usepackage{style1}. – jon Feb 21 '13 at 21:33
~/texmf/tex/latex/personal is the preferred directory (the innermost one can have any name you like). – egreg Feb 21 '13 at 23:47
For MiKTeX users this should help: Create a local texmf tree in MiKTeX. – Speravir Feb 22 '13 at 17:17
up vote 2 down vote accepted

On GNU/Linux systems using TeX Live, the best place for input files you commonly include is


(in place of personal use any name you like), because this tree is always searched for input files and does not require any hashing (like in the main trees).

On Mac OS X with the MacTeX version of TeX Live, use

share|improve this answer

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.