Symlinks (was Re: [OS X TeX] Fwd: Unwanted files have which extensions?)

Bruno Voisin bvoisin at mac.com
Tue Aug 17 09:44:59 CEST 2004


Le 17 août 04, à 01:19, Alain Schremmer a écrit :

> - When including figures, I would like TeXshop to accept aliases. I  
> still save copies before doing something I am not sure of. The way I  
> do it is to have the TeX file and the Figures in a folder carrying the  
> version number. Then, I just duplicate the folder and increase its  
> version number. It would be nice to use only aliases for, instead of  
> copies of, the figures.

Here the problem is not with TeXShop, but with tex (the command line  
program, which is the engine used by TeXShop behind the scene). tex,  
being of Unix origin (to simplify), does not understand Mac OS aliases;  
it does understand, however, Unix symlinks (contraction of symbolic  
links), created with the command "ln -s" in Terminal. To learn more  
about this command, you can type "man ln" (without the quotes) in  
Terminal. The Finder in Mac OS X understands both traditional Mac OS  
aliases, and Unix symlinks, and displays them in the same way.

I've used symlinks in conjunction with TeXShop in the past, and that  
works. For example, one of the folders on my hard drive has a similar  
structure (edited for brevity) as the one you're looking for:

ls -alR
total 88
drwxrwxrwx  59 brunovoi  staff  2006 13 Feb  2003 Dessins
drwxrwxrwx  54 brunovoi  staff  1836 16 Feb  2003 EPSF
drwxrwxrwx  59 brunovoi  staff  2006 13 Feb  2003 Figures
drwxrwxrwx   8 brunovoi  staff   272 10 Jun  2003 Version 2.0.1
drwxrwxrwx   6 brunovoi  staff   204 13 Feb  2003 Version 2.0.2
drwxrwxrwx  19 brunovoi  staff   646 13 Feb  2003 Version 2.0.3
-rwxrwxrwx   1 brunovoi  staff  5007 28 Oct  1999 lcdmacros.tex
-rwxrwxrwx   1 brunovoi  staff  5041 28 Oct  1999 lcdupmath.sty
-rwxrwxrwx   1 brunovoi  staff  4861 28 Dec  1998 macros.tex

where the subfolder Figures contains:

./Figures:
total 9520
-rwxrwxrwx   1 brunovoi  staff   48729 30 Dec  1998 finfield.eps
-rwxrwxrwx   1 brunovoi  staff   65749  8 Jan  1999 geomfour.eps
-rwxrwxrwx   1 brunovoi  staff   86314 26 Aug  1998 geomreal.eps
[...]

and the folder Version 2.0.1 (where a .tex file to be typeset resides)  
contains:

./Version 2.0.1:
total 1360
lrwxr-xr-x   1 brunovoi  staff      10 14 May  2003 Figures ->  
../Figures
lrwxr-xr-x   1 brunovoi  staff      13 14 May  2003 macros.tex ->  
../macros.tex
-rwxrwxrwx   1 brunovoi  staff  131137  9 Mar  1999 pap3v2.tex
-rwxrwxrwx   1 brunovoi  staff    1408  9 Mar  1999 paren.tex
-rwxrwxrwx   1 brunovoi  staff  129472 11 Mar  1999 ppt3v2.tex

The first letter "l" here at the beginning of a line indicates a  
symlink, and "Figures -> ../Figures" indicates the exact nature of this  
link (namely, the folder "Figures" in the parent directory).

I've never got the syntax of ln to work exactly as I wanted it to, for  
example specifying the name of the symlink to be different from the  
link of the original file (or directory). To get the above structure I  
had to use trial-an-error, though I don't remember exactly what I did.  
In any case, for example:

- "ln -s AAA/BBB" creates, in the current directory, a symlink named  
"BBB" to the subdirectory "BBB" of the subdirectory "AAA" of the  
current directory.

- "ln -s ../CCC/DDD" creates, in current directory, a symlink named  
"DDD" to the subdirectory "DDD" of the subdirectory "CCC" of the parent  
directory.

Maybe some Unix-knowledgeable people on this list would have more  
helpful indications on the precise syntax of ln? A lengthy discussion  
of symlinks with respect to TeX, entitled "[OS X TeX] Aliases, symlinks  
and hard links", also took place on this list starting 12 February 2003  
<http://www.esm.psu.edu/mac-tex/MacOSX-TeX-Digests/2003/MacOSX- 
TeX_Digest_02-12-03.html>.

Hope this helps,

Bruno Voisin
--------------------- 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 Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list