A Tufte-like Book with Quarto

Author

Warrick Ball

Published

May 12, 2023

Preface

Quarto is powerful tool to render textbook-like content simultaneously in HTML and PDF. I don’t want to compromise on being able to produce a Tufte-like PDF and this project aims to do that with minimal changes to the default Quarto book templates. This is the third attempt at getting the PDF to work.

First, I tried the Tufte-Quarto template by Fred Guth but that was ultimately more customised than I needed, at the apparent cost of introducing some issues.

Second, I tried removing environments defined in LaTeX macros in tufte-common.def that clashed with Quarto’s own constructs (e.g. marginnote). I also removed the redefinition of the standard LaTeX environments that caused incomprehensible failures to compile. In this case, I also had to use the symmetric option, without which Quarto’s marginalia go off the left-hand side of pages that would be on the left-hand side of a printed book.

Here (i.e., the third attempt), I use Quarto to render to LaTeX, then remove some stuff (really just using sed to comment out some lines) in the LaTeX preamble that appear to prevent the LaTeX from compiling. This preserves more of the Tufte-LaTeX template behaviour, though some (e.g. section numbering) is probably still being overwritten by Quarto defaults.

The PDF corresponding to this HTML is available here.

The main resources used for this project are

Just to make sure there’s a reference somewhere, see Knuth () for additional discussion of literate programming.

Knuth, Donald E. 1984. “Literate Programming.” Comput. J. 27 (2): 97–111. https://doi.org/10.1093/comjnl/27.2.97.

The remainder of the book demonstrates some features from the Tufte style and the potential of Quarto.

  • Chapter 1 demonstrates some features from Tufte style as presented in his books and checks that they work as expected.
  • Chapter 2 demonstrates some interesting things that are possible with Quarto generally and not specific to the Tufte-like style.