1

When, automatically, documentation some code the LaTeX output gives me the,logical, warning:

Package: fixltx2e 2016/12/29 v2.1a fixes to LaTeX (obsolete)
Applying: [2015/01/01] Old fixltx2e package on input line 46.

Package fixltx2e Warning: fixltx2e is not required with releases after 2015 (fixltx2e) All fixes are now in the LaTeX kernel. (fixltx2e) See the latexrelease package for details.

Already applied: [0000/00/00] Old fixltx2e package on input line 53.

So in my own case I could just leave out the line:

\usepackage{fixltx2e}

but this would give some problems for people that (unfortunately) still use an old version of LaTeX.

I found in https://tex.stackexchange.com/a/569709/44119:

Since version 2020-10-01 the LaTeX kernel provides the command \IfFormatAtLeastTF{<date>}{<true code>}{<false code>}

but this gives of course the same problems as this only exists after the 2020 release.

I also found https://tex.stackexchange.com/a/26229/44119:

\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}
\@iflatexlater{2001/09/01}{\TRUE}{\FALSE}

and applying this as:

  \newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}
  \@iflatexlater{2016/01/01}{}{\usepackage{fixltx2e}}

gives me the error:

! LaTeX Error: Command \@ already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.15 \newcommand*@i flatexlater{@ifl@t@r\fmtversion} ? ! Emergency stop. ...

l.15 \newcommand*@i flatexlater{@ifl@t@r\fmtversion} ! ==> Fatal error occurred, no output PDF file produced!

Normally on this site it is usual to create a MWE though I hope the information provided here is already sufficient to give a pointer to a solution.

albert
  • 1,313
  • well you are missing \makeatletter (and you naturally can simply use \@ifl@t@r\fmtversion{2001/09/01}{true}{false}, no need to define a macro for this). – Ulrike Fischer Apr 13 '23 at 12:15
  • @UlrikeFischer thanks this works (actually I'm a bit embarrassed that I didn't think about it myself). – albert Apr 13 '23 at 12:22

1 Answers1

3

Your last version doesn't work because you need \makeatletter to use @ in command names. The recommended way is to define:

\makeatletter
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
\makeatother

then use \IfFormatAtLeastTF throughout. \providecommand will only define the command if it doesn't exist yet, which is exactly what you want.


If you are writing a package or class, I wouldn't advise you to support LaTeX versions older than 3 or 4 years. TeXLive 2015 is old, and there is really no reason to use it nowadays: back then, support for older versions was important because (mainly) of Overleaf and arXiv, but both now use recent enough distributions.

  • I agree that versions older than3 or 4 versions shouldn't be supported anymore although a lot of people and companies (!) use computers with older versions of different programs and only update when it cannot be avoided (so they could use still use a bit older versions of LaTeX, though 8 years is already again a longer time). – albert Apr 13 '23 at 12:25
  • I don't get the usage of \provideCommand as I just want to use a package when a distribution is old. – albert Apr 13 '23 at 12:28
  • The \providecommand line provides you the definition of \IfFormatAtLeastTF if the LaTeX format you are running doesn't have it. After that definition you can write \IfFormatAtLeastTF{2015/01/01}{}{\usepackage{fixltx2e}} (didn't check the date). – Phelype Oleinik Apr 13 '23 at 12:37
  • Makes sense thanks – albert Apr 13 '23 at 12:43