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:


  • The answer is no, and anyway the macro for showing it is Prompt("%$('TeX-Local');");. Why do you need WinEdt to know such an info? Commented Oct 25, 2013 at 5:22
  • If the PATH-variable is set so that it points to TeXLive then you could run kpsewhich --var-value=TEXMFLOCAL to get the path. Commented Oct 25, 2013 at 7:14
  • @karlkoeller: Hi Karl! The macro requires a .tlu script being installed. It is by default only with the full installation of TeX Live. If it's not installed, my install.edt would first, but it should go then to TEXMFLOCAL\scripts. As TeX Live, unlike MiKTeX, installs a local TeX root, I thought WinEdt might be aware of this local root as it is of the main root ; this would have greatly simplified writing install.edt.
    – Bernard
    Commented Oct 25, 2013 at 8:55
  • Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. Commented Oct 25, 2013 at 21:48

1 Answer 1


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).

  • Thanks, Karl. I knew about %$('TeX-Local') (which I mistyped in my initial message. I'll test your suggestion. My aim is that the install macro should be as much automatic as possible, saving the user from stepping in.
    – Bernard
    Commented Oct 25, 2013 at 10:28
  • Quite sorry for having forgotten! Actually I wanted first to make a temporary installation of texlive and try to test the macro I'm working on with your indications — I did, but in vain. Probably it's not possible to have MiKTeX and TeXlive both work normally. So I'll have to ask a user of both WinEdt and TeXlive to test if I find one who is willing to do so — or write a macro only for MiKTeX users.
    – Bernard
    Commented Oct 30, 2013 at 1:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .