[OS X TeX] paths in input & include

Ross Moore ross at ics.mq.edu.au
Sun Feb 12 19:30:56 EST 2006


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 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.



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

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 .


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.

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.

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.


>
> --
> Greetings
>
>   Pete
>
> “Computers are good at following instructions, but not at reading  
> your mind.”
>    - D. E. Knuth, The TeXbook, Addison-Wesley 1984, 1986, 1996, p. 9


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------


------------------------- 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