# How to use fixltx2e only when necessary

I've been using the fixltx2e package for a while, with a tweak described here on the site. Recently, this has gotten me the following error message:

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.


How do I robustly make sure fixltx2e is used exactly when necessary?

• Just ignore the warning, if you plan to use the same document with pre 2015 kernels. Otherwise remove \usepackage{fixltx2e}. – egreg Jan 11 '16 at 21:19
• Since it's just a warning, you can silence it: \usepackage{silence} \WarningFilter{fixltx2e}{}. – Werner Jan 12 '16 at 1:07

You can distinguish pre-2015 kernels from the fact that \IncludeInRelease is not defined:

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname IncludeInRelease\endcsname\relax
\usepackage{fixltx2e}
\fi


See What does \begingroup\expandafter…\endgroup do? for an explanation of the code.

• Why aren't lines 2-4 in your snippet sufficient? You kind of lost me with the first line. – einpoklum Jan 11 '16 at 23:37
• @einpoklum Omitting the first line would leave \IncludeInRelease defined to be equivalent to \relax, if previously undefined. With the first line, the \csname construction is performed when the group has not yet been closed. When \endgroup performs its actions (which include removing the previous setting of \IncludeInRelease, if done). See tex.stackexchange.com/questions/24393/… – egreg Jan 11 '16 at 23:40
• Also, why not use something like \ifcsname? – einpoklum Jan 12 '16 at 0:12
• @einpoklum If your aim is to make the code compatible with older releases of TeX, you can't assume e-TeX. – egreg Jan 12 '16 at 0:20

If you are using TeXLive you can use the solution below to obtain which version you are running.

## Code:

\documentclass{article}

\makeatletter%
\def\getversion{\expandafter\get@version\pdftexbanner\@nil}%
\def\get@version#1201#2)#3\@nil{\def\TeXLiveVersion{201#2}}%
\makeatother%
\getversion%

\ifnum\TeXLiveVersion<2015\relax%
\usepackage{fixltx2e}%
\typeout{*** Included fixltx2e}
\elese
\typeout{*** DId NOT Included fixltx2e}
\fi%

\begin{document}
xxx
\end{document}

• er why not just use \fmtversion ? – David Carlisle Jan 11 '16 at 22:45
• @DavidCarlisle: Sorry, did not know about \fmtversion. – Peter Grill Jan 11 '16 at 22:50
• \@ifl@t@r\fmtversion{2015/01/01}{yes}{no} :-) – David Carlisle Jan 11 '16 at 22:56
• Ah, but I can't assume I use TeXLive, now can I...? – einpoklum Jan 11 '16 at 23:36