[texhax] finding files

Vladimir Lomov lomov.vl at gmail.com
Thu Dec 17 10:22:48 CET 2009


On Wed, Dec 16, 2009 at 09:30:42 -0500, david allen wrote:
David Allen => DA
Ulrike Fischer => UF

DA> Thanks. Also, your graphic display of my layout is much better than my
DA> description.

DA> Another question: In c/c++ and html, if you have a path in an include
DA> statement
DA> the path is relative to the current file. In LaTeX the path is relative to
DA> the master file.
DA> Are these correct observations?

Do you read Ulrike's reply?

DA>> I just switched from windows to linux (ubuntu) and have installed texlive
DA>> 2009.

DA>> I have a ~/texmf directory where I have put some bib and sty files.

DA>> I have a directory ~/book that contains master.tex. master.tex has things
DA>> like
DA>> \include{chapter1} \include{chaper2} etc. Now, chapter1.tex resides in
DA>> the directory ~/book/chapter1 along with perhaps included graphics files
DA>> and related R programs.

DA>> I would like to cd to book and have latex find the files in its subsidiary
DA>> directories.
DA>> I am not keen on moving book to be subsidiary to texmf because there is a
DA>> lot of non-tex stuff there.

UF> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=docotherdir

In short:
Yes, 'TeX doesn't have a changable "current directory", so that all
files you refer to have to be specified relative to the same directory
as the main file.'

Just tested:

~/works/tex/test/paths
  master.tex
    \include{chapter1/chap1}

~/works/tex/test/paths/chapter1
  chap1.tex
    \include{sec1-1}
    \include{sec1-2}
  sec1-1.tex

~/works/tex/test/paths/chapter1/sec
  sec1-2.tex

[~/works/tex/test/paths] $ pdflatex master.tex
                               ..........
(./chapter1/chap1.tex

! LaTeX Error: \include cannot be nested.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.5 \include{sec1-1}
                               ..........

-- 
Time-sharing is the junk-mail part of the computer business.
		-- H.R.J. Grosch (attributed)


More information about the texhax mailing list