1

I would like to create a sty file that sources another custom sty file. I have all files in a directory /home/Desktop/Common/Latex/LatexSetup. I have tried the following code, which fails.

\RequirePackage[kvoptions]
\DeclareStringOption[/home/Desktop/Common/Latex/LatexSetup]{setupfolder}[/home/Desktop/Common/Latex/LatexSetup]
\ProcessOptions\relax

\RequirePackage{\setupfolder/Latex_Defs}

The reason I don't want to include Latex_Defs is because I use this in multiple packages. My end goal is to have others be able to change this folder if they are using it somewhere else.

Jordan
  • 87
  • 2
    The argument of \RequirePackage should never be a filepath, the fact that that sometimes works is an accident of the implementation, it should just be the package name. – David Carlisle Nov 11 '17 at 19:43
  • Just put Setup.sty in your tex input path so (like kvoptions.sty can be referenced by name from any directory. – David Carlisle Nov 11 '17 at 19:45
  • I do no understand your second comment. If I eliminate the filepath, then I get the error ! LaTeX Error: File 'ASetup.sty' not found. – Jordan Nov 11 '17 at 19:45
  • 2
    you would get the same error from \usepackage{graphicx} if graphicx.sty was not installed in the right place, the solution is not to use \usepackage{/usr/local/texlive/2017/texmf-dist/tex/latex/graphicx} – David Carlisle Nov 11 '17 at 19:47
  • You should create a symlink (or a hard link, or a copy) of your file into your local texmf (that's what David Carlisle is trying to say). – Skillmon Nov 11 '17 at 19:50
  • https://tex.stackexchange.com/questions/1137/where-do-i-place-my-own-sty-or-cls-files-to-make-them-available-to-all-my-te – David Carlisle Nov 11 '17 at 19:52
  • I created the texmf folder, and have got everything working now. Thank you both. – Jordan Nov 11 '17 at 20:16

0 Answers0