[Tex/LaTex] WinEdt and TeX Live

texlivewinedt

I'm preparing a macro for WinEdt and need to know a few things about WinEdt 7/8 with TeX Live. Unfortunately I am a MiKTeX user, and I call on a TeX Live + WinEdt user in order to get the following information:
Does WinEdt know what is the path to the texmf-local root directory without having to tell it via the 'TeX Options' tab in the Options->Execution Modes menu item? To be sure, it would be enough to execute a macro with just one line:

Prompt("TeX-Local");

Best Answer

First of all, a clarification. Adding a value in "TeX Local Root" in the Execution Modes interface (TeX Options page) does nothing more than setting a WinEdt internal variable called TeX-Local which is not used in the defaults.

enter image description here

You can use its value (when set), for example, for adding the local TEXMF directory to WinEdt's input directives, Tree interface and so on.

This variable is accessible inside scripts as %$('TeX-Local');

But in your case, I think you are looking for a method to retrieve the contents of the environment variable TEXMFLOCAL and this is certainly possible.

In fact, an environment variable is accessible in WinEdt scripts as %@('EnvVar');. So it suffices to use "%@('TEXMFLOCAL');\scripts" to have the path you need.

Note that in certain cases (when the above variable needs to be expanded) it might not work. In such a case you need to fully expand the path by adding @@ before it, that is to say @@"%@('TEXMFLOCAL');\scripts" (this has been introduced, IIRC, in v7.1).

Related Question