2

I don't want the separation rule on any blank pages! I'm using the standard book class.

\documentclass[twocolumn]{book}
\setlength{\columnseprule}{1pt}
\usepackage{lipsum}
\title{My Title}
\begin{document}
\maketitle
\tableofcontents
\chapter{ }
\lipsum[1]
\chapter{ }
\lipsum[1]
\end{document}
2

You need to redefine \cleardoublepage to make this happen:

\makeatletter
\def\cleardoublepage{%
    \clearpage\if@twoside \ifodd\c@page\else%
     \setlength{\columnseprule}{0pt}\hbox{}\newpage\setlength{\columnseprule}{1pt}%
     \if@twocolumn\setlength{\columnseprule}{0pt}\hbox{}\newpage\setlength{\columnseprule}{1pt}\fi%
    \fi\fi%
}
\makeatother

And your updated MWE will be:

\documentclass[twocolumn]{book}
\setlength{\columnseprule}{1pt}

\makeatletter
\def\cleardoublepage{%
    \clearpage\if@twoside \ifodd\c@page\else%
     \setlength{\columnseprule}{0pt}\hbox{}\newpage\setlength{\columnseprule}{1pt}%
     \if@twocolumn\setlength{\columnseprule}{0pt}\hbox{}\newpage\setlength{\columnseprule}{1pt}\fi%
    \fi\fi%
}
\makeatother

\usepackage{lipsum}
\title{My Title}
\begin{document}
\maketitle
\tableofcontents
\chapter{ }
\lipsum[1-30]
\chapter{ }
\lipsum[1-23]
\chapter{ }
\lipsum[1]
\chapter{ }
\lipsum[1]

\end{document}
2
  • @cfr: I have updated the MWE now with chapter ends in both odd and even pages. There is no problem. Please let me know if I am wrong. – Jagath Aug 4 '16 at 2:23
  • so well explained that I added a question and answer including no footer/header here:tex.stackexchange.com/questions/323283/… – Vitor Abella Aug 4 '16 at 2:38
2

I don't know if this is the best way, but you can patch the \chapter command to set the width of the rule to 0pt on the relevant pages using nextpage and etoolbox. For example,

\documentclass[twocolumn]{book}
\usepackage{etoolbox,nextpage}
\setlength{\columnseprule}{1pt}
\patchcmd\chapter{\cleardoublepage}{\clearpage\cleartooddpage[\setlength\columnseprule{0pt}]\setlength\columnseprule{1pt}}{\typeout{Patched chapter successfully!}}{\typeout{Oh, no! Patch for chapter failed horribly!!}}
\usepackage{lipsum}
\title{My Title}
\begin{document}
\maketitle
\tableofcontents
\chapter{ }
\lipsum[1]
\chapter{ }
\lipsum[1-15]
\end{document}

intermittent rule appearance

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.