# How make first letter upper-case in list of theorems?

The first entry in the output from \listoftheorems in the following MWE begins with a lower-case letter, just as in the optional argument in the corresponding theorem environment.

How can that letter be made upper case — without damaging anything else, including the cleveref cross-referencing, where that letter should remain lower-case (except when at the beginning of a sentence)?

\documentclass{article}
\usepackage{suffix}
\usepackage{textcase}
\usepackage{amsthm}
\usepackage{thmtools}
\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}

\usepackage[pdftex]{hyperref}

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

\newcommand{\thmref}[1]{\nameref*{#1} (\cref{#1})}
\WithSuffix\newcommand\thmref*[1]{\nameref*{#1} (\ref{#1})}

\newcommand{\namedthmref}[1]{\cref*{#1}~(\ref{#1})}
\newcommand{\Namedthmref}[1]{\Cref*{#1}~(\ref{#1})}

\makeatletter
%
\def\ll@theorem{%
\protect\numberline{\csname the\thmt@envname\endcsname}%
\ifx\@empty\thmt@shortoptarg
\thmt@thmname
\else
\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}
\label[fte]{thm:euler}
\crefformat{fte}{#2the fundamental theorem of Euler#3}
\Crefformat{fte}{#2The fundamental theorem of Euler#3}
$a = c$.
\end{namedtheorem}

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

\Namedthmref{thm:euler} follows from the \nameref*{thm:prelim} follows from the
\thmref*{thm:prelim}.

\listoftheorems

\end{document}


I tried to use:

\usepackage{mfirstuc}
\renewcommand\thmtformatoptarg[1]{\protect\makefirstuc{#1}}


But that does not work.

Note that the source includes:

This question is the as-yet unanswered part of my original question How remove parentheses and extra indent for named theorems in list of theorems?.

Use \protect\makefirstuc, but in the definition of \ll@theorem:

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

\usepackage[pdftex]{hyperref}

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

\newcommand{\thmref}[1]{\nameref*{#1} (\cref{#1})}
\WithSuffix\newcommand\thmref*[1]{\nameref*{#1} (\ref{#1})}

\newcommand{\namedthmref}[1]{\cref*{#1}~(\ref{#1})}
\newcommand{\Namedthmref}[1]{\Cref*{#1}~(\ref{#1})}

\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}
\label[fte]{thm:euler}
\crefformat{fte}{#2the fundamental theorem of Euler#3}
\Crefformat{fte}{#2The fundamental theorem of Euler#3}
$a = c$.
\end{namedtheorem}

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

\Namedthmref{thm:euler} follows from the \nameref*{thm:prelim} follows from the
\thmref*{thm:prelim}.

\listoftheorems

\end{document}


• Why does this not work if I also declare \newtheorem{proposition}[theorem]{Proposition} in preamble (after  \theoremstyle{thmstyle}) and then in the body have something like \begin{proposition}[subsidiary result]..\end{proposition? For that item, the list of theorems has "Propositionsubsidiaryresult" ! See tex.stackexchange.com/questions/510470/…. – murray Oct 1 '19 at 17:30
• @murray I'll have a look. – egreg Oct 1 '19 at 21:30