[texhax] [tex-live] Access to Windows environment variables from \input

Philip Taylor P.Taylor at Rhul.Ac.Uk
Mon Oct 6 22:48:31 CEST 2014

Zdenek Wagner wrote:

> Environment variables are expanded by cmd.exe, not by I/O libraries.
> For these libraries % is just a character. You would have to call a
> system library for retrieving the environment variables. And the
> names of the environment variables are case sensitive and must be
> all uppercase. You can use set test=something and both echo %test%
> and echo %TEST% (and even echo %TesT%) will work because the
> conversion to uppercase will be done automatically by cmd.exe but it
> does not happen when called directly from your program. TEST will
> have the expected value while the value of test will be an empty
> string with no error message. TeX does not allow you to access
> environment variables but it might be possible by luatex (I do not
> know luatex, I just guess).

David Carlisle wrote:

> probably this would help
> as for loading .tex I assume that's just because (a) the shell was
> never called to expand environment variables and (b) I don't think
> you can have a% in the filename in windows so you got the empty
> filename with .tex appended... the latex tools directory has a .tex
> file exactly to catch that kind of weirdness.
> David (is texlive really the right list for this?)

It was hard to know, whence it was sent both to TeXhax and to TeX-Live.

Thank you both for your replies; all clear, but I am very surprised 
that a directory under .../texmf-dist/tex/latex/ should be in my TeX 
input path; I can understand it being in a LaTeX input path, but in a 
TeX input path as well ?

** Phil.

More information about the texhax mailing list