10

I am creating a TeX project that uses the siunitx package. I would like to be able to place the siunitx package in a subdirectory, to simplify folder structure and to allow me to easily transfer this project to other computers. I know I can load some packages from subdirectories, but when I try with siunitx, I cannot compile my document and get this error:

! LaTeX Error: File 'siunitx-abbreviations.cfg' not found.

siunitx includes other files, which cannot be reached if the .sty file is moved from the root of my project. Is there any way to fix this to allow siunitx to find its associated package files?

This is in my TeX document:

\usepackage[binary-units=true]{tex_packages/siunitx/siunitx}
\sisetup{per-mode=symbol}
  • 5
    Hi and welcome to TeX.SX. Why don't you instal the package (and it's dependencies) using the package manager of your distribution? Seems to bee the safest method. LaTeX needs to find the files, you could add the path so LaTeX can find it, but that is dependent on your distribution (MikTeX, TeX Live, linux packages ...). – Johannes_B Sep 18 '14 at 16:59
  • 4
    the argument to \usepackage should never be a filepath, always a name latex will have warned about the name not matching. – David Carlisle Sep 18 '14 at 17:03
  • 1
    @DavidCarlisle Never trust StackOverflow ;). – cfr Sep 19 '14 at 0:13
18

The siunitx.sty file is a part of package texlive-science. Install it by:

sudo apt-get install texlive-science

References: missing “.sty” package.

  • <gripe> Is there a 'texlive-get-absolutely-everything-so-i-never-have-to-do-this-again' package? In today's world of 1TB SSD drives standard in cheap laptops, most people can afford to download absolutely everything at once. </gripe> – Reb.Cabin Apr 2 '19 at 15:53
  • Yes, that would be texlive-full. – Ethunxxx Nov 4 '19 at 11:02
1

If you want to use the siunitx package from a subdirectory (strange idea, as mentioned before it's better to install it in your system or local texmf directory), you should not only copy the siunitx.sty file in the directory but also the files siunitx-abbreviations.cfg, siunitx-binary.cfg and siunitx-version-1.cfg in the same directory, the last one for compatiblity purpose with previous version.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.