1

I would like to create an USB-Stick you can put into any windows with VSCode, miktex (and perl) portable to work on my thesis with any win device.

VSCode and perl are working just fine and miktex portable also starts.

When trying to compile my thesis within VSCode though, it tries using the miktex system wide installation, which does not necessarily work (at university, the PC always fails with "User/Administrator-updates are not synchron" and I do not have the admin rights to correct that).

I tried

  1. deleting miktech from the PATH before adding the portable path (does work, checked) as well as
  2. modifying the settings in VSCode by adding "env" to the Latex like here (see below)

It still tries to use the system miktex installation. Except for the error, it also shows in the log, because it installs and uses the packages into/in APPDATA instead of using those in the portable folder.

"Code"

VSCode settings.json got the "env" entry (although I am not too sure what it does)

"latex-workshop.latex.tools": [

        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ],
            "env": {"TEXMFHOME": "C:\\Users\\c.hoehl\\Documents\\portableBA\\CommonFiles\\miktex\\texmfs\\install\\miktex\\bin\\x64"},
        },

or instead (actually tried all kind of paths)

"env": {"TEXMFHOME": "...\\portable\\miktex\\texmfs"},

Of cause, the '...' represents the full path to the folder.


Does anyone have an idea, how to make it work?

Thank you very much in advance!

sk3k
  • 36
  • 5
  • I would love to see an answer here. I just tried something similar, because of my restrictions on my work computer. I have VSCode, Perl and MiKTeX portable on a stick, but still need to enter the Path environment variables into my user settings to get it work. It would be great to find a way to set it relatively in VSCode, so that it just runs when plugged in. – Cheesey Mar 29 '23 at 07:26

0 Answers0