[OS X TeX] MacTeX 2007 setup query

Maarten Sneep maarten.sneep at xs4all.nl
Sat Feb 9 05:22:14 EST 2008


On 9 feb 2008, at 07:16, Rowland McDonnell wrote:

>> TeX Live has provisions for a local texmf tree which can be accessed
>> by all users on a machine. This tree is placed in
>>
>>  /usr/local/texlive/texmf-local
>>
>> This tree is NOT overwritten when the 2008 version is installed.
>
> We don't know that because the 2008 installer has not been  
> released.  In
> any case, that directory tree might be overwritten some other way.
>
> Am I being paranoid and excessively mis-trustful?  Could be - but then
> again, I've had a lot of bad experiences with installers.

This is the way the TeXLive installer has worked for years. The  
standard TeXLive installer is a shell script. With the number of shell  
functions they use it is a bit tricky to figure out what they do, but  
the TeXLive installer indeed does not touch the directory if it is  
there already.

I just checked the postflight script in the MacTeX installer package  
(2007 edition), and the tree is created there only if it doesn't exist  
already (see end of message).

And since the author of MacTeX 2008 is making this statement, I think  
you can be pretty sure this statement isn't going to change for the  
next release.

> I'd like to have my local texmf tree in a position that the MacTeX
> installer and so on don't even think about to avoid the risk of having
> my data messed about with.
>
> On the other hand, is there /good/ reason to think that it's a safe
> place to put local additions for all users?

This is what the TeXLive documentation says about this tree:

TEXMFLOCAL
This tree is where the TEX system (not as part of the initial  
installation, but rather as time goes by) puts non-version-specific  
files, primarily fonts. The default value is /usr/local/texlive/texmf- 
local, independent of the current TEX Live release, because it’s also  
the recommended location to put any local packages or configuration  
settings. (http://tug.org/texlive/doc/texlive-en/live.html)



I think there are four options for you:

* Modify texmf.cnf to point TEXMFLOCAL to your tree

* Modify texmf.cnf to add your tree to the search list (similar to how  
you do it now). This has the advantage that TeX & Co will always  
search the disk, thus not requiring a mktexlsr call after adding a  
package. Depending on the size

* Create a symbolic link to your tree at the location /usr/local/ 
texlive/texmf-local which points to your tree. Of course if you  
update, you'll have to temporarily remove the link to completely  
eliminate the link between tex and your tree.

* Put your tree in the TeXLive location /usr/local/texlive/texmf-local  
and keep a backup. I don't know how frequently you change items in  
this shared tree, but this location is covered by Time Machine on  
Leopard.



You'll probably go with the second option, as it is the most  
convenient from an end-user perspective.



On line 114 of /usr/local/texlive/2007/texmf/web2c/texmf.cnf the TEXMF  
variable is set:

TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!! 
$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}



Add your tree before this line:

TEXMFRM = /Users/Shared/texmf.rjmm

and modify line 114 to

TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,$TEXMFRM,!! 
$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}

I don't think you'll need to modify SYSTEXMF. This tree is used for  
generated fonts, and the default will be just fine. Besides you'll  
need to make sure that some permissions are set correctly if a tree is  
going to be suitable for this type of use. At least that is how I read  
the comments.

This is very similar to what you had figured out, except a missing  
comma.



There is a fifth option (cue Monty Python jokes, I started out with  
three options), but this requires the execution of a single command  
for each user on your system. Beyond that, there is no configuration  
to be changed. The disadvantage is that there will be no separate per  
user texmf tree. Execute

ln -s /Users/Shared/texmf.rjmm ~/Library/texmf

This only works if you don't already have a private tree.



> Either that, or could someone convince me that it's safe to use the
> standard mechanism for a local system-wide texmf tree?  At the moment,
> I'm unconvinced.

Given our previous encounters on the list, I doubt that we can. It  
will however work without a hitch on future updates.

This is the script fragment that creates the tree right after  
installation. You can find it in /Volumes/TeXCol2006-2007/mactex/ 
MacTeX-2007.mpkg/Contents/Packages/TeXLive-2007.pkg/Contents/Resources/ 
postflight on the MacTeX 2007 DVD:

# Add /usr/local/texlive/texmf-local if completely absent

if [[ ! -d /usr/local/texlive/texmf-local ]]; then
	mkdir /usr/local/texlive/texmf-local
	mkdir /usr/local/texlive/texmf-local/bibtex
	mkdir -p /usr/local/texlive/texmf-local/bibtex/bib/local
	mkdir -p /usr/local/texlive/texmf-local/bibtex/bst/local
	mkdir -p /usr/local/texlive/texmf-local/dvips/local
	mkdir /usr/local/texlive/texmf-local/fonts
	mkdir -p /usr/local/texlive/texmf-local/fonts/source/local
	mkdir -p /usr/local/texlive/texmf-local/fonts/tfm/local
	mkdir -p /usr/local/texlive/texmf-local/fonts/type1/local
	mkdir -p /usr/local/texlive/texmf-local/fonts/vf/local
	mkdir -p /usr/local/texlive/texmf-local/metapost/local
	mkdir /usr/local/texlive/texmf-local/tex
	mkdir -p /usr/local/texlive/texmf-local/tex/latex/local
	mkdir -p /usr/local/texlive/texmf-local/tex/plain/local
	mkdir /usr/local/texlive/texmf-local/web2c
	chmod -R 755 /usr/local/texlive/texmf-local
fi

The first line is the important one: "if the directory /usr/local/ 
texlive/texmf-local does not exist then…" See man test for the test (- 
d) itself. The 2008 version will be created by adding a few lines to  
the end of this script, the beginning will be used unaltered.

Best,

Maarten


More information about the MacOSX-TeX mailing list