章内で\mathsectionを使用する

章内で\mathsectionを使用する

LaTeX を使用して次の図のような結果を得るにはどうすればよいでしょうか?

ここに画像の説明を入力してください

この図では、$\mathsection{1} Hình thang và hình bình hành$は最初のセクションのタイトルです。\mathsectionと を使用すると\section、結果は次のようになります。

ここに画像の説明を入力してください

私の質問は、最初の画像のような結果をもたらすコードは何ですか?

答え1

\@makechapterhead、および を再定義し\@makeschapterheadて、見出しの目的の表現を取得できます\@sect(ここでのようなパッケージはtitlesecAMS ドキュメント クラスと互換性がないため、使用できません)。

\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}

ここに画像の説明を入力してください

関連情報