使用 amsthm + thmtools 时 \listoftheorems 中的水平间距问题

使用 amsthm + thmtools 时 \listoftheorems 中的水平间距问题

\listoftheorems我正在使用带有包amsthm和的命令thmtools。问题是定理的头部和其可选标题重叠。我怎样才能使这个空间更大以避免重叠?


谢谢大家。我在下面附上了一个例子(可能不是最小的)。我试过了,\makeatletter\thmt@listnumwidth{4.3em}\makeatother但出现了错误。也是一样\renewcommand{\l@theorem}{\@tocline{0}{3pt plus2pt}{0pt}{3.5em}{}}。还有其他线索吗?我应该尝试使用 ntheorem 吗?

%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,english,titlepage, fleqn,numbers=noenddot]{scrbook}
\usepackage[osf]{mathpazo}
\usepackage{helvet}
\usepackage{courier}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{headings}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={},
   pdfkeywords={music cognition, categorization, embodiment}}

\makeatletter

\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\usepackage{amsthm}
\usepackage{thmtools}

\declaretheorem[style=remark, name={}]{Example}
\renewcommand{\theExample}{\bf{Def. \thechapter.\arabic{Example}}}

\makeatletter
\def\th@remark{%
\thm@headpunct{:}
  \thm@notefont{\bfseries\itshape}}
\makeatother

\makeatletter
\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont#3}}}
\let\thmhead\thmhead@plain
\def\swappedhead#1#2#3{%
  \thmnumber{#2}%
  \thmname{\@ifnotempty{#2}{~}#1}%
  \thmnote{ {\the\thm@notefont#3}}}
\makeatother

\newcounter{genero}
\setcounter{genero}{1}

\AtBeginDocument{
  \def\labelitemi{\normalfont\bfseries{--}}
  \def\labelitemii{\(\star\)}
  \def\labelitemiii{\(\cdot\)}
}

\makeatother

\begin{document}
\listoftheorems

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

first example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

second example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

third example.

\end{Example}
\end{document}

答案1

只需使用

\renewcommand\thmt@listnumwidth{4.3em}

加载后thmtools(并将其包含在\makeatletter,中\makeatother)。以下是您的文档,对序言进行了一些修改(我更改了软件包加载的顺序,并抑制了一些冗余,并抑制了一些冗余的\makeatletter,\makeatother对):

\documentclass[12pt,a4paper,english,titlepage, fleqn,numbers=noenddot]{scrbook}
\usepackage[osf]{mathpazo}
\usepackage{helvet}
\usepackage{courier}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{headings}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}
\usepackage{setspace}
\onehalfspacing
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={},
 pdfkeywords={music cognition, categorization, embodiment}}

\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\declaretheorem[style=remark, name={}]{Example}
\renewcommand{\theExample}{\bf{Def. \thechapter.\arabic{Example}}}

\makeatletter

\renewcommand\thmt@listnumwidth{4.3em}

\def\th@remark{%
\thm@headpunct{:}
  \thm@notefont{\bfseries\itshape}}

\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont#3}}}
\let\thmhead\thmhead@plain
\def\swappedhead#1#2#3{%
  \thmnumber{#2}%
  \thmname{\@ifnotempty{#2}{~}#1}%
  \thmnote{ {\the\thm@notefont#3}}}
\makeatother

\newcounter{genero}
\setcounter{genero}{1}

\AtBeginDocument{
  \def\labelitemi{\normalfont\bfseries{--}}
  \def\labelitemii{\(\star\)}
  \def\labelitemiii{\(\cdot\)}
}

\begin{document}
\listoftheorems

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

first example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

second example.

\end{Example}

\begin{Example}[Género musical \thegenero]\stepcounter{genero}

third example.

\end{Example}
\end{document}

在此处输入图片描述

顺便提一下,我发现有些奇怪,你加载了thmtools但显然没有使用它的所有功能作为前端(或者,至少这是我快速浏览你的代码后得到的印象)来帮助你定义你的结构;也许,如果我有时间,我也会给你一些关于这方面的建议,但我不能保证任何事情。

相关内容