I use a .sty-file where I collect all packages and commands and stuff like that. This I have on my personal computer, and I load the file with


Sometimes I have to write on my work computer, or sync git projects on other computers. Is there a way to use the same style-file across all these computers and locations? The path to the file is different for every computer. I could have the .sty-file everywhere, and just give the location, but when I commit it to a git project to use it on a different computer, I have to change the location again. Sorry for the confused attempts to explain the problem, but is there a way to use the same .sty-file on different computers? Thanks in advance.

  • On each computer you wish to use, create a link in your home directory that points to the actual file. Is that what you mean? – Henk Metselaar Sep 17 '17 at 15:04
  • On a Unix/Linux/MacOS system each user has a texmf directory, where own fonts and packages can be stored – user31729 Sep 17 '17 at 15:40
  • Put your local texmf folder in Dropbox (or equivalent) and then make symbolic links in each computer to the Dropbox folder. See Centralised .bib file on Mac for how to do this on a Mac, but the principle is the same for any unix based system. (No idea about Windows). BTW, the argument to \usepackage is not a path. Use your texmf folder properly and you shouldn't need to specify paths in \usepackage commands ever. – Alan Munn Sep 17 '17 at 15:55
  • 1
    \usepackage should just have the filename not the path, cf \usepackage{array} not \usepackage{/usr/local/...tex/latex/tools/array} just place your file.sty file in a directory in the TEXINPUTS path on both machines. – David Carlisle Sep 17 '17 at 17:17
  • @DavidCarlisle that is a very intriguing idea. I have never heard of it before. Could you please provide some details on how to put .sty there? I don't seem to find TEXINPUTS for instance. Thanks. – LetGBeTheGraph Sep 20 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.