Is there a way to use a windows environmental variable in \href that uses this environment variable in the output PDF document?
When I use
\href{run:\%foo\%\\bar.cpp}{bar.cpp}
The PDF Reader I use (Adobe Acrobat Pro) appends SomeDriveLetter:\ to the front of the link to make
SomeDriveLetter:\%foo%\bar.cpp
of course this drive does not have the path that foo points to.
Rather, it should go to
%foo%\bar.cpp
%and\into the href? – David Carlisle Nov 02 '16 at 21:28\@percentcharand\@backslashcharto get a%and\but which pdf readers will do anything with a url of the formrun:%foo%? – David Carlisle Nov 02 '16 at 22:08%var%is the Windows/Command Prompt's syntax for environment variable, just like$varin bash. ■ So you just need to invokecmdwith appropriate arguments (I think the syntax iscmd /c ⟨command⟩); however you can't just pass arguments tocmdso you need to write a wrapper batch script (Windows shell script) and execute that. – user202729 Jul 04 '22 at 17:16