答案1
这看起来很多像罗格朗橙皮书模板,但颜色有所改变。首先,章节标题周围的框看起来相似,其次,模板还使用文件structure.tex
来包含相关代码。第三latex-community.org 上也出现了同样的问题假设我是正确的,我将在这里重复我在 latex-community.org 上给出的答案的相关部分:
\@makechapterhead
该模板对(编号章节)和(未编号章节)的定义效率低下且具有限制性\@makeschapterhead
。以下是允许多行章节标题的改进版本:\makeatletter \tikzset{ chaptertitle/.style={ line width = 2pt , rounded corners = 15pt , draw = ocre , fill = white , fill opacity = 0.5 , text opacity = 1 , inner sep = 15pt , text = black, node font = \huge\sffamily\bfseries , text width = \paperwidth-\Gm@lmargin-20pt , align = left } } \renewcommand\@makechapterhead[1]{% {% \parindent \z@ \raggedright \normalfont \ifnum \c@secnumdepth >\m@ne \begin{tikzpicture}[remember picture,overlay] \node at (current page.north west) { \begin{tikzpicture}[remember picture,overlay] \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi}; \node[anchor=south west,chaptertitle] at (\Gm@lmargin,-9cm) {\if@mainmatter\thechapter. \fi#1\strut}; \end{tikzpicture} }; \end{tikzpicture} \fi \par\vspace*{270\p@} }% } \renewcommand\@makeschapterhead[1]{% \begin{tikzpicture}[remember picture,overlay] \node at (current page.north west) { \begin{tikzpicture}[remember picture,overlay] \node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi}; \node[anchor=south west,chaptertitle] at (\Gm@lmargin,-9cm) {#1\strut}; \end{tikzpicture} }; \end{tikzpicture} \par\vspace*{270\p@} } \makeatother
将其添加到序言中并使用
\chapterimage{chapter_head_2.pdf} \chapter{Text Chapter so long that it spans two lines. Indeed so long that it spans two lines.}
给出
还可以有更多行: