12.14.15 \ProvidesClass & \ProvidesPackage

Synopses:

\ProvidesClass{clsname}[release-date [info-text]]
\ProvidesPackage{pkgname}[release-date [info-text]]

Identifies the class or package being defined, printing a message to the screen and the log file.

When you load a class or package, for example with \documentclass{smcmemo} or \usepackage{test}, LaTeX inputs a file (smcmemo.cls and test.sty, respectively). If the name of the file does not match the class or package name declared in it then you get a warning. Thus, if you invoke \documentclass{smcmemo}, and the file smcmemo.cls has the statement \ProvidesClass{foo} then you get a warning like You have requested document class `smcmemo', but the document class provides 'foo'. This warning does not prevent LaTeX from processing the rest of the class file normally.

If you include the optional argument then you must include a date, before any spaces, of the form YYYY/MM/DD. The rest of the optional argument is free-form, although it traditionally identifies the class. It is written to the screen during compilation and to the log file. Thus, if your file smcmemo.cls contains the line \ProvidesClass{smcmemo}[2008/06/01 v1.0 SMC memo class] and your document’s first line is \documentclass{smcmemo} then you will see Document Class: smcmemo 2008/06/01 v1.0 SMC memo class.

The date in the optional argument allows class and package users to ask to be warned if the version of the class or package is earlier than release date. For instance, a user could enter \documentclass{smcmemo}[2018/10/12] or \usepackage{foo}[[2017/07/07]] to require a class or package with certain features by specifying that it must be released no earlier than the given date. Perhaps more importantly, the date serves as documentation of the last release. (In practice, package users rarely include a date, and class users almost never do.)


Unofficial LaTeX2e reference manual