5801d5373b32 — Arne Babenhauserheide 6 years ago
only nag before one in 3 chapters, selected at random

Nagging before each chapter seriously impedes on the reading experience.
1 files changed, 4 insertions(+), 2 deletions(-)

M py2guile.org
M py2guile.org +4 -2
@@ 183,8 183,10 @@ This book is licensed as [[http://copyle
 # This is the [[https://freenetproject.org][Freenet]] exclusive ebook. If you got it via other channels, please install [[https://freenetproject.org][Freenet]] and share it there! \\ https://freenetproject.org \\ when free speech dies we need a place to organise!
 
 This is the free preview-version. If you enjoy this book, please consider buying py2guile from [[http://draketo.de/py2guile][draketo.de/py2guile]] as ebook or in print (ISBN: 9783737568401).
-# For the free preview, add a nagware page before each chapter.
-#+LATEX_HEADER: \makechapterstyle{nag}{\renewcommand*{\chapterheadstart}{\vspace*{-2cm}\makebox[\linewidth]{\href{http://draketo.de/py2guile}{\color{black}{\includegraphics[width=1.3\linewidth]{nagware.pdf}}}}\newpage\phantom{ghost}\newpage\phantom{ghost}}}\chapterstyle{nag}
+# For the free preview, add a nagware page before randomly chosen chapters.
+#+LATEX_HEADER: \usepackage{ifthen}
+#+LATEX_HEADER: \usepackage[first=1, last=4, seed=13]{lcg}
+#+LATEX_HEADER: \makechapterstyle{nag}{\renewcommand*{\chapterheadstart}{\rand\ifthenelse{\equal{\arabic{rand}}{1}}{\vspace*{-2cm}\makebox[\linewidth]{\href{http://draketo.de/py2guile}{\color{black}{\includegraphics[width=1.3\linewidth]{nagware.pdf}}}}\newpage\phantom{ghost}\newpage\phantom{ghost}}{\phantom{ghost}}}}\chapterstyle{nag}
 
 # This is the paid digital version -- that’s awesome! Thank you for buying py2guile and supporting Free Culture!