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.

I need to generate an appendix with hundreds of tables. I put several tables on a page, as an earlier question established. The first level consists of pure tables, created as \begin{tabular}...\end{tabular} blocks. Let's call 4 such primitive files ch1-{a,b,c,d}.tex, i.e. ch1-a.tex,ch1-b.tex, ... These four documents are emitted into a directory /tex/ch1/.

The second level, which I call 2x2-ch1-abcd.tex, is also a tabular, containing

\include{a}

-- it is generated in the same subdirectory, /tex/ch1/. So far so good. If I wrap 2x2-ch1-abcd.tex in a preamble, it compiles.

Now I need to assemble such level 2 aggregates into a thesis. I have the master document as /tex/thesis.tex. If I say, in it,

\include{ch1/2x2-ch1-abcd}

-- I get the no nested includes error. If I replace \include by \input, the second level cannot find the first level files anymore.

I'd like to avoid encoding first-level paths into second-level matrices, to keep paths only in the master document. Can it be achieved within LaTeX without external symlinks?

share|improve this question

1 Answer 1

I believe (untested) that you can solve the problem with the import package:

\usepackage{import}
...
\subimport{ch1/}{ch1-a.tex}
   ...
   \input{2x2-ch1-abcd}

(where indentation denotes inclusion within the file above in the heirarchy). If you wish to \include the chapter file (rather than \input) it, use \subincludefrom instead of \subimport.

share|improve this answer
    
Thanks Will -- I decided to simply generate proper paths for each \input, but this is a very interesting path and yielded many more things on hierarchy, such as TEXINPUTS, security policy, etc. –  Alexy Feb 4 '11 at 8:21

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.