4

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

5

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 Jan 9 '17 at 11:32
  • @Jiapan: Can you elaborate? Perhaps \ProvidesFile can, but it's not currently set up that way. – Werner Jan 9 '17 at 13:55
  • @Jiapan: See How do I mark inline code? – Werner Jan 10 '17 at 14:43
  • Could you first tell me how to make \ProvidesFile monospace like yours in the comment? – Jiapan Jan 14 '17 at 11:08
  • @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 Nov 6 '18 at 18:39

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.