[Tex/LaTex] Is ProvidesFile better than ProvidesPackage or ProvidesClass

documentclass-writingpackage-writing

I want to know which one is suited when I try to create a package file or a class file?

Best Answer

Use the appropriate macro for the appropriate case. That is, use \ProvidesPackage for a package (typically a .sty), \ProvidesClass for a class (a .cls) and \ProvidesFile for anything else.

One example: \ProvidesPackage does additional checking in terms of the name used by the package and that used with \usepackage. However, it also stores a package "version" if is it supplied:

\ProvidesPackage{<package name>}[<version>]

This can be used to make sure loading of packages meet a version criteria, if needed.