0

The output from \listoftheorems in the following MWE has unwanted parentheses around the names of namedtheorem theorem-like environments and extra indentation there, too.

  1. How can the parentheses and extra indentation be removed?
  2. How can the initial letter of the first entry "equalities of Euclid" in the list be made to be upper-case (without it being upper-case where it appears in that theorem's enunciation?

The MWE source:

\documentclass{article}
\usepackage{suffix}
\usepackage{textcase}
\usepackage{amsthm}
\usepackage{thmtools}
\renewcommand{\listtheoremname}{List of Important Theorems}
\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}

\usepackage[pdftex]{hyperref}
\hypersetup{colorlinks,linkcolor=blue}

\usepackage[nameinlink,noabbrev,capitalize]{cleveref}

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

Output:

Unwanted parens & extra indentation in listoftheorems for namedtheorem

Note that the source includes:

  • cleveref-related code, just to be sure that the solution to my questions does not break the cross-referencing by name; and
  • code as in https://tex.stackexchange.com/a/401600/13492,and elsewhere, related to capitalization of named theorems for cleveref commands.
2

0

Browse other questions tagged .