补充一下后续,在@雾月大佬的帮助下,成功解决。另外我修改了目录,参考了(https://tex.stackexchange.com/questions/322268/table-of-contents-amsart)
最终效果:
修改后的mwe见附件。
具体修改的代码如下
\makeatletter
\def\contentsnamefont{\bfseries} % 如果要改Contents
\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\large\bfseries\centering}}
\def\subsubsection{\@startsection{subsubsection}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont}}
\renewenvironment{abstract}{%
\ifx\maketitle\relax
\ClassWarning{\@classname}{Abstract should precede
\protect\maketitle\space in AMS document classes; reported}%
\fi
\global\setbox\abstractbox=\vtop \bgroup
\normalfont\Small
\list{}{\labelwidth\z@
\leftmargin3pc \rightmargin\leftmargin
\listparindent\normalparindent \itemindent\z@
\parsep\z@ \@plus\p@
\let\fullwidthdisplay\relax
}%
\item[\hskip\labelsep\bfseries\abstractname.]%
}{%
\endlist\egroup
\ifx\@setabstract\relax \@setabstracta \fi
}
\def\@setabstract{\@setabstracta \global\let\@setabstract\relax}
\def\@setabstracta{%
\ifvoid\abstractbox
\else
\skip@20\p@ \advance\skip@-\lastskip
\advance\skip@-\baselineskip \vskip\skip@
\box\abstractbox
\prevdepth\z@ % because \abstractbox is a vtop
\fi
}
\renewcommand\contentsnamefont{\Large\bfseries}
%Table of Contents
\setcounter{tocdepth}{3}
% Add bold to \section titles in ToC and remove . after numbers
\renewcommand{\tocsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\bfseries\ignorespaces#1 #2\quad}}\bfseries#3}
% Remove . after numbers in \subsection
\renewcommand{\tocsubsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\ignorespaces#1 #2\quad}}#3}
%\let\tocsubsubsection\tocsubsection% Update for \subsubsection
%...
\newcommand\@dotsep{4.5}
\def\@tocline#1#2#3#4#5#6#7{\relax
\ifnum #1>\c@tocdepth % then omit
\else
\par \addpenalty\@secpenalty\addvspace{#2}%
\begingroup \hyphenpenalty\@M
\@ifempty{#4}{%
\@tempdima\csname r@tocindent\number#1\endcsname\relax
}{%
\@tempdima#4\relax
}%
\parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
\rightskip\@pnumwidth plus1em \parfillskip-\@pnumwidth
#5\leavevmode\hskip-\@tempdima{#6}\nobreak
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
\nobreak
\hbox to\@pnumwidth{\@tocpagenum{\ifnum#1=1\bfseries\fi#7}}\par% <-- \bfseries for \section page
\nobreak
\endgroup
\fi}
\AtBeginDocument{%
\expandafter\renewcommand\csname r@tocindent0\endcsname{0pt}
}
\def\l@subsection{\@tocline{2}{0pt}{2.5pc}{5pc}{}}
\def\l@subsubsection{\@tocline{2}{0pt}{4pc}{5pc}{}}
\makeatother
问 amsart宏包,重定义section问题。