I have created a class and defined a command in there, to create a titlepage:

class.cls :

\ProvidesClass{myclass}[2019/03/25 myLaTeX class]









Now I am calling \titlepage in the .tex file:



My texmf directory looks like that:

  • C:\localtexmf\tex\latex\myclass:

    • myclass.cls
    • titlepage-english.def

Now the compiler always throws the following error:

File `titlepage-english.def' not found. \titlepage

  • 2
    that seems strange it should be found if the class is, although you may want to make your class use \InputIfFileExists rather than \input so that you get more friendly behaviour with languages for which you do not have an existing def file. Mar 26, 2019 at 11:35
  • That is a good idea. I will implement \InputIfFileExists
    – NelDav
    Mar 26, 2019 at 11:42
  • I am not sure, if it was clear, but the \InputIfFileExists command did not solved my problem. It was only a good idea to extend myclass
    – NelDav
    Mar 26, 2019 at 21:56
  • 1
    yes i do not see how latex can find the class but not the def file if they are in the same directory, .. unless that directory is managed by mktexlsr and you added the .def file since you last re-created the cashed file list. Mar 26, 2019 at 21:59
  • @DavidCarlisle Exactly that was the problem. I created the def file after the cls file. After I created the cls file, I decided to update miktex. But after I created the def file I forget to update the filename database.
    – NelDav
    Mar 26, 2019 at 22:35

1 Answer 1


Now I found the problem. After adding files into a tex-root directory, it is important to update the file name database. You can do that in MikTex console at Tasks>refresh file name database.

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.