# What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage:

\NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩]

This command tells TeX that this file should be processed using a format with name ⟨format-name⟩. You can use the optional argument ⟨release-date⟩ to further specify the earliest release date of the format that is needed. When the release date of the format is older than the one specified a warning will be generated. The standard ⟨format-name⟩ is LaTeX2e. The date, if present, must be in the form yyyy/mm/dd.

I have two closely related questions about the ⟨release-date⟩ argument of \NeedsTeXFormat:

1. How do I, at the command line or in TeX Live Utility, get the release date of the LaTeX kernel currently used by my TeX distro?
2. Is it good practice to always specify the date of the latest release? Doing so, if I understand \NeedsTeXFormat correctly, will prompt users who don't have the latest release to update their distribution. Is it fair to expect users to be up to date? Am I likely to "lose" potentials users who may be unable to get an up-to-date distribution?
-
What about grep fmtversion \$(kpsewhich latex.ltx) (or grep 'edef\\fmtversion' ...)? Or look in source2e.pdf. However, 'requiring' the latest version seems pretty strict to me... – jon Feb 16 '14 at 23:26
I'm not aware of any backwards-incompatible changes in the LaTeX kernel API (which you are specifying there) since 1998 (latest), so this date should not matter in reality (unless you intend to exchange your documents with users who run an ancient TeX installation). – Martin Schröder Feb 16 '14 at 23:41
@MartinSchröder Thanks for the tip. – Jubobs Feb 17 '14 at 21:03
@jon Thanks for your insight. – Jubobs Feb 18 '14 at 12:48

1. An easy way is to look for the definition of \fmtversion in latex.ltx, e.g. (bash):

\$ grep edef.fmtversion \$(kpsewhich latex.ltx)
\edef\fmtversion{2011/06/27}

Alternatively (see egreg's comment), you can use:

\$ texdef -t latex fmtversion

\fmtversion:
macro:->2011/06/27

Or latex can directly be asked:

\$ latex '\typeout{\fmtversion}\stop' | grep LaTeX2e
LaTeX2e <2011/06/27>

2. A "perfect" date would be the minimal release date so that the document works with this or newer releases.

• There is IMHO no need to always specify the latest release date. Especially the LaTeX kernel is frozen since many years. Thus it is not very likely, that a document requires the latest LaTeX release. There are many more or less outdated TeX distributions around (slow update cycles of TeX distributions inside Linux distributions, ...). Using the latest date would indeed cause some trouble for the users unnecessarily.
• On the other hand, testing a document/package with older releases is not too easy either. It costs time and I doubt that many authors want to become archaeologists.

• Useful is the requested release date feature for packages, especially if features of a newer version are used, e.g.:

\usepackage{foobar}[2014/02/17]
% or \RequirePackage inside packages/classes

Then an outdated error message is clearer for the user than a cryptic undefined command error or other failures. The documentation/ChangeLog/version history of the package (sometimes ) helps in finding appropriate release dates.

-
Also texdef -t latex fmtversion shows the definition. – egreg Feb 17 '14 at 0:28
@egreg: Nice, didn't know it. – Heiko Oberdiek Feb 17 '14 at 0:43