如何使用 LaTeX 来获得如下图所示的结果?
在这张图片中,$\mathsection{1} Hình thang và hình bình hành$
是第一部分的标题。如果我使用\mathsection
和\section
,那么结果是
我的问题是:什么代码可以给我像第一张图片那样的结果?
答案1
您可以重新定义\@makechapterhead
,\@makeschapterhead
并\@sect
获取标题所需的表示(使用像titlesec
这里的包是不可能的,因为它与 AMS 文档类不兼容):
\documentclass[11pt,a4paper]{amsbook}
\makeatletter
\def\@makechapterhead#1{\global\topskip 5.5pc\relax
\begingroup
\fontsize{\@xivpt}{18}\bfseries\centering
\ifnum\c@secnumdepth>\m@ne
\leavevmode \hskip-\leftskip
\rlap{\vbox to\z@{\vss
\centerline{\normalsize\mdseries
\@xp{\scshape{\chaptername}}\enspace\thechapter}
\vskip 2pc}}\hskip\leftskip\fi
\normalfont\scshape#1\par \endgroup
\skip@34\p@ \advance\skip@-\normalbaselineskip
\vskip\skip@ }
\def\@makeschapterhead#1{\global\topskip 7.5pc\relax
\begingroup
\fontsize{\@xivpt}{18}\normalfont\scshape\centering
#1\par \endgroup
\skip@34\p@ \advance\skip@-\normalbaselineskip
\vskip\skip@ }
\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
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
\else
\refstepcounter{#1}%
\edef\@svsec{\ifnum#2<\@m
\@ifundefined{#1name}{}{%
\ignorespaces\csname #1name\endcsname\space}\fi
\@nx\textup{%
\csname the#1\endcsname.}\enspace
}%
\fi
\@tempskipa #5\relax
\ifdim \@tempskipa>\z@ % then this is not a run-in section heading
\begingroup\ifnum#2=1 \noindent\textbf{\S}\fi#6\relax% NEW
\@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M #8\par}%
\endgroup
\csname #1mark\endcsname{#7}%
\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}}
\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}
{\normalfont\bfseries}}
\makeatother
\begin{document}
\chapter{Test Chapter}
\section{Test Numbered Section}
\section*{Test Unnumbered Section}
\end{document}