Ceci est une ancienne révision du document !


Installations privées de fichiers

Il arrive parfois que vous ayez besoin d'une nouvelle version d'un package ou d'une police de caractères, mais que la machine que vous utilisez soit gérée par quelqu'un qui n'est pas disposé à effectuer les mises à jour et qui ne vous accorde pas les droits nécessaires pour que vous puissiez faire le travail vous-même. Une installation « temporaire » est parfois la bonne approche, cependant, s'il y a la moindre chance que cette installation soit nécessaire pour plus d'un projet, une solution temporaire n'est pas satisfaisante.

Si vous disposez d'un espace-disque suffisant (éventuellement sur un espace temporaire, comme un “scratch”), une bonne approche consiste à installer une version privée de (La)TeX, complète et incluant les nouveaux éléments dont vous avez besoin ; c'est l'idéal, mais ça utilise plusieurs gigaoctets d'espace-disque.

So, since you can't install into the public texmf tree, you have to install into a texmf tree of your own; fortunately, the TDS standard allows for this, and modern distributions allow you to do it. The most modern distributions refer to the tree as $TEXMFHOME, but it used to be called $HOMETEXMF; so to check that your TeX system does indeed support the mechanism you should start with

kpsewhich -var-value TEXMFHOME

(for example). This will almost invariably return a pointer to a subdirectory texmf of your home directory; the commonest exception is Macintoshes, using MacTeX, where the diretory is conventionally Library/texmf in your home directory.

If you can confirm that the technique does indeed work, install your new package (or whatever) in the correct place in a tree based on $HOME/texmf, and generate an index of that tree

texhash $HOME/texmf

(the argument specifies which tree you are indexing: it's necessary since you don't, by hypothesis, have access to the main tree, and texhash without the argument would try to write the main tree.

There are two wrinkles to this simple formula: first, the installation you're using may not define a home TEXMF directory, and second, there may be some obstruction to using $HOME/texmf as the default name. In either case, a good solution is to have your own texmf.cnf — an idea that sounds more frightening that it actually is. The installation's existing file may be located with the command:

kpsewhich texmf.cnf

Take a copy of the file and put it into a directory of your own; this could be any directory, but an obvious choice is the web2c directory of the tree you want to create, i.e., $HOME/texmf/web2c or the like. Make an environment variable to point to this directory:

TEXMFCNF=$HOME/texmf/web2c
export TEXMFCNF

(for a Bourne shell style system), or

setenv TEXMFCNF $HOME/texmf/web2c

(for a C-shell style system). Now edit the copy of texmf.cnf

There will be a line in the existing file that defines the tree where everything searches; the simplest form of the line is:

TEXMF = !!$TEXMFMAIN

but, there are likely to be several alternative settings behind comment markers (%), and the person who installed your system may have left them there. Whatever, you need to modify the line that's in effect: change the above to three lines:

HOMETEXMF = $HOME/texmf
TEXMF = {$HOMETEXMF,!!$TEXMFMAIN}
% TEXMF = !!$TEXMFMAIN

the important point being that $HOMETEXMF must come before whatever was there before, inside the braces. For example, if the original was

TEXMF = {!!$LOCALTEXMF,!!$TEXMFMAIN}

it should be converted to:

HOMETEXMF = $HOME/texmf
TEXMF = {$HOMETEXMF,!!$LOCALTEXMF,!!$TEXMFMAIN}
% TEXMF = {!!$LOCALTEXMF,!!$TEXMFMAIN}

(retaining the original, as a comment, is merely an aide-memoir in case you need to make another change, later). The !! signs tell the file-searching library that it should insist on a texhash-ed directory tree; if you can count on yourself remembering to run texhash on your new tree every time you change it, then it's worth adding the marks to your tree:

TEXMF = {!!$HOMETEXMF,!!$LOCALTEXMF,!!$TEXMFMAIN}

as this will make (La)TeX find its files marginally faster.

Having made all these changes, (La)TeX should “just use” files in your new tree, in preference to anything in the main tree — you can use it for updates to packages in the main tree, as well as for installing new versions of things.


Source:

5_fichiers/tds/installation_privee.1682288345.txt.gz · Dernière modification : 2023/04/23 22:19 de jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0