# List of theorems: only the optional argument, if nonempty, for all theorem-like environments?

\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[
notefont=\bfseries,
bodyfont=\mdseries\itshape,
spaceabove=12pt,spacebelow=12pt,
\ifx\@empty\thmt@shortoptarg
\fi}
]{thmstyle}

\declaretheoremstyle[
notefont=\bfseries,
notebraces={}{},
bodyfont=\mdseries\itshape,
spaceabove=12pt,spacebelow=12pt,
\ifx\@empty\thmt@shortoptarg
\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}

\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}

\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}


I'm using code:

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?

You have to define also \ll@proposition.
\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.
• And, obviously, similarly for lemma, corollary`, etc. Thanks -- much simpler than I thought! – murray Oct 1 '19 at 21:38