3

I'm finishing a book using Tufte-Style Book (b5paper,twoside,justified). I just arrived at the last chapter (10th) and want it to be different from the previous 9, as it contains different information to be rapidly consulted when needed. As such, I would like to have (only on this chapter), for instance, a vertical color bar at the outer margins (making it readily visible for someone picking up the book) or a horizontal bar at the top of the page. This is probably trivial to some of you, but I'm struggling to find a solution. I'm approaching the deadline and I'm stuck in the very last chapter. Any help would be tremendously welcome to a newbie as myself.


Edit:

I managed to create the vertical bars for the last "special" chapter, using a new pagestyle (see below). However, a new problem arisen as the vertical bars continue to the index. It seems that the AddEverypageHook cannot be de-activated. Any suggestions?

\fancypagestyle{special_chapter}{

\AddEverypageHook{%
\ifthenelse{\isodd{\thepage}}%
{\backgroundsetup{angle=0,position={0.1\textwidth,-
.7\textheight},%
contents={\tikz[remember picture,overlay]{ %
\coordinate (x) at (current page marginpar area.south west|-current page.south west);
\draw[draw=none,fill=gray!20](x)rectangle(current page.north east);}}}}%
{\backgroundsetup{angle=0,position={-0.32\textwidth,-
.7\textheight},%
contents={\tikz[remember picture,overlay]{ %
\coordinate (x) at (current page marginpar area.south west|-current page.south west);
\draw[draw=none,fill=gray!20](x)rectangle(current page.north west);}}}}%
\BgMaterial}
\AtEndDocument{\thispagestyle{plain}}
}

I managed to create the vertical bars for the last "special" chapter, using a new pagestyle (see below). However, a new problem arisen as the vertical bars continue to the index. It seems that the AddEverypageHook cannot be de-activated. Any suggestions?

Thanks,

Nuno

\fancypagestyle{special_chapter}{

\AddEverypageHook{%
\ifthenelse{\isodd{\thepage}}%
{\backgroundsetup{angle=0,position={0.1\textwidth,-
.7\textheight},%
contents={\tikz[remember picture,overlay]{ %
\coordinate (x) at (current page marginpar area.south west|-current page.south west);
\draw[draw=none,fill=gray!20](x)rectangle(current page.north east);}}}}%
{\backgroundsetup{angle=0,position={-0.32\textwidth,-
.7\textheight},%
contents={\tikz[remember picture,overlay]{ %
\coordinate (x) at (current page marginpar area.south west|-current page.south west);
\draw[draw=none,fill=gray!20](x)rectangle(current page.north west);}}}}%
\BgMaterial}
\AtEndDocument{\thispagestyle{plain}}
}
1

I think I got it. Hope this helps anybody as confused with latex as I am.

Using the new pagestyle, I ended up with:

\fancypagestyle{special_chapter}{
\fancyhf{}
\fancyhead[RO]{%
  \begin{tikzpicture}[overlay,remember picture]
      \fill [color=black!20]
        (current page.north east)
        rectangle
        ($ (current page.south east) + (-1cm,0cm) $);
  \end{tikzpicture}
  \smallcaps{\newlinetospace{\leftmark}}\quad\thepage
}
\fancyhead[LE]{%
\begin{tikzpicture}[overlay,remember picture]
      \fill [color=black!20]  
        (current page.north west)
        rectangle
        ($ (current page.south west) + (1cm,0cm) $);
\end{tikzpicture}
\thepage\quad\smallcaps{\newlinetospace{\plaintitle}}
}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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