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.
https://github.com/fmarotta/kaobook
LaTeX Project Public License v1.3c
858 stars 184 forks source link

Spacing before subequations #210

Closed AlexanderZeilmann closed 2 years ago

AlexanderZeilmann commented 2 years ago

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

fmarotta commented 2 years ago

Done, thanks!

MevenBertrand commented 2 years ago

@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 deaac8ade99033ebddc46befb702495e32c80fb0 and PR #221 all agree that there’s an issue with subequation introduced by that commit.

fmarotta commented 2 years ago

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