[OS X TeX] include cannot be nested?

Alain Schremmer Schremmer.Alain at gmail.com
Sun Nov 5 15:30:27 EST 2006


Themis Matsoukas wrote:

> On Nov 4, 2006, at 5:10 PM, Charilaos Skiadas wrote:
>
>> I am guessing pdfsync might also not work with \input'ed
>> files, but I haven't tested this.
>
>
> Yes, it does. In fact, if you command click on the line \input 
> {myfile.tex} of the main file, the pdf will open on the page 
> corresponding to myfile.tex. Then, command-clicking on the pdf page 
> takes you to myfile.tex. This makes navigation between multiple 
> documents very convenient. Sometimes these synchronizations fail 
> unpredictably but for the most part they work.
>
> It is also possible to nest \includegraphics but this is a bit messy. 
> It goes like this:
>
> Root file: folder0/folder1/main.tex
> input file: folder0/folder2/folder3/myfile.tex
> graphics file: folder0/folder2/folder3/mygraph.eps
>
> In this example, folder2 is at the same level as folder1 and may 
> contain several problems in parallel subfolders, eg folder2/folder3, 
> folder2/folder4, etc. I use this setup to keep track of homework 
> problems by placing all associated files (graphs, notebooks, etc) in a 
> separate folder for each problem.
>
> To make graphics work, in myfile.tex load the graphics using:
> \includegraphics[scale=0.5]{folder3/mygraph}
>
> In main.tex (root file) set the graphics path to
> \graphicspath{{../folder2/}}
>
> and load the source file using
> \input{../folder2/folder3/myfile.tex}
>
> This should load the source file and the graphics. If the nesting of 
> folders is different, one must make the corresponding changes.
>
> The messy part is that the graphics path must be split into two parts, 
> one that goes in \graphicspath (this is the common part of the path of 
> all graphics files) and the rest that goes in \includegraphics. This 
> split is necessary if you want (as I do) to \input multiple files, 
> each stored in different folders.

As far as includegraphics goes, and for reasons elucidated by Ross 
includegraphics goes a lot better than include, I found it a lot easier, 
given that by now I have probably over a thousand figure for the magnum 
opus, to put something like the following in a style sheet MyFigures.sty

    \graphicspath{
    {./Figures/}
    {../Figures/}
    {../../Figures/}
    {../../../Figures/}
    {./Figures/1/}
    {../Figures/1/}
    {../../Figures/1/}
    {../../../Figures/1/}
    etc
    }

That way, I can put my figures—which I number uniquely and, by now, in 
an almost completely random manner—in any folder nested inside Figures 
and, with \usepackage{MyFigures} in the preamble, just leave, say,

    \includegraphics{3-00-041aab}

for LaTeX to find.

For /me/ to find a particular figure, I can go to the relevant folder, 
inasmuch as it still makes sense, of just look it up in the pdf output 
and rely on pdfsync to get me to the code that gives me the number of 
the figure.

Regards
--schremmer



------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list