One of the things to keep in mind is that in windows many of the configuration variables are not activated by default, added to this, some things we can do with administrator permissions and others as a simple user. I will incline for the option of simple users, that is to say the configurations will only affect the current user of the system.
For this example, the username is yourself
and every time we start a command line cmd
we will do it without administardor privileges.
Configuration of variables and directories
- Configuration of
TEXMFHOME
When you run on a command line cmd
you will get:
C:\Users\yourself>kpsewhich -var-value=TEXMFHOME
C:/Users/yourself/texmf
But, in reality the texmf
directory does not exist as such, we must create it following the TDS
structure. We will create it taking care in the path separator which in this case is \
.
C:\Users\yourself>mkdir texmf\tex\latex
- Configuration of
TEXMFCNF
Open a command line cmd
and execute the following line:
C:\Users\yourself>kpsewhich -all texmf.cnf
c:/texlive/2019/texmf.cnf
c:/texlive/2019/texmf-dist/web2c/texmf.cnf
The output indicates that the variable is not configured for our user. We configure it in the following way:
C:\Users\yourself>setx TEXMFCNF C:/Users/yourself/texmf;
CORRECTO: se guardó el valor especificado.
We go out and we go back in and run:
C:\Users\yourself>reg query HKEY_CURRENT_USER\Environment
HKEY_CURRENT_USER\Environment
Path REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
TEMP REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Temp
TMP REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Temp
OneDrive REG_EXPAND_SZ C:\Users\yourself\OneDrive
TEXMFCNF REG_SZ C:/Users/yourself/texmf;
We have finished setting this variable. This variable will be used in conjunction with the auxtrees
command in the example.
- Configuration of
TEXINPUTS
Suppose we have a directory D:/transcripts
sections or images but they are only available locally and we want them for testing. The best thing in this case is to use the TEXINPUTS
variable and here it depends on whether we want the configuration to be permanent (always available) or temporary (only in the current console).
a. Temporary configuration
Open a command line cmd
and execute:
C:\Users\yourself>set TEXINPUTS=.;D:/transcripts//;
this will work until you close the command line, that is, you must execute this every time after close a command line.
b. Permanent configuration
Open a command line cmd
and execute:
C:\Users\yourself>setx TEXINPUTS .;D:/transcripts//;
close command line. In this way we have configured TEXINPUTS
in your environment variable and now it is permeating.
If you need to see TEXINPUTS
from environment variable, use:
C:\Users\yourself>reg query HKEY_CURRENT_USER\Environment
If you need to delete TEXINPUTS
from environment variable, use:
C:\Users\yourself>reg delete HKEY_CURRENT_USER\Environment /v TEXINPUTS /f
Alternatively this can be done in a graphical mode adjusting your environment variable.
Full example using auxtrees
This is part of the configuration that we use with a group of colleagues in my work using a project hosted in github
(which we also distribute in .zip
format) with the use of some packages and custom classes, transcribe the part related to windows (I hope you understand, my native language is Spanish). The TDS
folder for this example is located in D:/ltxcole/stycole/
and the structure of the project is:
D:\ltxcole>tree
Listado de rutas de carpetas para el volumen driveD
El número de serie del volumen es FACD-A6DF
D:.
├───octavo
│ ├───diagnostico
│ ├───guias
│ ├───pruebas
│ ├───test
│ └───trabajos
├───produccion
├───septimo
│ ├───diagnostico
│ ├───guias
│ ├───pruebas
│ └───test
├───sintesis
└───stycole
└───tex
└───latex
The key is in stycole
which has a TDS
structure:
└───stycole
└───tex
└───latex
colegio-new2019.sty
keyanswer.sty
logoaurora.jpg
tkz-custom.sty
The TeXLive documentation for Windows configurations is not very "explanatory", but, in the forum there is good information. The use of auxtrees
allows you to maintain several projects without affecting the entire system using the TEXMFLOCAL
variable or loading everything into TEXMFHOME
.
Open a command line cmd
and execute:
C:\Users\yourself>tlmgr conf auxtrees --conffile C:/Users/yourself/texmf/texmf.cnf show
tlmgr.pl: no auxiliary texmf trees defined.
the output tells us that we have nothing configured, now we run:
C:\Users\yourself>tlmgr conf auxtrees --conffile C:/Users/yourself/texmf/texmf.cnf add D:/ltxcole/stycole/
to verify that everything is correct we run:
C:\Users\yourself>tlmgr conf auxtrees --conffile C:/Users/yourself/texmf/texmf.cnf show
List of auxiliary texmf trees:
D:/ltxcole/stycole/
With this we have finished configuring our project, the files placed in D:/ltxcole/stycole/tex/latex/
will be available for all our files. The file C: Users\yourself\texmf.cnf
contains the following line:
TEXMFAUXTREES = D:/ltxcole/stycole/,
and you can add as many projects as you want as long as you respect the TDS
structure.
Of course, if you only want to do tests for yourself it is simpler to use TEXMFHOME
, although the advantage of using auxtrees+git
is that you can generate a cross-platform configuration script or a simple README
with relevant instructions for a collaborative project.
TEXMFHOME
. Much less hassle thanTEXMFLOCAL
...TEXMFHOME
is good for personnal work.TEXMFLOCAL
is good for all users of the OS... and may require admin/super-user privileges.