Choose columnsep depending on page
You tell TeX in the beginning that if this is not a chapter page, it should patch the command @outputdblcol
in one way, and otherwise in another. However, in the preamble this is not a chapter page. You need to make TeX check for every single page. To this end I moved \ifchapterpage
into the TikZ picture. Also you never set the conditional to false. I added this reset, too. Finally, the arguably more appropriate way to make a tikzpicture
take no space is to add overlay
.
\documentclass[11pt,a5paper,twocolumn,twoside]{book}
\usepackage{geometry}
\geometry{
paper = a5paper,
layout = a5paper,
layoutsize = {148 mm, 210 mm},
includehead = true,
includefoot = true,
inner = 1.5 cm,
outer = 1 cm,
top = 1.5 cm,
bottom = 1.5 cm,
columnsep = .8cm,
}
\usepackage{tikz}
\newif\ifchapterpage
\usepackage{etoolbox}
\makeatletter
%
\patchcmd\@outputdblcol
{\normalcolor\vrule\@width\columnseprule}
{\raisebox{.5\textheight}{%
\begin{tikzpicture}[overlay]
%\useasboundingbox;
\ifchapterpage
%\message{page \thepage\space is a chapter page}
\fill[blue] (0,0) circle (.1cm);
\draw[blue] ++(90:.75) to ++(90:2);
\draw[blue] ++(-90:.75) to ++(-90:6);
\global\chapterpagefalse
\else
%\message{page \thepage\space is not a chapter page}
\fill[blue] (0,0) circle (.1cm);
\draw[blue] ++(90:.75) to ++(90:6);
\draw[blue] ++(-90:.75) to ++(-90:6);
\fi
\end{tikzpicture}}}%\mydrawcolumnseprule}
{}{}
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\rightmark}
\fancyhead[C]{\thepage}
\fancyhead[R]{\chaptername}
\fancyfoot{}
\usepackage{titlesec}
\titleformat{\chapter}% command
[block]% shape
{\centering\itshape\huge}% format
{}% label
{0cm}% sep
{{\normalsize The tale of\\}}% before-code
[\global\chapterpagetrue\vspace{1cm}]% after-code
\titlespacing{\chapter}% command
{0pt}% left margin
{0pt}% Vertical space before title
{1cm}% Vertical space between title and text
\usepackage{lipsum}
\chapterpagetrue
\begin{document}
\chapter*{Rhotingger}
\lipsum[1-10]
\chapter*{Blauinger}
\lipsum[11-20]
\end{document}
Here is a version which uses tikzpagenodes and everypage. Note that \@outputdblcol
is not used by paracol or multicol. I created \mycolumnsep
in order to test it before adding it to every page.
Don't forget to run it twice, due to [remember picture]
.
BTW, you can also use this approach to replace fancyhdr.
\documentclass[11pt,a5paper,twocolumn,twoside]{book}
\usepackage{geometry}
\geometry{
paper = a5paper,
layout = a5paper,
layoutsize = {148 mm, 210 mm},
includehead = true,
includefoot = true,
inner = 1.5 cm,
outer = 1 cm,
top = 1.5 cm,
bottom = 1.5 cm,
columnsep = .8cm,
}
\usepackage{tikzpagenodes}
\usepackage{everypage}
\newif\ifchapterpage
\newcommand{\mycolumnsep}{\begin{tikzpicture}[overlay, remember picture]
%\useasboundingbox;
\ifchapterpage
%\message{page \thepage\space is a chapter page}
\fill[blue] (current page text area.center) circle (.1cm);
\draw[blue] (current page text area.center) ++(90:.75) to ++(90:2);
\draw[blue] (current page text area.center) ++(-90:.75) to ++(-90:6);
\global\chapterpagefalse
\else
%\message{page \thepage\space is not a chapter page}
\fill[blue] (current page text area.center) circle (.1cm);
\draw[blue] (current page text area.center) ++(90:.75) to ++(90:6);
\draw[blue] (current page text area.center) ++(-90:.75) to ++(-90:6);
\fi
\end{tikzpicture}}%\mydrawcolumnseprule}
\AddEverypageHook{\mycolumnsep}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\rightmark}
\fancyhead[C]{\thepage}
\fancyhead[R]{\chaptername}
\fancyfoot{}
\usepackage{titlesec}
\titleformat{\chapter}% command
[block]% shape
{\centering\itshape\huge}% format
{}% label
{0cm}% sep
{{\normalsize The tale of\\}}% before-code
[\global\chapterpagetrue\vspace{1cm}]% after-code
\titlespacing{\chapter}% command
{0pt}% left margin
{0pt}% Vertical space before title
{1cm}% Vertical space between title and text
\usepackage{lipsum}
\chapterpagetrue
\begin{document}
\chapter*{Rhotingger}
\lipsum[1-10]
\chapter*{Blauinger}
\lipsum[11-20]
\end{document}