muzimuzhi / thmtools

New home for LaTeX package bundle thmtools
LaTeX Project Public License v1.3c
16 stars 3 forks source link

listhack key not working #53

Closed mbertucci47 closed 7 months ago

mbertucci47 commented 8 months ago

Unless I am misunderstanding its use, the listhack key is not currently working.

\documentclass{article}

\usepackage{amsthm,thmtools}

\declaretheoremstyle[break]{breaksty}
\declaretheorem[style=breaksty]{theorem}

\begin{document}

\begin{theorem}[listhack=true]
\begin{enumerate}
\item bla
\end{enumerate}
\end{theorem}

\begin{theorem}[name=some name,listhack=true]
\begin{enumerate}
\item bla
\end{enumerate}
\end{theorem}

\end{document}

test1-1

A warning is produced

Package thmtools Warning: Unused key `listhack' on input line 16.

Now clearly in thm-amsthm.sty we have

\define@key{thmuse}{listhack}[\relax]{%
  \addtotheorempostheadhook[local]{%
    \thmt@amsthmlistbreakhack
  }%
}

but every other thmuse key (label, name, continues) is defined with \thmt@define@thmuse@key and indeed defining listhack with this seems to work. Trying on overleaf shows this hasn't worked at least as far back as 2014 so perhaps no one uses it...