# Own sty files, maintenance and portability

As you easily note, I am new here and english is not my first language: so, be gentle please.

I am using a windows 7 machine with MiKTeX installed (just in case).

I have the following directory structure (in a pendrive, named D in my system):

D:\step\foot1\shoe1
D:\step\foot1\shoe2
D:\step\foot2
D:\step\styles


I have created the file finger.sty in the fourth folder and I have tex files in the first three folders: I want to use finger.sty file (via \usepackage) in those tex files.

For portability reasons, I want to use the folder \step in different machines with different TeX directories structures (I don't want to touch them) and, possibly, naming my pendrive with different letters.

For maintenance reasons, I don't want to have a copy of finger.sty file anywhere but the fourth folder.

How could it be possible to satisfy all my requirements (wishes)?

• You can use relative paths like \usepackage{../../styles/finger}. Note that you will probably get a warning about You requested '../../styles/finger.sty' but the package provides 'finger.sty' but as far as I know you can safely ignore them. – Max Aug 4 '18 at 17:47
• MikTeX uses a filename database (FNDB) for .sty files. You need to load your directory using the console settings->directories, then renew the FNDB to access the .sty file. – John Kormylo Aug 4 '18 at 18:43
• You can place it anywhere and use a make script that sets an extended TEXINPUTS variable – gnucchi Aug 4 '18 at 18:52

Put your finger.sty in

D:\step\styles\tex\latex\juan\finger.sty


Then go to the miktex console and in settings->directories add D:\step\styles as a new root.

Alternatively run on a terminal

initexmf register-root D:\step\styles


When you are on another machine you can activate the styles folder there in a similar way.

• I can not change anything on other machines I use: that is why I have to fulfill this requirement. – Juan Leal Aug 4 '18 at 21:42