3

How can I use LaTeX to get the result like the following picture?

enter image description here

In this picture, $\mathsection{1} Hình thang và hình bình hành$ is the title of the first section. If I use \mathsection and \section, then the result is

enter image description here

My question is: What is the code that gives me the result like the first picture?

4

You can redefine \@makechapterhead, \@makeschapterhead and \@sect to obtain the desired representation for the headings (using a package like titlesec here is not possible since it's not compatible with the AMS document classes):

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

enter image description here

  • How can I customize the word Chapter since in my original file when I type chapter it gave me "Chương"(which is chapter in my native language). But when I add your titleformat, it gave me Chapter rather than "Chương". So how can I customize your titleformat command to keep the word "Chương" ? – Knumber10 Apr 10 '13 at 3:16
  • @Nguyễn Duy Khánh which document class are you using? Are you loading the babel package? If so, with what language option? – Gonzalo Medina Apr 10 '13 at 4:36
  • 1
    @NguyễnDuyKhánh Replace \chaptertitlename with \chaptername in my code; this should give you "Chương" again; if not, let me know to find a solution. – Gonzalo Medina Apr 10 '13 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.