Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent counter representation and "chapter gap" in \listofschemes #42

Closed
Sonja-K opened this issue Nov 22, 2020 · 1 comment
Closed
Labels
bug actual bugs

Comments

@Sonja-K
Copy link
Collaborator

Sonja-K commented Nov 22, 2020

While working on this answer, I found an inconsistency in the counter representation/dependencies (per chapter vs. continuous) as well as in the "chapter gap" in schemes and \listofschemes as compared to figure/table and \listoffigures/\listoftables in different documentclasses.

Using the report class, figures/tables are by default numbered per chapter and the \listoffigures/\listoftables contains a larger vertical white space between figures/tables of different chapters than between figures/tables of the same chpter ("chapter gap"). Schemes on the other hand, are numbered continuously and no chapter gap is present in the \listofschemes.

Changing the scheme numbering style from continuous to per chapter using \AtEndPreamble{\numberwithin{scheme}{chapter}} corrects the numbering style to the expected one, but still leaves us with no gap in the \listofschemes. Using
\usepackage{xpatch}\makeatletter\xapptocmd{\@chapter}{\addtocontents{los}{\protect\addvspace{10\p@}}}{}{}\makeatother,
I can add the missing gap back in, however, I would have expected the \listofschemes to look like the \listoffigures initially and without having to do thouse changes.

Interestingly, when using memoir, the schemes are already numbered within the chapter, as expected, however, the chapter gap is missing here, as well.

Taking a look at the KOMA-script classes, we get the opposite result: Using scrbook or scrreprt, the chapter gap is correctly present, and also correctly responds to adding listof=nochaptergap as a class option, as well. On the other hand, the numbering scheme is again continuous instead of per chapter.

MWE:

\documentclass{report} % schemes numbered continuously instead of per chapter, chapter gap in listofschemes missing
%\documentclass{scrbook} % schemes numbered continuously instead of per chapter, chapter gap in listofschemes present
%\documentclass{memoir} % schemes numbered per chapter,  chapter gap in listofschemes missing
\usepackage{chemmacros}
\chemsetup{modules=scheme}

\begin{document}

\listoffigures
\listoftables
\listofschemes

\chapter{first chapter}

\begin{figure}\caption{figure}\end{figure}
\begin{figure}\caption{figure}\end{figure}

\begin{table}\caption{table}\end{table}
\begin{table}\caption{table}\end{table}

\begin{scheme}\caption{scheme}\end{scheme}
\begin{scheme}\caption{scheme}\end{scheme}

\chapter{second chapter}

\begin{figure}\caption{figure}\end{figure}
\begin{figure}\caption{figure}\end{figure}

\begin{table}\caption{table}\end{table}
\begin{table}\caption{table}\end{table}

\begin{scheme}\caption{scheme}\end{scheme}
\begin{scheme}\caption{scheme}\end{scheme}

\end{document}
 

According to my investigations, this should be (partially) fixable by adding

\counterwithin {#1} {chapter} to the definition of \chemmacros_define_float_method:nnn {KOMA}

and

\renewcommand{\insertchapterspace}{%
\addtocontents{lof}{\protect\addvspace{10pt}}%
\addtocontents{lot}{\protect\addvspace{10pt}}%
\addtocontents{los}{\protect\addvspace{10pt}}%
}

to the definition of \chemmacros_define_float_method:nnn {memoir}.

cgnieder added a commit that referenced this issue Nov 23, 2020
@cgnieder cgnieder added the bug actual bugs label Nov 23, 2020
@cgnieder
Copy link
Owner

You are absolutely right! Thanks for this report. This is fixed for the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug actual bugs
Projects
None yet
Development

No branches or pull requests

2 participants