0

I downloaded a new package (quiver) for making commutative diagrams on latex from this link. I use LaTeX on VS Code (Visual Studio Code).

To prevent from having to copy and paste my packages every time, I made a folder with all my tex resources and made a file with all my packages and commands. Whenever I make a new file, I just write

\input{C:/Users/[myname]/Documents/LaTeX-Resources/LaTeX-Template.tex}

In this template, I added

\usepackage{quiver}

However, even though I put the quiver.sty folder in the LaTeX-Resources folder (where the template is in), any new document I make won't compile unless the quiver.sty file is also in that folder.

For example, if I have a file HW1.tex in a Math 112 folder, it won't compile without the quiver.sty file also being in the folder. I don't know why this issue comes up, because \usepackage{quiver} is only in my template, which is in the same folder as the quiver.sty file.

How can I avoid having to copy the quiver.sty file into every folder where I have TeX documents?

4
  • 1
    You could include an absolute path to the quiver.sty file. Similar to your \input path but to somewhere where the package location never changes. From this answer by Werner, you should not include the .sty at the end of quiver (although you haven't in this example but may when specifying the absolute path). Try that and let us know how it goes, someone might have a better solution. Commented Apr 23, 2022 at 21:24
  • 1
    Did you update e. g. your package database? (Using MikTeX: Miktex Console --> Packages --> Symbol Update DB) Commented Apr 23, 2022 at 23:03
  • Instead of putting your newly "installed" sty in some random path on your drive put it into your texmf-home (to find the folder, type kpsewhich -var-value TEXMFHOME into the cmd, therein create a folder quiver and put the quiver.sty and all other files the package may need into that folder). Once you've done that you can use \usepackage{quiver} anywhere on your local user. Commented Apr 24, 2022 at 7:10
  • @Skillmon This worked perfectly. Thanks! If you want to put this as an answer, I will accept it. Commented Apr 24, 2022 at 20:45

1 Answer 1

1

You can make your package available by installing it locally. The easiest way to do this (if it's not part of MikTeX or TeXLive) is to put it into your local texmf-home. You can find the folder by using

kpsewhich -var-value TEXMFHOME 

in the command line. This should yield a folder. Therein create another folder with the name of the package/class/bundle you want to locally install and put all files necessary for the TeX-run into that folder.

Usually this folder should have a similar folder structure to your TeXLive/MikTex installation, so a LaTeX package you want to install should go into <texmf-home>/tex/latex/<package-name>. Put all files necessary for a LaTeX run (so for a package the .sty) into that folder. No need to update any index, your LaTeX installation should search this path on every run (as long as you don't create a local index file for that folder).

After this you can access your file from your entire system without specifying any path by using the standard methods to include the file, e.g., \usepackage.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.