Tufte-LaTeX / tufte-latex

A Tufte-inspired LaTeX class for producing handouts, papers, and books
https://tufte-latex.github.io/tufte-latex/
1.69k stars 301 forks source link

\cleardoublepage inserts empty pages in oneside mode #135

Open cbettinger opened 6 years ago

cbettinger commented 6 years ago

If if understand \cleardoublepage from tufte-common.def correct, it should call \clearpage anyway and insert an empty page only if the document is in twoside mode and the next page would be an even (i.e. back) page:

\def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else
  \hbox{}
  \thispagestyle{empty}
  \newpage
  \if@twocolumn\hbox{}\newpage\fi\fi\fi}

I am not very experienced in LaTeX but to me it seems that @twoside evaluates to true, even if option oneside is set. Changing the condition to

\def\cleardoublepage{\clearpage\if*@tufte@twoside*\ifodd\c@page\else

solves this odd behaviour (add empty pages in twoside mode, no empty pages in oneside mode).

Is this some kind of misunderstanding of your intention or of proper LaTeX language or is this a bug?

svenk commented 5 years ago

I stumbled over the same problem and overwriting \cleardoublepage helped for me:

% Bugfix for accidentally doublesided cleared pages when in oneside mode.
% Helps avoid empty pages before new chapters and around the TOC
\ifthenelse{\boolean{@tufte@twoside}}%
{}{\renewcommand{\cleardoublepage}{\clearpage}}%

But see also (this Stackexchange answer)[https://tex.stackexchange.com/a/365249/49958] which proposes something similiar with generic book documentclasses/KOMA. I'm not sure if/what's the generic Latex way to define what \cleardoublepage is supposed to do (ie. how Latex knows whether it is in oneside or twoside mode. Tufte doesn't set some global indicator).