Here's my setup :

  • Two PCs (one desktop and one laptop)
  • Two installations of Texmaker and MikTex (exactly the same versions)

i've created my own package (.sty file) and this package uses external files (that are located in the same directory as the pacakge. the files are added via the \input{...} command

I've used the package for quite a while on both PCs flawlessly and now the laptop throws an error at compilation (of the document which uses the package)

LaTeX Error: File 'basic_packages.tex' not found. Type X...

I've managed to understand what's going on :

  • The desktop interprets "\input{...}" as "go look for the file at the package's directory
  • the laptop looks for the file at the document's directory. Of course i want the included file to stay with the package.

Here are my codes (simplified)


\ProvidesPackage{sdlibV1}[14/03/2019 custom package]



\input{basic_packages} %<-- this input
%\input{basic_macros} also not useful for the question

%stuff, not useful here





\usepackage{sdlibV1}% <-- package loaded here


\subfile{calcul_integral}% I've tried removing those, and only using "hello world"

Paths of files :

Document : \HEIG-VD\Cours\Math2\Notes

sdlibV1.sty and basic_packages.text : \HEIG-VD\Notes\LaTex\packages\tex\latex\sdlibV1

(The packages folderhas been configured correctly as a package "source") What i've also tried :

  • Checking pdflatex's command
  • Using a temp document (standalone, without anything in it, just a "hello world")
  • using \include command (did not work at all)
  • putting all my included files (16 elements) inside the .sty file, it worked but it's absolutely disgusting
  • Where are these files placed in the file system in relation to each other?
    – daleif
    Commented Apr 4, 2019 at 18:40
  • the "document" file is anyhwere (doesn't really matter) the library and included file are in a dedicated folder. (which has been made so that it's recognized as a library)
    – Klue
    Commented Apr 4, 2019 at 18:44
  • Note that LaTeX does not really have a notion of libraries, so please explain exactly what you have done.
    – daleif
    Commented Apr 4, 2019 at 18:45
  • yeah sorry, i'm still a bit new so the vocab hadn't time to sink in that much. I've created a .sty file (sdlibV1.sty) and i've used the \usepackage{sdlibV1} to "load" it. So it's more of a package than a library i guess (i tend to get confused coming from C programming)
    – Klue
    Commented Apr 4, 2019 at 18:50
  • 1
    just saw that you have miktex. Then you need to update the FNDB (in the miktex console, user mode, menu tasks, or with initexmf -u on the command line.) Commented Apr 4, 2019 at 19:05

1 Answer 1


The problem has been solved !

After changes to a package (and/or files included by it) the following command in the MikTex console (ran as admin)

initexmf -u --admin
  • you only need to do this if you add new files, not if you change/edit an existing file. Commented Apr 5, 2019 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .