\listoftheorems
对于普通环境的条目theorem
,无论它们是否具有可选参数,以及对于namedtheorem
环境,都给出所需的结果。
问题:需要进行哪些修改才能为具有proposition
可选参数的类定理环境提供相应的条目?
我越来越...
Propositionsubsidiary result
...我期望的地方...
Subsidiary result
...(首字母大写)在定理列表中。
\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}
我正在使用代码:
- 对于
\ll@theorem
来自https://tex.stackexchange.com/a/509748/13492 - 对于
\thmtformatoptarg
来自https://tex.stackexchange.com/a/193020/13492
部分答案:
在序言中添加以下内容可以解决眼前的问题,并提供所需的条目
Subsidiary result
在定理列表中:
\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
广义问题:
我还有引理、推论等等,它们可能有可选的参数,并且其thmstyle is also
定理. I *could* include a separate premable code block for
引理,
推论, etcl, like the ones for
定理and
命题`。
thmstyle
有没有更好的方法,一种通用的元方法来处理定理列表中所有此类定理环境的条目?
答案1
您还必须定义\ll@proposition
。
添加
\let\ll@proposition=\ll@theorem
之前\makeatother
。命令是定义,但由于你改变了它们正常工作的方式,你需要重新定义全部其中。