Graffiti

Concrete Mathematics, by Graham, Knuth, and Patashnik, has this fun feature which they call graffiti. It’s basically margin notes the authors added themselves–sometimes helpful remarks, other times jokes or humorous self-deprecation.

I got the idea to add the feature to this website, and I could use it for any explainer/blogs I write. How hard could it be? Not that hard, unless you happen to have no idea what you’re doing programming Liquid HTML. Anyways, I’ve managed to do it, what’s more it’s all in Jekyll in a way that is compatible with GitHub pages, and has minimal Javascript. Here’s an excerpt from Concrete Mathematics that I can now quote, including the graffito:

The mean of a random variable turns out to be more meaningful in applications other than the other kinds of averages, so we shall largely forget about medians and modes from now on. We will use the terms “expected value,” “mean,” and “average” almost interchangably in the rest of this chapter. [page 386]

In the markdown file that I am typing in, all I have to do use “(carrot)[”, type my graffito, and close with “]”. Then, the graffito renders, as you can see to the side. It automatically appears in the left column, vertically aligned with the location where I typed it in the main text.

Graffiti even works with equations.

I get it: On average, “average” means “mean.”
This is an example graffito.
$E=mc^2$