这就是我的代码:
\section{MAIN RESULTS}
\subsection{Graphical Analysis}
我在 pdf 中看到了这个:
相反,我希望该小节采用斜体非粗体形式,末尾没有句号。
以下是我在序言中的内容:
\documentclass[11pt,reqno]{amsart}
% Packages
\usepackage{graphicx}
\usepackage{amssymb,amsthm}
\usepackage{natbib}
\bibpunct{(}{)}{;}{;}{,}{,}
\usepackage{xr-hyper}
\usepackage[
colorlinks=true,
citecolor=blue,
urlcolor=blue,
linkcolor=blue
]{hyperref}
\usepackage{bm}
\usepackage{fullpage}
\usepackage{ amssymb }
\usepackage{caption} \captionsetup[figure]{labelfont=normalfont,labelsep=colon}
\usepackage{mathabx}
\pagestyle{plain}
\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{12pt}
\setcounter{secnumdepth}{2}
\allowdisplaybreaks[4]
% Commenting/debugging
\let\IG\iffalse
\let\ENDIG\fi
%% Shortcuts
\newcommand{\td}[2]{\dfrac{d #1}{d #2}}
\newcommand{\std}[2]{\dfrac{d^2 #1}{d {#2}^2}}
\newcommand{\ctd}[3]{\dfrac{d^2 #1}{d #2 d #3}}
\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\spd}[2]{\dfrac{\partial^2 #1}{\partial {#2}^2}}
\newcommand{\cpd}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}}
\newcommand{\pdi}[2]{\partial #1/\partial #2}
\newcommand{\LR}{\Leftrightarrow}
\newcommand{\Lg}{\mathcal{L}}
\newcommand{\half}{\tfrac{1}{2}}
\newcommand{\eqp}{\phantom{=}}
\newcommand{\eqs}{\buildrel s \over =}
\newcommand{\me}{\mathrm{e}}
答案1
您尝试更改的格式是由 AMS 定制的,以适应其编辑风格;由于 AMS 文档类有自己的操作方式,因此无法使用与标准类配合的包进行此类更改,并且需要对一些内部命令进行重新定义。
重新定义\subsection
可以得到非粗体、斜体的小节字体;重新定义\@sect
抑制\@addpunct.
将消除最后的句点。
代码:
\documentclass{amsart}
\makeatletter
\def\subsection{\@startsection{subsection}{1}%
\z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
{\normalfont\itshape}}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
\ifnum #2>\c@secnumdepth \let\@secnumber\@empty
\else \@xp\let\@xp\@secnumber\csname the#1\endcsname\fi
\@tempskipa #5\relax
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
\else
\refstepcounter{#1}%
\edef\@secnumpunct{%
\ifdim\@tempskipa>\z@ % not a run-in section heading
\@ifnotempty{#8}{.\@nx\enspace}%
\else
\@ifempty{#8}{.}{.\@nx\enspace}%
\fi
}%
\@ifempty{#8}{%
\ifnum #2=\tw@ \def\@secnumfont{\bfseries}\fi}{}%
\protected@edef\@svsec{%
\ifnum#2<\@m
\@ifundefined{#1name}{}{%
\ignorespaces\csname #1name\endcsname\space
}%
\fi
\@seccntformat{#1}%
}%
\fi
\ifdim \@tempskipa>\z@ % then this is not a run-in section heading
\begingroup #6\relax
\@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M #8\par}%
\endgroup
\ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
\else
\def\@svsechd{#6\hskip #3\@svsec
\@ifnotempty{#8}{\ignorespaces#8\unskip
%\@addpunct.
}%
\ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
}%
\fi
\global\@nobreaktrue
\@xsect{#5}}
\makeatother
\begin{document}
\section{MAIN RESULTS}
\subsection{Graphical Analysis}
\end{document}
补丁可以减少代码:
\documentclass{amsart}
\usepackage{etoolbox}
\makeatletter
\def\subsection{\@startsection{subsection}{1}%
\z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
{\normalfont\itshape}}
\patchcmd{\@sect}
{\@addpunct.}
{}
{}
{}
\makeatother
\begin{document}
\section{MAIN RESULTS}
\subsection{Graphical Analysis}
\end{document}
答案2
这是一个基于加载etoolbox
包并执行其\patchcmd
宏几次的解决方案。
\documentclass[11pt,reqno]{amsart}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\subsection}{\bfseries}{\itshape}{}{}
\patchcmd{\@sect}{\@addpunct.}{}{}{}
\makeatother
\begin{document}
\setcounter{section}{2} % just for this example
\section{Main Results}
\subsection{Graphical Analysis}
\end{document}