Discussion:
\include{} for files located in multiple different folders using latex (winedt)
(too old to reply)
d***@gmail.com
2007-03-14 16:58:45 UTC
Permalink
hello everyone,

i am writing my thesis and have all my chapters written as
separate .tex files that i combine into one file using the
\include{chapter_xyz} command. if i have all the files related to
each chapter in a separate folder, how do i then use the \include{}
command. i have tried using the path name - \include{C:\....\...} but
that doesn't seem to work nor does \include{.\...\....} where I just
start with the directory the main file is in.

any help is much appreciated.

thanks!
dhananjay
Enrico Gregorio
2007-03-14 17:13:11 UTC
Permalink
Post by d***@gmail.com
hello everyone,
i am writing my thesis and have all my chapters written as
separate .tex files that i combine into one file using the
\include{chapter_xyz} command. if i have all the files related to
each chapter in a separate folder, how do i then use the \include{}
command. i have tried using the path name - \include{C:\....\...} but
that doesn't seem to work nor does \include{.\...\....} where I just
start with the directory the main file is in.
Assume the main file is in some directory. Put the file of chapter 1 in
a subdirectory "chapter_001"; if the contents of Chapter 1 are in
the file chapter001.tex, then

\include{chapter_001/chapter001}

should work. But why are you using this strategy? Wouldn't it be the
same if all the files are in one directory?

Ciao
Enrico
Robin Fairbairns
2007-03-14 17:14:49 UTC
Permalink
Post by d***@gmail.com
i am writing my thesis and have all my chapters written as
separate .tex files that i combine into one file using the
\include{chapter_xyz} command. if i have all the files related to
each chapter in a separate folder, how do i then use the \include{}
command. i have tried using the path name - \include{C:\....\...} but
that doesn't seem to work nor does \include{.\...\....} where I just
start with the directory the main file is in.
if i understand you correctly, the faq

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

ought to help
--
Robin Fairbairns, Cambridge
Matt
2007-03-14 18:29:14 UTC
Permalink
Your slashes are going the wrong way.

Example ... abstract.tex is in the folder "Front" (a folder which
resides in the same folder as thesis.tex, the main file):

\include{./FRONT/acknowledgments}

the ./ is "current working directory" and then you tell it which
folder, and the file name.

Similarly:

\include{./CH1/introduction}

looks for the folder CH1 inside the working directory, and for the
file introduction.tex inside of CH1.
d***@gmail.com
2007-03-14 20:29:30 UTC
Permalink
you are right Matt! That was a silly error on my part. Thanks for
pointing it out. The chapterfolder.sty package (see link provided by
Robin Fairbairns above) also seems like a good way of accomplishing
the same thing.
Post by Matt
Your slashes are going the wrong way.
Example ... abstract.tex is in the folder "Front" (a folder which
\include{./FRONT/acknowledgments}
the ./ is "current working directory" and then you tell it which
folder, and the file name.
\include{./CH1/introduction}
looks for the folder CH1 inside the working directory, and for the
file introduction.tex inside of CH1.
d***@gmail.com
2007-03-14 20:31:39 UTC
Permalink
Enrico - my question relates to chapters or sections that have a lot
of figures in them so i want to keep all the figures pertaining to one
chapter in a separate folder.
Post by d***@gmail.com
you are right Matt! That was a silly error on my part. Thanks for
pointing it out. The chapterfolder.sty package (see link provided by
Robin Fairbairns above) also seems like a good way of accomplishing
the same thing.
Post by Matt
Your slashes are going the wrong way.
Example ... abstract.tex is in the folder "Front" (a folder which
\include{./FRONT/acknowledgments}
the ./ is "current working directory" and then you tell it which
folder, and the file name.
\include{./CH1/introduction}
looks for the folder CH1 inside the working directory, and for the
file introduction.tex inside of CH1.
Loading...