include with subfolders

441 views
Skip to first unread message

pebbleandclod

unread,
May 15, 2012, 10:27:23 PM5/15/12
to LaTeX Users Group
Hello,

I am putting together a lengthy document with many images.
I want to organize the files by keeping them in a subfolder.

If the file is intro.tex, the it sits in folder introFiles

From this Group, I have learned that

\include{./introFiles/intro}

is a good place to start.

How do I make such simple command work?

when I run pdflatex intro.tex , the compile step
completes, but there is also an error about not /introFiles/intro.aux

I also use \includeonly{intro}

What am I missing?

Thanks in advance!!
Best,
-Ryan

Gildas Cotomale

unread,
May 16, 2012, 4:27:28 AM5/16/12
to latexus...@googlegroups.com
> \include{./introFiles/intro}
>
Does this work better ?
\include{introFiles/intro} % without the leading ./

The StatsGuru™

unread,
May 16, 2012, 7:45:57 AM5/16/12
to LaTeX Users Group
Hi Ryan,

I use the Import package for this purpose. It works great because you
can then not only organise documents as separate subfolders, but you
can alsom with careful planning, create sub-documents (like chapters)
on their own in each subfolder, combining them together at the end
into your master document. Works great for collaborating on a large
document like a textbook or conference proceedings.

Of course, the other really good thing is that the Import package also
supports the use of sub-subfolders and so on. This means you can
structure your folders in the same way you might structure your text
and only work on the bit you need.

Recently we used this to create a new textbook with 5 authors working
simultaneously on their various pieces on a network drive. Each author
could work on their piece like it was a separate document, but
whenever anyone compiled the master document they had all the latest
revisions of everyone's work. An awesome solution, especially when
working with people not located in the same building.

Hope that helps,
Matthew.

pebbleandclod

unread,
May 19, 2012, 6:43:15 PM5/19/12
to LaTeX Users Group
Hello Gildas Cotomale,

The . vs ./ did not make a difference.
BUT, your message pushed me to ask whether the \includeonly{}
statement
ALSO needs the path. It does. I was using

\includeonly{intro}
...
\include{./introFiles/intro}

My MacTex wants to see:
\includeonly{./introFiles/intro}
...
\include{./introFiles/intro}


Thanks for the help!

Best,
-Ryan

pebbleandclod

unread,
May 19, 2012, 6:44:31 PM5/19/12
to LaTeX Users Group
Hello Mathew,

That import packages sounds very nice. I will try it. What you
describe is exactly what I want. Is there a particularly good
reference source for the import package?

I will get started.
Thanks!
-Ryan

The StatsGuru™

unread,
May 19, 2012, 10:10:01 PM5/19/12
to LaTeX Users Group

Hi Ryan,

The package documentation is pretty easy to follow as it is really
just a \usepackage{import} statement in your preamble and then a
\import{./folder/foo.tex} where you want to add your document.

I recommend not trying to import part pages, but rather use it to
import complete chapters or pages. It makes it cleaner in terms of
pagination and easier in terms of document management.

Cheers,
Matthew.
Reply all
Reply to author
Forward
0 new messages