我不希望任何空白页上有分隔规则!我正在使用标准book
类。
\documentclass[twocolumn]{book}
\setlength{\columnseprule}{1pt}
\usepackage{lipsum}
\title{My Title}
\begin{document}
\maketitle
\tableofcontents
\chapter{ }
\lipsum[1]
\chapter{ }
\lipsum[1]
\end{document}
答案1
您需要重新定义\cleardoublepage
以实现这一点:
\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
更新后的 MWE 将是:
\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
我不知道这是否是最好的方法,但你可以使用和修补命令,在相关页面上将\chapter
规则的宽度设置为。例如,0pt
nextpage
etoolbox
\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}