1

\listoftheorems gives the desired results in the entries for ordinary theorem environments, whether they have an optional argument or not, and also for namedtheorem environments.

Question: What modification is needed to give the corresponding entries for a theorem-like proposition environment having an optional argument?

I'm getting...

Propositionsubsidiary result

...where I expect...

Subsidiary result

...(with an initial letter upper-case) in the list of theorems.

\documentclass{article}
\usepackage{suffix}
\usepackage{textcase}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{mfirstuc}

\renewcommand{\listtheoremname}{List of Important Theorems}
\renewcommand\thmtformatoptarg[1]{#1}

\swapnumbers

\makeatletter
%
\declaretheoremstyle[
  headfont= \bfseries,headpunct={.},
  postheadspace=0.5em,
  notefont=\bfseries,
  headformat=\NAME\NUMBER\let\thmt@space\@empty\NOTE,
  bodyfont=\mdseries\itshape,
  spaceabove=12pt,spacebelow=12pt,
  postheadhook={%
  \ifx\@empty\thmt@shortoptarg
    \renewcommand\addcontentsline[3]{}
  \fi}
]{thmstyle}

\declaretheoremstyle[
  notefont=\bfseries,
  notebraces={}{},
  headformat=\NUMBER\let\thmt@space\@empty\NOTE,
  bodyfont=\mdseries\itshape,
  spaceabove=12pt,spacebelow=12pt,
  postheadhook={%
  \ifx\@empty\thmt@shortoptarg
    \renewcommand\addcontentsline[3]{}
  \fi}
]{namedthmstyle}
%
\makeatother

\theoremstyle{thmstyle}
\declaretheorem[name=Theorem,numberwithin=section]{theorem}

\declaretheorem[
  style=namedthmstyle,name=Theorem,title = {},numberlike=theorem
]{namedtheorem}

\newtheorem{proposition}[theorem]{Proposition}

\usepackage[pdftex]{hyperref}
\hypersetup{colorlinks,linkcolor=blue}   
\usepackage[nameinlink,noabbrev,capitalize]{cleveref}

\usepackage{crossreftools} % usage not shown

\crefname{namedtheorem}{Theorem}{Theorems}
\Crefname{namedtheorem}{Theorem}{Theorems}

\makeatletter
%
\def\ll@theorem{%
  \protect\numberline{\csname the\thmt@envname\endcsname}%
  \ifx\@empty\thmt@shortoptarg
    \thmt@thmname
  \else
    \protect\makefirstuc{\thmt@shortoptarg}%
  \fi}
\def\l@thmt@theorem{}
% 
 \makeatother

\begin{document}

\section{The theorems}

\begin{theorem}[equalities of \MakeUppercase{E}uclid]
  \label{thm:prelim}
  $a = b$ and $b = c$
\end{theorem}

\begin{namedtheorem}[name=Fundamental theorem of \NoCaseChange{Euler}]
  \label{thm:euler}   
  $a = c$.
\end{namedtheorem}

\begin{theorem}
  Every equilateral triangle is equiangular.
\end{theorem}

 %% ADDING:
\begin{proposition}\label{prop:none}
This is a proposition with no description.
\end{proposition}

\begin{proposition}[subsidiary result]
\label{prop:sub}
This is a proposition with a description.
\end{proposition}

\listoftheorems

\end{document}

enter image description here

I'm using code:

Partial answer:

Adding the following to the preamble solves the immediate problem, giving the desired entry

Subsidiary result

in the list of theorems:

\maketatletter 
\def\ll@proposition{%
  \protect\numberline{\csname the\thmt@envname\endcsname}%
  \ifx\@empty\thmt@shortoptarg
    \thmt@thmname
  \else
    \protect\makefirstuc{\thmt@shortoptarg}%
  \fi}
\def\l@thmt@proposition{} 
\makeatother

Generalized question:

I also have lemmas, corollaries, etc., which may have optional arguments and whose thmstyle is alsotheorem. I *could* include a separate premable code block forlemma,corollary, etcl, like the ones fortheoremandproposition`.

Is there a better way, a generalized meta-method to handle all such theorem-like thmstyle environments' entries in the list of theorems?

1 Answer 1

2

You have to define also \ll@proposition.

Add

\let\ll@proposition=\ll@theorem

before \makeatother. The command is defined, but since you change the way they are supposed to work normally, you need to redefine all of them.

1
  • 1
    And, obviously, similarly for lemma, corollary, etc. Thanks -- much simpler than I thought!
    – murray
    Oct 1, 2019 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .