Skip to content

The kaobook's thmtools was conflict with the latest latex-kernel and need to be patched? #315

Description

@Explorer-cc

Description

See the issue and post here, now the kaobook would get the thmtools with slibing option.

Minimal Working Example

I made some exploration of the case, now I have three examples:

MWE1

\documentclass{kaobook}
\usepackage{kaotheorems}

\begin{document}

Hello!

\begin{proposition}
This is a proposition.
\end{proposition}

\end{document}

Expected behavior:

Compile smoothly.

Actual behavior:

It raised an error message:

! LaTeX Error: Command \c@proposition already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.33 \makeatother
                 
? 

MWE2

Here below is a simpler version to show the issues:

\documentclass{book}
\let\openbox\relax
\RequirePackage{amsmath} % Improved mathematics
\RequirePackage{amsthm} % Mathematical environments
\RequirePackage{thmtools} % Theorem styles
\makeatletter
    % Theorem styles
    \declaretheoremstyle[
    	spaceabove=.6\thm@preskip,
    	spacebelow=.1\thm@postskip,
    	bodyfont=\normalfont\itshape,
    	headpunct={},
    ]{kaoplain}
    \theoremstyle{kaoplain}
    \declaretheorem[
    	name=Theorem,
    	refname={theorem,theorems},
    	Refname={Theorem,Theorems},
    	numberwithin=section,
    ]{theorem}
    \declaretheorem[
    	name=Proposition,
    	refname={proposition,propositions},
    	Refname={Proposition,Propositions},
    	sibling=theorem,%<---------------------
    ]{proposition}
\makeatother

\begin{document}

Hello!

\begin{proposition}
This is a proposition.
\end{proposition}

\end{document}

gives the same error.

MWE3

The mbert's workaround works:

\documentclass{book}
\let\openbox\relax
\RequirePackage{amsmath} % Improved mathematics
\RequirePackage{amsthm} % Mathematical environments
\RequirePackage{thmtools} % Theorem styles
\makeatletter
\renewcommand\thmt@autorefsetup{%
  \@xa\def\csname\thmt@envname autorefname\@xa\endcsname\@xa{\thmt@thmname}%
}
\makeatother
\makeatletter
    % Theorem styles
    \declaretheoremstyle[
    	spaceabove=.6\thm@preskip,
    	spacebelow=.1\thm@postskip,
    	bodyfont=\normalfont\itshape,
    	headpunct={},
    ]{kaoplain}
    \theoremstyle{kaoplain}
    \declaretheorem[
    	name=Theorem,
    	refname={theorem,theorems},
    	Refname={Theorem,Theorems},
    	numberwithin=section,
    ]{theorem}
    \declaretheorem[
    	name=Proposition,
    	refname={proposition,propositions},
    	Refname={Proposition,Propositions},
    	sibling=theorem,%<-
    ]{proposition}
\makeatother

\begin{document}

Hello!

\begin{proposition}
This is a proposition.
\end{proposition}

\end{document}
Image

But that not work with simply the kaotheorems package.

\documentclass{kaobook}
\usepackage{kaotheorems}
\makeatletter
\renewcommand\thmt@autorefsetup{%
  \@xa\def\csname\thmt@envname autorefname\@xa\endcsname\@xa{\thmt@thmname}%
}
\makeatother
\begin{document}

Hello!

\begin{proposition}
This is a proposition.
\end{proposition}

\end{document}

still gives:

! LaTeX Error: Command \c@proposition already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.336     \declaretheorem
                         [
? 

Should this be fixed from thmtools side? Or from the kaobook side?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions