fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.

Home Page:https://github.com/fmarotta/kaobook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spacing before subequations

AlexanderZeilmann opened this issue · comments

Summary

There is a bug in the subequations environment that causes a too large spacing if the line before fills the entire paragraph.
This can be fixed by adding

\usepackage{etoolbox}
\preto\subequations{\ifhmode\unskip\fi}

to the preamble.

Maybe you want to add this to kaobook.

MWE

\documentclass{kaobook}

% \usepackage{etoolbox}
% \preto\subequations{\ifhmode\unskip\fi}

\begin{document}

A line that does not fill the paragraph has normal spacing
\begin{subequations}
	\begin{alignat}{1}
		a \\
		b
	\end{alignat}
\end{subequations}
A line that does fill the paragraph has too much spacing before the eq.
\begin{subequations}
	\begin{alignat}{1}
		a \\
		b
	\end{alignat}
\end{subequations}
A line after the equation.

\end{document}

Bildschirmfoto 2022-02-08 um 17 09 18

Done, thanks!

@fmarotta I get an error on my end with your fix, it seems to be because you need to put the fix after importing amsmath rather than before. Can you confirm the issue comes from your side?
The CI after commit deaac8a and PR #221 all agree that there’s an issue with subequation introduced by that commit.

Sorry, my bad. I've merged #221, which should fix the problem.