3

Consider the following snippet:

\documentclass{memoir}
\usepackage{fixltx2e}
\setfloatadjustment{figure}{\raggedleft}
\begin{document}
\begin{figure}
ABC
\end{figure}
\end{document}

When you compile this code, one would expect that ABC would be placed on the right side of the typeblock but instead it is placed on the default side (left). After commenting out the fixltx2e package, the code works as expected. Unfortunately some package that I use loads the fixltx2e package so I cannot simply comment out the usepackage. Does someone know how to fix this issue? It seems that \@xfloat is overwritten, but this should have been covered by memoir by the lines:

\AtBeginDocument{
  \let\m@m@xfloat\@xfloat
  \def\@xfloat #1[#2]{%
    \m@m@xfloat #1[#2]%
    \def\baselinestretch{\m@m@float@spacing}%
    \normalsize}
}
  • It works for me. Can you update your distribution and try again? – user11232 Apr 25 '15 at 2:06
2

Indeed, fixltx2e overwrites \@xfloat. The assumption is that it fixes content in the standard document classes, of which memoir is not.

Since memoir manages things on its own, best would be to save-and-restore the memoir-specific version of \@xfloat, or just redefine it:

\documentclass{memoir}
\usepackage{fixltx2e}
\makeatletter
% Restore original memoir definition of \@xfloat
\def\@xfloat#1[#2]{\mem@old@xfloat{#1}[#2]\@nameuse{#1adjustment}}
\makeatother
\setfloatadjustment{figure}{\raggedleft}
\begin{document}
\begin{figure}
ABC
\end{figure}
\end{document}

Note that fixltx2e will form part of the LaTeX2e (upcoming TeX Live 2015) release by default:

LaTeX2e now incorporates, by default, changes previously included only by explicitly loading the fixltx2e package, which is now a no-op (CTAN announcement).

  • Isn't the normal way if loading fixltx2e to load it before the documentclass. In the fix you are doing here mem@old@xfloat will refer to the memoir xfloat before fixltx2e – daleif Apr 25 '15 at 7:24
  • @daleif Normally, you would be right to load fixltx2e before the documentclass, but there are some packages that are not compatible (like asmthm). – Pieter Stroobants Apr 26 '15 at 1:15
  • Since the material in fixltx2e is going into the kernel amsthm is going to be updated if it haven't already – daleif Apr 26 '15 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.