1

I install texlive in manjaro and didn't work, so I try the miktex and it only work in the texstudio when I change the 'comands ($path) to home/user/bin it works but only to texstudio. How can I make the path default for other software? I'm using manjaro gnome.

3
  • 1
    In both cases (TeXLive or MiKTeX) you have to add the folders where the binaries are to your path. You can do so by putting the following in your default shell's rc: export PATH=$PATH:/path/to/your/binaries (make sure to not put any spaces there!)
    – Skillmon
    Commented Dec 28, 2020 at 10:50
  • @Skillmon I would first ask how the install was done. If the OP used their distro's package manager, there shouldn't be binaries in ~/bin/. Likewise if they used vanilla TeX Live. Installing TL as an ordinary user under /home/<user>/ is not imho a great idea ....
    – cfr
    Commented Oct 15, 2023 at 19:14
  • @cfr yes, agreed, the setup sounds strange.
    – Skillmon
    Commented Oct 15, 2023 at 19:24

1 Answer 1

1

On your Linux every folder which is contained in your PATH variable is searched for executables. So when you install your TeX Live or MiKTeX you have to add the folder where the binaries are to that environment variable.

The PATH variable has the format path1:path2:path3 (so each path is separated by a colon). And each path should be an absolute path starting at root. A normal PATH variable could look like the following:

/usr/local/sbin:/usr/local/bin:/usr/bin

If you want to add a folder to your PATH you can do so using export in your default shell's rc. If you want to append something to an existing PATH variable, you can do so like this (put that line in your .bashrc if you're using bash as your login shell, or .zshrc if you're using zsh, or...):

export PATH="$PATH:/other/path/to/folder"

So, to add your /home/user/bin to your PATH so that all applications you run can find the binaries of your LaTeX installation, you could add the following to your rc:

export PATH="$PATH:/home/user/bin"

Make sure to only put a colon between two paths, not at the end of the list.

The PATH is searched from first to last element. The above appends stuff to your PATH, meaning it will use your system's binaries where possible and fall back to the ones in your custom folder. If you want the opposite behaviour (using the binaries of your /home/user/bin folder where possible, and falling back to system binaries) you should prepend the folder:

export PATH="/home/user/bin:$PATH"

Please note that this has security implications (as pointed out by cfr)!

5
  • Erh isn't it always best to add personal folders first in the PATH, in the odd chance that it contains a program that is also in the system PATHs.
    – daleif
    Commented May 23, 2022 at 4:55
  • @daleif depends on what you want to achieve, overwriting system binaries or just adding additional ones using system binaries where possible.
    – Skillmon
    Commented May 23, 2022 at 8:25
  • 1
    @daleif added a paragraph with more information on first vs last.
    – Skillmon
    Commented May 23, 2022 at 8:29
  • A lot of people don't know the difference. So the distinction is important
    – daleif
    Commented May 23, 2022 at 8:32
  • @daleif It is much less secure to put ~/bin/ first because that directory is much more vulnerable than others.
    – cfr
    Commented Oct 15, 2023 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .