I'm trying to have the sidenote (or margin) area of the tufte-book
document class have some background colour. Ideally it would cover the whole page, but only those where it is relevant.
I have tried several solutions including: How to set colored ruled margins for different pages? and How to set a certain color (other than white) to margin areas? however none of them really work.
I get background colours, but at random places, and it does not really account for which pages have sidenote areas or not (granted I could do it by hand in the worst case, but I'm not even there).
For instance once thing I try it that:
% !TEX program = xelatex
\documentclass{tufte-book}
\renewcommand\allcapsspacing[1]{{\addfontfeature{LetterSpace=15}#1}}
\renewcommand\smallcapsspacing[1]{{\addfontfeature{LetterSpace=10}#1}}
\usepackage{geometry}
\usepackage{eso-pic,xcolor,lipsum}
\pagecolor{red}
\AddToShipoutPictureBG{%
\AtTextLowerLeft{\color{white}%
\rule[-\footskip]{\textwidth}{\dimexpr\textheight+\footskip}}}
\title{Book title that is long}
\author{Some Auhor}
\begin{document}
\maketitle
Test with some notes\sidenote{Test}.
\lipsum
\end{document}
But the background is not limited to the sidenote area.
I would be after something like this: https://www.principiae.be/book/pdfs/TM&Th-samplepages.pdf.
Is there no hope but to find by hand the right dimensions?
tufte-book
is notoriously hard to modify, take a look at kaobook instead...