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

1 Answer 1


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.

  • thanks for your answer, but I think \ProvidesFile can do the same job.
    – Jiapan
    Commented Jan 9, 2017 at 11:32
  • @Jiapan: Can you elaborate? Perhaps \ProvidesFile can, but it's not currently set up that way.
    – Werner
    Commented Jan 9, 2017 at 13:55
  • @Jiapan: See How do I mark inline code?
    – Werner
    Commented Jan 10, 2017 at 14:43
  • Could you first tell me how to make \ProvidesFile monospace like yours in the comment?
    – Jiapan
    Commented Jan 14, 2017 at 11:08
  • 1
    @Jiapan (awfully late on this:) You can mark inline code as such by surrounding it with ` on both ends. So `<code>` is marked as <code>.
    – Skillmon
    Commented Nov 6, 2018 at 18:39

You must log in to answer this question.

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