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

David Carlisle d.p.carlisle at gmail.com
Mon Oct 6 22:02:52 CEST 2014


On 6 October 2014 20:15, Philip Taylor <P.Taylor at rhul.ac.uk> wrote:

>
>
> A TeX source needs to reference images from a location that is
> host-dependent, and I had hoped to accomplish this by \inputting a
> configuration file partially specified by a Windows environment
> variable.  In essence :
>
> D:\>set test=d:\
> D:\>tex
> This is TeX, Version 3.1415926 (TeX Live 2013/W32TeX)
> **\catcode `\% = \catcode `\a \input %test%/config.tex
> *\end
>
> However, not only does TeX (or XeTeX, or PdfTeX) not open the desired
> file, the diagnostic is even more confusing :
>
> (d:/TeX/Live/2013/texmf-dist/tex/latex/tools/.tex File ignored)
> No pages of output.
> Transcript written on texput.log.
>
> Cam anyone explain (a) why the environment variable is not deferenced
> when \input passes its parameter to the appropriate system internal, and
> (b) why TeX /does/ open (or perhaps only try to open)
> d:/TeX/Live/2013/texmf-dist/tex/latex/tools/.tex ?
>
> Philip Taylor
>
>
probably this would help

http://tex.stackexchange.com/questions/62010/can-i-access-system-environment-variables-from-latex-for-instance-home/62039#62039

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?)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20141006/382bc633/attachment-0001.html>


More information about the texhax mailing list