如何启用这种风格以及目录和参考书目页?
请注意,我使用的是scrreprt
文档类
答案1
这是问题中链接的答案中使用的代码的变体;使用这个新代码,textpos
不再需要包;使用\titleformat
密钥numberless
,还可以获得未编号章节所需的格式(\tableofcontents
例如):
\documentclass{scrreprt}
\usepackage[explicit]{titlesec}
\usepackage{tikz}
\usetikzlibrary{calc}
\DeclareFixedFont{\chapternumberfont}{T1}{ppl}{m}{n}{1.5in}
\newcommand\brectangles{%
\begin{tikzpicture}[overlay, remember picture]
\fill[cyan]
(current page.north west) rectangle ( $ (current page.north east) + (0,-7cm) $);
\fill[cyan!30]
(current page.south west) rectangle ( $ (current page.south east) + (0,3cm) $);
\end{tikzpicture}%
}
\titleformat{\chapter}[display]
{\Huge\bfseries\sffamily\color{white}}
{\thispagestyle{empty}\brectangles}
{-1.75in}
{%
\vskip-4ex\filleft {\small\MakeUppercase{Digital Media Primer}}\\[2ex]
\parbox[b]{.65\linewidth}{#1}%
\raisebox{0.8in}{\parbox{.15\linewidth}{\large\chaptertitlename}}%
\parbox[b]{.2\linewidth}{\chapternumberfont\thechapter}%
}
[\vspace*{1in}]
\titleformat{name=\chapter,numberless}[display]
{\Huge\bfseries\sffamily\color{white}}
{\thispagestyle{empty}\brectangles}
{-1in}
{\parbox[b]{.65\linewidth}{#1}}
[\vspace*{1in}]
\begin{document}
\tableofcontents
\chapter{Background}
\end{document}
生成的文档的图像显示了编号和未编号章节所需的格式:
请随意进行您认为最适合您需求的调整。