14

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?

einpoklum
  • 12,311
  • 2
    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
  • 2
    Since it's just a warning, you can silence it: \usepackage{silence} \WarningFilter{fixltx2e}{}. – Werner Jan 12 '16 at 01:07
  • @Werner If you're already turning off all the warnings for a given package non-selectively, you might as well use the command designed to do just that: \WarningsOff[fixltx2e]. Note that either way, this command needs to be placed BEFORE you load the fixltx2e package (using \usepackage{fixltx2e} or \RequirePackage{fixltx2e}) for it to work! – Brunox13 Jul 29 '21 at 00:18

2 Answers2

10

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

References:

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}

Peter Grill
  • 223,288
10

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.

egreg
  • 1,121,712
  • 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
  • 1
    @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 http://tex.stackexchange.com/questions/24393/what-does-begingroup-expandafter-endgroup-do – egreg Jan 11 '16 at 23:40
  • Also, why not use something like \ifcsname? – einpoklum Jan 12 '16 at 00:12
  • 2
    @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 00:20