我正在尝试为论文创建特定的章节样式,但不知道如何自己创建。我想要的样式如下图所示。我只是试图复制章节标题本身。有人能给我指出正确的方向吗?
答案1
仅仅是初次尝试,并不完美。
标题chapter
排版在\@makechapterhead
-- 而不是标准代码中,可以在那里插入一个表格,这样可以“自动”排版
\documentclass{book}
\usepackage{array}
\usepackage{xpatch}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\makeatletter
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\begin{tabular}{p{1.2cm}|C{0.6\textwidth}}
& \tabularnewline
& \huge\bfseries \@chapapp\space \thechapter \tabularnewline
& \tabularnewline
\hline
& \tabularnewline
& \huge \bfseries #1 \tabularnewline
& \tabularnewline
\end{tabular}
\fi
\fi
\interlinepenalty\@M
\vskip 40\p@
}}
\makeatother
\usepackage{blindtext}
\begin{document}
\chapter{First}
\blindtext
\chapter{A really long chapter title which wraps around}
\end{document}