Take the 2-minute tour ×
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.

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 ? –  Oddant 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
2  
~/texmf/tex/latex/personal is the preferred directory (the innermost one can have any name you like). –  egreg Feb 21 '13 at 23:47
1  
For MiKTeX users this should help: Create a local texmf tree in MiKTeX. –  Speravir Feb 22 '13 at 17:17

1 Answer 1

up vote 2 down vote accepted

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

~/texmf/tex/latex/personal

(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

~/Library/texmf/tex/latex/personal
share|improve this answer

Your Answer

 
discard

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.
http://tex.stackexchange.com/questions/99298/are-there-some-predefined-directories-for-tex-file-inclusion
tex.stackexchange.com
crawl=CC-MAIN-2014-52
73015
application/http; msgtype=response
sha1:4VCNF4BRRZ7QNKGX4CQYPQJDQ4MBGRVP
<urn:uuid:76236988-e3da-43b5-b28b-45011f0cb691>
2014-12-28T12:23:10Z
198.252.206.140
sha1:6HSJTAABGZ3GHVM3OVK4X5VOOH5P5EVH
<urn:uuid:767e88a7-bfed-4ffb-b637-454a18418598>
http://tex.stackexchange.com/questions/99298/are-there-some-predefined-directories-for-tex-file-inclusion
response
<urn:uuid:bb340877-aacd-4429-9639-6a0f66053ddd>
robots: classic
hostname: ip-10-231-17-201.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2014-52
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for December 2014
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf