# How to let Julia use my LaTeX installed in a different directory

**URL:** <https://discourse.julialang.org/t/how-to-let-julia-use-my-latex-installed-in-a-different-directory/48138>\
**Category:** Tooling\
**Tags:** latex\
**Created:** [October 11, 2020, 12:58am UTC](https://discourse.julialang.org/t/how-to-let-julia-use-my-latex-installed-in-a-different-directory/48138 "2020-10-11T00:58:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tzxiong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tzxiong/32/17502_2.png) [@tzxiong](https://discourse.julialang.org/u/tzxiong)\
**Post date:** [October 11, 2020, 12:58am UTC](https://discourse.julialang.org/t/how-to-let-julia-use-my-latex-installed-in-a-different-directory/48138/1 "2020-10-11T00:58:17Z")

</div>

I am running Julia on a cluster system and I installed a separate LaTeX engine in my personal directory:

```julia
/PATH_TO_LATEX/

```

But in my julia console, it is using a different latex engine as when I type

```julia
Sys.which("latex")

```

then it returns

```julia
"/usr/bin/pdftex"

```

which is wrong.

How do people permanently shift Julia to search in the correct path?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 11, 2020, 9:12am UTC](https://discourse.julialang.org/t/how-to-let-julia-use-my-latex-installed-in-a-different-directory/48138/2 "2020-10-11T09:12:32Z")

</div>

Note that `which` will give you the _first_ executable found according to your `PATH` environment variable.

Either set this not to include `/usr/bin` (which could have unintended consequences), or just use `PATH_TO_LATEX` directly.

(Also, this is not really Julia-specific, and certainly has nothing to do with performance, so I am moving the topic.)

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [October 11, 2020, 1:20pm UTC](https://discourse.julialang.org/t/how-to-let-julia-use-my-latex-installed-in-a-different-directory/48138/3 "2020-10-11T13:20:48Z")

</div>

In truth, the better solution would be changing your `PATH` to search in `PATH_TO_LATEX` before `/usr/bin`. It is very common for linux users to have their own script/binary folders in the start of their `PATH` before the system ones.

[Here is a tutorial, it just adds `$HOME/bin` instead of `PATH_TO_LATEX` so you only need to change that.](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/)

If you want to always use your version of latex over others (in all programs respecting PATH) make this global and permanent, as in the tutorial. If you just want this in Julia, and in specific sessions, you can call Julia like this:

```julia
$ PATH="PATH_TO_LATEX:$PATH" julia

```
