章节范本

章节范本

我如何获得以下章节模型 在此处输入图片描述

提前致谢。

答案1

titlesec

 \documentclass{report}
\usepackage{titlesec}

\titleformat{\chapter}[display]
{\normalfont\Large}
{\titlerule[1pt]%
\vspace{1pc}%
\LARGE\chaptertitlename\ \thechapter}
{0pt}
{\vspace{1pc}%
\Huge}

\titleformat{name = \chapter, numberless}[display]
{\normalfont\Large}
{\titlerule[1pt]%
\vspace{1pc}}
{0pt}
{\vspace{-2pc}%
\Huge}

\titlespacing*{\chapter}{0pt}{50pt}{40pt}   %% adjust {left}{top}{bottom}
\titlespacing*{name = \chapter, numberless}{0pt}{50pt}{40pt}   %% adjust {left}{top}{bottom}

\begin{document}
\chapter{Introduction}
Some text follows...
\chapter*{Introduction}
Some text follows...

\end{document}

在此处输入图片描述

答案2

\documentclass{report}
\usepackage{lipsum} % for filler text
\makeatletter
\renewcommand{\@makechapterhead}[1]{%
    \vspace*{50\p@}%
    {\parindent \z@  \normalfont
    \rule{\textwidth}{2pt}
    \vspace{12pt}%
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par
    \vspace{10pt}%
   % \hrule
    \vskip 40\p@
}}
\renewcommand{\@makeschapterhead}[1]{%
    \vspace*{50\p@}%
    {\parindent \z@ 
    \normalfont
    \rule{\textwidth}{2pt}
    \vspace{12pt}%
    \interlinepenalty\@M
    \Huge \bfseries #1\par
    \vspace{10pt}%
    %\hrule
    \vskip 40\p@
}}
\makeatother
\begin{document}
\chapter{Hello There!}
\lipsum[1]
\chapter*{Good Bye}
\lipsum[2]
\end{document}

编号章节: 在此处输入图片描述

二、无编号章节样式: 在此处输入图片描述

相关内容