如何使定理列表中的首字母大写?

如何使定理列表中的首字母大写?

以下 MWE输出中的第一个条目\listoftheorems以小写字母开头,就像相应定理环境中的可选参数一样。

如何才能将该字母变为大写,而不会损坏其他任何内容,包括cleveref交叉引用,而该字母应该保持小写(除了在句子开头时)?

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

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

定理列表中的小写首字母应大写

我尝试使用:

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

但确实如此不是工作。

请注意,来源包括:

这个问题是我最初问题中尚未回答的部分如何删除定理列表中命名定理的括号和额外缩进?

答案1

使用\protect\makefirstuc,但在 的定义中\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[
  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
    \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}

在此处输入图片描述

相关内容