I am looking for a Python-style virtualenv or venv to create a virtual environment where I can install LaTeX packages such that the packages are available to my current LaTeX project only (but not available system-wide).
I am expecting something like the following:
- Create a virtual-environment path, say,
./venv. - Set some environment variables or modify
tlmgr installcommands such that new packages are installed into./venvwith the proper directory structure. - Set some environment variables or modify
pdflatexcommands such that the new documents I compile use packages from the./venvdirectory along with the packages in the system-wide paths that came with Tex Live distribution. - I do not however want to hardcode any
./venvpaths in the LaTeX documents (the.texfiles). The source code in the.texfile should be agnostic of whether it is being compiled with a virtual environment or not.
tlmgr init-usertree --usertree ~/tex1; tlmgr init-usertree --usertree ~/tex2. – Lone Learner Aug 29 '18 at 03:56