R: Set Font Based on Output Device

Ever had a troublesome font in R that doesn't want to render to ggplot in RStudio, but will render just fine in knitr? Do you use extrafont but sometimes it just doesn't work? Trying to look like Tufte's Visual Display of Quantitative Information but ETBembo is being uncooperative? Try setting your font (globally) to this.

myfont <- ifelse(is.null(knitr::opts_knit$get("rmarkdown.pandoc.to")), "serif", "ETBembo")

This sets myfont to serif if the code is being rendered in anything but knitr. If it is being rendered by knitr, say, by pressing the "Knit" button in RStudio, then it sets it to ETBembo.

I found it on StackOverflow.

Warren Ellis on How to See the Future

Let me try this on you:

The Olympus Mons mountain on Mars is so tall and yet so gently sloped that, were you suited and supplied correctly, ascending it would allow you to walk most of the way to space. Mars has a big, puffy atmosphere, taller than ours, but there’s barely anything to it at that level. 30 Pascals of pressure, which is what we get in an industrial vacuum furnace here on Earth. You may as well be in space. Imagine that. Imagine a world where you could quite literally walk to space.

That’s actually got a bit more going for it, as an idea, than exotic red deserts and canals. Imagine living in a Martian culture for a moment, where this thing is a presence in the existence of an entire sentient species. A mountain that you cannot see the top of, because it’s a small world and the summit wraps behind the horizon. Imagine settlements creeping up the side of Olympus Mons. Imagine battles fought over sections of slope. Generations upon generations of explorers dying further and further up its height, technologies iterated and expended upon being able to walk to within leaping distance of orbital space. Manufactured normalcy would suggest that, if we were the Martians, we would find this completely dull within ten years and bitch about not being able to simply fart our way into space.

Now imagine a world where space travel to other worlds is an antique curiosity. Imagine reading the words “vintage space.” Can you even consider being part of a culture that could go to space and then stopped?

If the future is dead, then today we must summon it and learn how to see it properly.

This is very, very good.

Minimalist Stuff Mantra

When I find myself wanting something, or holding something, or wanting to get rid of something, this helps.

  1. Do I love it?
  2. Do I use it?
  3. Does it work?
  4. If I were to buy the item right now how much would I pay for it?
  5. If I sold it now how much would I get for it?

(Source. Not sure where that came from, though.)

Jordan T. Thevenow-Harrison
Books in Brief: The Oresteian Trilogy

The Oresteian Trilogy is the foundation of tragedy. You need to read it just like you need to read The Odyssey. This was my first time through even though I was familiar with the tropes and scenes through references from other works. The plays are a lot of things, but at its root it's a metaphor for the ascension of society's motivation for good from fear of reprisal as embodied in the Furies, to duty (and fear of its retribution) as embodied by Apollo, to a kind of holy rationality, as embodied by Athene and her counsel. It is ultimately a Whiggish work, convinced society moves ever forward in progress towards harmony.

The one thing that shook me as a modern reader coming to the book in 2017, and a reader who knows the connotations of "maleness" and masculinity in ancient Greek and Roman writing, was that in the climactic scene of The Eumenides, Athene says she sides with Orestes, saying that killing a man as his mother killed his father is a worse crime than killing a woman, as Orestes killed his mother, because of "male supremacy in all things". It's kind of a shit explanation, especially coming from a woman written by a man.

Anyway, read the book. It's embedded in many works of tragedy and worth knowing how the building was built these 2400 years later.

Jordan T. Thevenow-Harrison
Books in Brief: The Lichtenberg Figures by Ben Lerner

The stars will be adjusted for inflation
so that the dead can continue living
in the manner to which they've grown accustomed.

p. 18

Perhaps what remains of innovation
is a conservatism at peace with contradiction.

as the sky transgresses its frame
but obeys the museum.

p. 22

Ben Lerner's The Lichtenberg Figures is a bit of a tough book of poetry. It's a sonnet sequence ostensibly about growing up in the midwest, but it's frustrated, as many of us were in the early 2000s, with the way the world seemed to work. Reading it now made me almost nostalgic for a kind of frustration that now seems so okay, so naïve, so less harmful to the fundaments of society, rather than to the bodies of people across the world. It's not funny in the way Patricia Lockwood can be, nor is it particularly melancholy. It's more abstract than that, more systematic. I enjoyed it, and I'll need to come back to it and his newer The Hatred of Poetry.

Jordan T. Thevenow-Harrison
Make Marked.App Work with Pandoc and TufteCSS

Update! The next version of Marked.app will replace the old Antique theme with Tufte styling in the next update!

Here's how to get Marked.app to do all the Pandoc pre-processing for you when previewing documents. It also explains how to use tufte.css as a theme in Marked, which I find to be very pretty.

This comes in really handy when you want to see what your document will look like, references and all.

Things you'll need:

First, install the ET-Book fonts locally. They're very pretty.

  1. Unzip the ET-book zip file
  2. Go into each subfolder
  3. Double click on each .ttf font and install using Font Book.

Configure Marked to work use Pandoc as the markdown processor.

  1. Open Marked.app
  2. Open Preferences (Marked.app → Preferences)
  3. Click Advanced
  4. In the "Path" field, add /usr/local/bin/pandoc
  5. In the "Args" field, add -f markdown -t html5 -s -S --normalize --bibliography /users/username/dropbox/refs/bibliography.bib --csl /Users/username/src/Pandoc/apa.csl Replace these with your BibTeX bibliography and whatever CSL you prefer.

Next, let Marked.app know about tufte.css.

  1. Open Marked.app's preferences
  2. Click "Style"
  3. Under "Custom Styles" click "Custom CSS Example"
  4. Click the "Reveal" button
  5. In a new Finder window, unzip the tufte-css zip file and open that folder.
  6. Delete index.html, LICENSE, README.md, and the img folder.
  7. Copy the remaining files to the folder Marked.app opened when you revealed the location of the "Custom CSS Example."
  8. In Marked.app's preferences, click the "+" button and drag the tufte.css file into that dialog box so you don't have to find it manually.
  9. Change your "Default style" to tufte.css.

Now when you drag a markdown document onto Marked.app for it to watch, it'll reference your bibliography, apply the CSL, and compile the document with Pandoc, and refresh every time you save.

Potential issues

Make sure the green dot in the lower right-hand corner is on. This indicates Marked.app is using Pandoc.

If the text column is too thin, resize the window. The tufte.css theme likes it a little smaller. I'm sure there's some way to turn off it's dynamic resizing in CSS, but I haven't messed with it.

Please let me know if I left anything out or if this didn't work for you.

Jordan T. Thevenow-Harrison