尝试以“ClassicThesis 风格”进行图形装饰

尝试以“ClassicThesis 风格”进行图形装饰

有没有办法获得类似下面页面的效果?下面页面中效果的灰色色调是统一的,但我想在各种形状之间使用不同的色调。主要灰色色调应如下:

\definecolor{halfgray}{gray}{0.55}
\color{halfgray}% in classicthesis 

我认为,这种装饰应该只在每章的第一页应用(如果这个实验成功的话)......

在此处输入图片描述

\documentclass[headinclude,footinclude]{scrbook}

\usepackage[eulerchapternumbers,pdfspacing]{classicthesis}

\usepackage{arsclassica}

\begin{document}
\chapter{graphic test}
\section{graphic test}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin et metus vel diam tempus egestas in ut sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus justo orci, porttitor at tempor ut, gravida at urna. Donec facilisis purus quis dolor viverra non cursus turpis fermentum. Phasellus elit metus, interdum vitae semper id, consequat at sem. Quisque sollicitudin purus enim. Fusce ultrices libero at neque dignissim eleifend. Vestibulum est libero, accumsan vitae ullamcorper sit amet, laoreet vel mauris. Quisque id odio sapien, non ultrices justo. Nulla sit amet magna nunc, in tempor lectus. Maecenas vitae sem nec mi tincidunt vehicula.
\end{document}

要明确的是,我不会这种行为,但我希望装饰总是在更大的范围内......(我已经使用过openany

在此处输入图片描述

答案1

以下是使用 TikZ 的一种可能性;使用for\chapterdecoration的最后一个可选参数自动调用,如下所示:\titleformat\chapterarsclassica.sty

\documentclass[headinclude,footinclude]{scrbook}
\usepackage[eulerchapternumbers,pdfspacing]{classicthesis}
\usepackage{arsclassica}
\usepackage{tikz}
\usepackage{lipsum}

\titleformat{\chapter}[block]%
        {\normalfont\Large\sffamily}%
        {{\color{halfgray}\chapterNumber\thechapter%
        \hspace{10pt}\vline}  }{10pt}%
        {\spacedallcaps}[\chapterdecoration]

\definecolor{halfgray}{gray}{0.55}

\newcommand\chapterdecoration{%
\begin{tikzpicture}[remember picture,overlay,shorten >= -10pt]

\coordinate (aux1) at ([yshift=-15pt]current page.north east);
\coordinate (aux2) at ([yshift=-410pt]current page.north east);
\coordinate (aux3) at ([xshift=-4.5cm]current page.north east);
\coordinate (aux4) at ([yshift=-150pt]current page.north east);

\begin{scope}[halfgray!40,line width=12pt,rounded corners=12pt]
\draw
  (aux1) -- coordinate (a)
  ++(225:5) --
  ++(-45:5.1) coordinate (b);
\draw[shorten <= -10pt]
  (aux3) --
  (a) --
  (aux1);
\draw[opacity=0.6,halfgray,shorten <= -10pt]
  (b) --
  ++(225:2.2) --
  ++(-45:2.2);
\end{scope}
\draw[halfgray,line width=8pt,rounded corners=8pt,shorten <= -10pt]
  (aux4) --
  ++(225:0.8) --
  ++(-45:0.8);
\begin{scope}[halfgray!70,line width=6pt,rounded corners=8pt]
\draw[shorten <= -10pt]
  (aux2) --
  ++(225:3) coordinate[pos=0.45] (c) --
  ++(-45:3.1);
\draw
  (aux2) --
  (c) --
  ++(135:2.5) --
  ++(45:2.5) --
  ++(-45:2.5) coordinate[pos=0.3] (d);   
\draw 
  (d) -- +(45:1);
\end{scope}
\end{tikzpicture}%
}

\begin{document}

\chapter{graphic test}
\section{graphic test}
\lipsum[1-3]

\end{document}

在此处输入图片描述

在评论中,无形云要求进行更改,以便装饰始终出现在外边缘(当然,如果openany类选项处于活动状态);这是必要的修改:

\documentclass[headinclude,footinclude,openany]{scrbook}
\usepackage[eulerchapternumbers,pdfspacing]{classicthesis}
\usepackage{arsclassica}
\usepackage{tikz}
\usepackage{changepage}
\usepackage{lipsum}% just to generate text for the example

\strictpagecheck

\titleformat{\chapter}[block]%
        {\normalfont\Large\sffamily}%
        {{\color{halfgray}\chapterNumber\thechapter%
        \hspace{10pt}\vline}  }{10pt}%
        {\spacedallcaps}[\chapterdecoration]

\definecolor{halfgray}{gray}{0.55}

\newcommand\anglei{-45}
\newcommand\angleii{45}
\newcommand\angleiii{225}
\newcommand\angleiv{135}

\newcommand\chapterdecoration{%
\begin{tikzpicture}[remember picture,overlay,shorten >= -10pt]
\coordinate (aux1) at ([yshift=-15pt]current page.north east);
\coordinate (aux2) at ([yshift=-410pt]current page.north east);
\coordinate (aux3) at ([xshift=-4.5cm]current page.north east);
\coordinate (aux4) at ([yshift=-150pt]current page.north east);
\checkoddpage
\ifoddpage
\else
\coordinate (aux1) at ([yshift=-15pt]current page.north west);
\coordinate (aux2) at ([yshift=-410pt]current page.north west);
\coordinate (aux3) at ([xshift=4.5cm]current page.north west);
\coordinate (aux4) at ([yshift=-150pt]current page.north west);
\renewcommand\anglei{-135}
\renewcommand\angleii{135}
\renewcommand\angleiii{-45}
\renewcommand\angleiv{45}
\fi
\begin{scope}[halfgray!40,line width=12pt,rounded corners=12pt]
\draw
  (aux1) -- coordinate (a)
  ++(\angleiii:5) --
  ++(\anglei:5.1) coordinate (b);
\draw[shorten <= -10pt]
  (aux3) --
  (a) --
  (aux1);
\draw[opacity=0.6,halfgray,shorten <= -10pt]
  (b) --
  ++(\angleiii:2.2) --
  ++(\anglei:2.2);
\end{scope}
\draw[halfgray,line width=8pt,rounded corners=8pt,shorten <= -10pt]
  (aux4) --
  ++(\angleiii:0.8) --
  ++(\anglei:0.8);
\begin{scope}[halfgray!70,line width=6pt,rounded corners=8pt]
\draw[shorten <= -10pt]
  (aux2) --
  ++(\angleiii:3) coordinate[pos=0.45] (c) --
  ++(\anglei:3.1);
\draw
  (aux2) --
  (c) --
  ++(\angleiv:2.5) --
  ++(\angleii:2.5) --
  ++(\anglei:2.5) coordinate[pos=0.3] (d);   
\draw 
  (d) -- +(\angleii:1);
\end{scope}
\end{tikzpicture}%
}

\begin{document}

\mbox{}\newpage%just for the example
\chapter{graphic test}
\section{graphic test}
\lipsum[1-3]
\chapter{graphic test}
\section{graphic test}
\lipsum[1-3]

\end{document}

包含章节开头的两页图像,说明了页边距的交替:

在此处输入图片描述

相关内容