我正在使用memoir
该\listoftheorems
包的thmtools
。我想使用 sffamily 字体来排版定理列表。
作为内部\listoftheorems
使用\listoffigures
,我尝试设置\renewcommand{\cftfigurefont}{\normalsize\sffamily}
,但只改变了数字列表(请参阅下面的 MWE)。检查后thm-listof.sty
,我仍然没有找到在哪里调整它。
如何调整定理列表的排版字体?
梅威瑟:
\documentclass{memoir}
\usepackage{amsthm}
\usepackage{thmtools}
\newtheorem{theorem}{Theorem}[chapter]
\begin{document}
\renewcommand{\cftfigurefont}{\normalsize\sffamily}
\listoffigures
\listoftheorems
\begin{theorem}
My first theorem.
\end{theorem}
\begin{theorem}
My second theorem.
\end{theorem}
\begin{figure}
My favorite figure.
\caption{My favorite figure's caption.}
\end{figure}
\end{document}
编辑:我的目的(对于这个问题)是排版定理列表,而不是定理本身。
答案1
该\listoftheorems
命令设置每个\contentsline
执行标准book
类操作。
使用下面提出的补丁,每个条目都将被视为图形标题。
\documentclass{memoir}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xpatch}
\newtheorem{theorem}{Theorem}[chapter]
\renewcommand{\cftfigurefont}{\normalsize\sffamily} % should be in the preamble
\makeatletter
\xpatchcmd{\listoftheorems}
{\let\thref@starttoc\@starttoc}
{%
\@for\thmt@envname:=\thmt@allenvs\do{%
\@xa\let\csname l@\thmt@envname\endcsname\l@figure
}%
\let\cftfigurenumwidth\thmt@listnumwidth
\let\thref@starttoc\@starttoc
}{}{}
\makeatother
\begin{document}
\listoffigures
\listoftheorems
\begin{theorem}
My first theorem.
\end{theorem}
\begin{theorem}
My second theorem.
\end{theorem}
\begin{figure}[htp]
My favorite figure.
\caption{My favorite figure's caption.}
\end{figure}
\end{document}
答案2
如果您喜欢定理本身,您可以选择更改定理列表和图片列表的字体。希望它有用并且符合您的预期。
\documentclass{memoir}
\usepackage{amsthm}
\usepackage{thmtools}
%\newtheorem{theorem}{Theorem}[chapter]
% here you can style your theorem entries, instead of using above line
\declaretheoremstyle[
%change to \normalfont\sffamily, if you wanted sans-serif for theorem entries
spaceabove=3pt, spacebelow=3pt, headfont=\normalfont\bfseries,
notefont=\normalfont, notebraces={(}{)}, bodyfont=\normalfont]{theorem}
\declaretheorem[style=theorem, name=Theroem, numberwithin=chapter]{theorem}
%this sets up the font for list of theorems
\renewcommand{\listtheoremname}{\sffamily{List of my Theorems}} %needed for title
\newenvironment{myfont}{\fontfamily{cmss}\selectfont}{\par} %needed for list entries
%this sets up the font for list of figures
\renewcommand*\listfigurename{\sffamily{List of my figures}} %needed for title
\renewcommand{\cftfigurefont}{\sffamily} %needed for list entires
\begin{document}
\listoffigures
\begin{myfont}
\listoftheorems
\end{myfont}
\vspace{2cm} %some space
\begin{theorem}
My first theorem.
\end{theorem}
\begin{theorem}
My second theorem.
\end{theorem}
\vspace{1cm} %some space
\begin{figure}[!htb]
My favorite figure.
\caption{My favorite figure's caption.}
\end{figure}
\end{document}