Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to obtain an effect like the page below? The gray tones of the effect in the page below are uniforms but I would have different tones among the various shapes. The main gray tone should be the following:

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

I think that, this decoration should be applied (if this experiment is successful) only at the first page of each chapter...

enter image description here

\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}

To be clear, I wouldn't this behaviour, but I would that the decoration go always in the bigger margin... (I've have used openany)

enter image description here

share|improve this question
5  
I like this decoration! –  Gonzalo Medina Dec 10 '12 at 3:05
2  
Me too! Notice that you'll probably want to print on a larger paper and crop it, since printers usually cannot print too close to the paper border. –  mbork Dec 10 '12 at 6:00
    
I like the idea, but just from a design perspective I find it is a bit too much for a page that also has a lot of text on it. I think it would look nice on the title page or the "parts" page. But of course this is subjective and just a comment :-) –  Jörg Dec 14 '12 at 13:34
    
@Jörg But it would be a shame because the most of times aren't used the parts : S However Thanks for the advice/comment ! : ) –  FormlessCloud Dec 14 '12 at 13:52

1 Answer 1

up vote 32 down vote accepted

Here's one possibility using TikZ; \chapterdecoration is automatically invoked using the last optional argument of \titleformat for \chapter as given in arsclassica.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}

enter image description here

In a comment, FormlessCloud asked for a change so that the decoration will always appear in the outer margin (this, of course, if the openany class option is active); here's the necessary modification:

\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}

An image of the two pages containing the beginning of a chapter, illustrating the alternancy in the margin:

enter image description here

share|improve this answer
    
Very good! I have only changed: xshift=2pt to xshift=3pt of darkest shape and the color of \vline in the tileformat command, you have changed it in halfgray... –  FormlessCloud Dec 10 '12 at 16:54
1  
@FormlessCloud I introduced some improvements to the code using auxiliary coordinates. –  Gonzalo Medina Dec 10 '12 at 16:56
    
This code works only for the right pages, right? –  FormlessCloud Dec 10 '12 at 23:18
    
@FormlessCloud yes; do you need a version that also works for left (even-numbered) pages? –  Gonzalo Medina Dec 10 '12 at 23:23
    
@FormlessCloud I've done some tests and, using the twoside, openany class options, the code will produce the decoration in the outer margin for odd-numbered pages and in the inner margin for even-numbered pages. Is this the expected behaviour or do you want anything else? –  Gonzalo Medina Dec 11 '12 at 2:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.