[OS X TeX] paths in input & include

Alain Schremmer Schremmer.Alain at gmail.com
Mon Feb 13 04:58:36 CET 2006

Ross Moore wrote:

> Hi Peter, and Alain,
> On 13/02/2006, at 9:57 AM, Peter Dyballa wrote:
>> Am 12.02.2006 um 22:59 schrieb Alain Schremmer:
>>> 2) I was wondering if, instead of having in the document
>>>    \include{FolderA/FolderB/File1}
>>> it would be possible to have in the preamble some sort of
>>>    \filespath{{./FolderA/FolderB/}}
>>> and then in the document just
>>>    \include{File1}
>> No, this won't work. graphics.sty itself looks up the graphics  files 
>> to be included, as far as I understand the code.
>> \graphicspath takes a *list* of arguments. It's proper use would  be, 
>> remembering your folders' structure:
>>     \graphicspath{{FolderA},{FolderB}}    % take it from either this, 
>> or  that, or somewhere else ...
> Firstly, this should be:   \graphicspath{{FolderA/}{FolderB/}}
>  a.  without the ,  which is redundant;
>  b.  you need the directory delimiter /
> otherwise LaTeX looks for   FolderAFile1.tex   or  FolderBFile1.tex
> by simply prepending the tokens to create the name.

I understand that but, above, I truly meant that FolderB was a subfolder 
of FolderA. The structure you have is about the only thing useful to me 
that I found on the subject in Companion2ed.

>> I am still a bit flexible so *I* can adjust myself or my customs to  
>> kind of inadequacies of a software -- up to some extent! Your  
>> extension has some charm. Do you need more motivation to propose it  
>> to the TeX programmers?
> I'd expect it to be rejected out-of-hand.
> The security reason is to prevent damage from running TeX on a file
> sent to you by someone else --- or at least restricting any malicious
> damage to the folder hierarchy below where the document has been
> processed.
> Your idea --- if it included paths with ../  --- would totally
> negate this security aspect.

Couldn't there be an identifier somewhere that would specify the files 
that can be overwritten?

> Besides, there is already the possibility that you desire.
> Simply place your files within the ~/Library/texmf hierarchy,
> e.g. within
>          ~/Library/texmf/tex/latex/myproject

You mean, as far as I am concerned, it would make no difference other 
than the desired one? I must confess to being much intimidated. Also, 
would Intaglio be able to save in there?

OK, I really should do a trial run. But what about whatever I won't find 
out until it is too late? Keep in mind that I am totally ignorant of all 
such things.

> Exactly the same search paths are used for any LaTeX input
> construction, such as:
>    \usepackage{<package>}
>    \RequirePackage{<package>}
>    \input{<file>}
>    \include{<file>}
>    \IfFileExists{<file>}{....}{....}
>    \InputIfFileExists{<file>}{....}{....}
>    \LoadClass{<class>}
> and also the TeX primitive  \openin .

For instance, I have no idea what the above does.

> There is a disadvantage to putting all of your files
> into  ~/Library/texmf/....
> It means that they can be found inadvertently by other
> jobs, where you want to input a file having the same name.
> Thus you'd really need to use unique names across all
> the different projects that you manage.

Ah! Here, I guess is the hidden cost. By having all these folders, I was 
often able to reduce the file names in each folder, for instance to 1, 
2, etc.

> The alternative is to structure your projects such that
> you are always looking downwards within the directory
> hierarchy for your  \include'd  files.
> That way there'll be no restrictions on writing .aux files.

I don't think I can do that because of the structure I described earlier.

> The use of (Unix) symbolic links to shorten paths has already
> been mentioned. This is also a good trick --- but this may not
> work if you share your files with someone using Windows.

I wish I were sharing but I am not. On the other hand, I understand 
nothing about Unix.

Best regards
------------------------- 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 macostex-archives mailing list