I would like to use \SwapAboveDisplaySkip from the mathtools package to fix the vertical space above align environments. Unfortunately, this does not seem to work when loading the autonum package:
! Misplaced \noalign. \SwapAboveDisplaySkip ->\noalign
autonum needs to be loaded because I would like to label equations only if they are referenced (not shown in the MWE, but required in the document) and the mathtools option does not work when loading the cleveref package.
Here is an MWE that produces the described error. Removing either \usepackage{autonum} or \SwapAboveDisplaySkip makes the error go away.
\documentclass{scrreprt}
\usepackage{mathtools}
\usepackage{cleveref}
\usepackage{autonum}
\begin{document}
\chapter{Chapter}
\section{Section}
Text
\begin{align}
\SwapAboveDisplaySkip
A &= B
\end{align}
\end{document}


autonumpackage inserts some assignments just after the original code executed foralign, which makes\noalignappear in a wrong place, because those assignments are executed in the first cell. – egreg Dec 11 '17 at 18:09