Editing Anki Cards with Org Mode

I have a post in the queue that discusses spaced repetition and how to use Anki to realize it. Emacs, of course, has org-drill, which by all reports is an excellent implementation of spaced repetition but suffers from not being portable to smart phones and iPads. Still, who wants to have to use Anki’s editor for making cards when we Emacsers hate to do any text editing outside of our favorite editor.

Fortunately, Emacs has us covered as usual. There’s a package called anki-editor that lets us compose Anki flash cards in Org mode and import then into Anki. I’ve written about this before but Rohit Goswami has a recent post that considers using anki-editor with Doom.

Using Anki with anki-editor seems to me to be the best of two worlds. On the one hand, creating Anki cards can be accomplished in Emacs, which we consider the ideal—or, perhaps, the only acceptable—environment for performing text editing tasks. On the other hand, Anki is portable to and syncs between our laptops and our mobile devices. Most of us—modulo the pandemic—spend a lot of time traveling on buses, trains, or taxis or standing in line somewhere like the DMV, the bank, or the grocery store. That’s the perfect time to pull up your Anki deck and do a little spaced repetition.

The question remains as to why you should bother. I’ll cover that in my upcoming post on Anki and augmenting your long-term memory.

Posted in General | Tagged , | Leave a comment

Using Emacs & Org in College (Programming) Assignments

If you’re an experienced Emacser, the idea of using Emacs everywhere—including for school assignments—is second nature. Of course, not everyone is an experienced user. Some, like Seshal Jain, discover Emacs in the course of their studies and evolve their workflows as they go along. Jain has a useful post on how he does his programming lab assignments with Emacs and Org-mode.

He starts with explaining his pre-Emacs workflow:

  1. Write the code and explanation for the assignment.
  2. Run the program in a terminal and take a screen shot of the results.
  3. Paste the screen shot into some sort of word processor.
  4. Send the resulting PDF to the professor.

Org-mode/Babel combines all this into a single file and the whole process is run right from Emacs. This type of application is ideal for a Literate Programming approach and Org allows you to insert the results right in document and then export the file to a PDF.

Jain also shows how to add syntax highlighting to the PDF using minted and the Python Pygments package. If you’re new to Emacs and have to write up programming lab results, you should take a look at Jain’s post. It’s pretty much a step-by-step guide to setting up an Org environment that makes writing your reports as frictionless as possible.

Posted in General, Programming | Tagged , | Leave a comment

The New Luddites at Their Most Malignant

I didn’t have a topic in mind for today’s post so I looked through my list of potential blog topics. It turns out that there were lots of pending topics but seeing this Substack article from last October rekindled the anger I felt the first time I read it. Or perhaps disgust is a better word.

The gist of the article is that colonizing space is a fantasy whose real purpose is to maintain the status quo. Notice how it combines the usual New Luddite dislike of any technical progress and the infantile politics usually found in the more unhinged corners of Twitter. Oren Weisfeld says that space is not just a bad idea or waste of resources but that “It’s dangerous to think humans have a destiny outside Earth.”

The truth, of course, is just the opposite. That for humanity to survive, we must get off the earth has been said so often that it’s become trite but it’s still true. Most people, Weisfeld admits, agree with this and support the space program. But, of course, to the New Luddites these people are deluded and don’t actually understand the issues. He believes that spending any resources on things that he doesn’t care about is not only a waste but immoral. Apparently the three quarters of the population that have other priorities don’t know what’s good for them and shouldn’t have a say.

Posted in General | Tagged | Leave a comment

Rmail

As you all know, I handle my email with mu4e and am very happy with it. But it’s not the only possibility. Notmuch and Gnus are popular choices but there’s also the builtin Rmail. It doesn’t get a lot of attention and many are only vaguely, if at all, aware of it.

Ben Card is an Rmail user and finds that it meets his needs well. He likes its simplicity and easy configuration. He’s got a post that describes how he uses Rmail, his configuration for it, and how to implement multiple accounts. He also has links to two videos (1, 2) where he covers the same material.

If you’re interested in finding out more about Rmail, I’d watch the to videos before reading the post. After doing all that, my conclusion is that mu4e (and probably any of the other apps) is a better solution. One of the great features of mu4e—one might even say its whole point—is its powerful search capabilities. Following Ben Maughan, I put all my saved emails in a single file and use search to find whatever I need. It’s simple and powerful and I don’t have to decide where to put each email or remember where I put it if I need to retrieve it. Rmail lets you store your emails in separate files but doesn’t—as far as I can see—have an integrated search function.

Configuring multiple accounts is fairly simple but seems a bit ad hoc. It boils down to writing functions that set Rmail’s environment for a particular account. Card shows how to do this in detail in the second video.

Still, if you’re looking for a simple, lightweight email client that runs under Emacs, it’s worth taking a look at Rmail.

Update [2021-01-23 Sat 14:47]: GNUS → Gnus

Posted in General | Tagged | Leave a comment

Org To Beamer

One of the easiest and most popular methods of making presentation slides is reveal.js, which exports your slides as HTML so that you can display them with any browser. Sometimes, though, you want to produce your slides as PDFs and for that we have Beamer, a LaTeX package (documentation). Unless you’re reasonably proficient with LaTeX, Beamer can seem a little intimidating. Fortunately, Emacs, as usual, has us covered.

You can easily produce Beamer slides directly from Org mode and Laura Viglioni has a nice post on how to do that and, specifically, how to use custom themes. Her post, Installing LaTeX themes on your machine/Emacs org-mode, is mostly about how and where to install custom Beamer themes if you’re tired of the default choices but it also shows a complete example in both Org and the finished result.

One thing I didn’t know about is kpsewhich, which can display paths and variable values. There’s a man page and some fairly detailed help if you’re not familiar with it but all you need to know for Beamer is the value of TEXMFHOME, which you can find with

kpsewhich -var-value=TEXMFHOME

In any event, if you’re interested in using Beamer without dealing with LaTeX, take a look at Viglioni’s post.

Posted in General | Tagged , | Leave a comment

A Symbolics and Space Cadet Keyboard

If you’re a certain type of geek, especially a certain type of Emacs geek, you likely share a dream with the rest of your tribe: having a Symbolics or a Space Cadet keyboard. I’ve written about that before but now there’s some more news. Paul Graham just tweeted:

When you follow the link you’ll discover that what’s being offered is a series of kits that can be programmed to be several types of keyboards including the Symbolics and Space Cadet varieties. The kits range from a set of parts that you have to solder to the PC board and otherwise assemble to a presoldered board, to a kit with most of the hard work done but that requires some assembly.

You may regard the fact that they’re offering (only) kits a plus or a minus but there’s a further downside: the kits are expensive. The most basic kit is €931 and the most fully built is €1,262. That’s a lot of money for a keyboard and is surely out of range for many of us but if you really, really want a Space Cadet keyboard it may be worth the cost both in money and the time to build it.

Posted in General | Tagged , | Leave a comment

System Crafters: Using Mu4e

David Wilson has another video up in his series on configuring and using mu4e to handle email from within Emacs. His past videos have already covered the hard parts of configuring mu4e and mbsync. The current video is about using mu4e to compose and send email.

Most of that is straightforward but Wilson also demonstrates how to attach file, save and edit a draft, and cryptographically sign one or all emails. I even learned that you can “directly” compose and send an email without going through the mu4e menu.

If you’re new to mu4e or want to see what using it looks like, Wilson’s video will give you a good overview. The video is just over 42 and a half minutes so you’ll need to set aside some time for it.

Posted in General | Tagged | Leave a comment

Knuth on Writing

Philip Kiely has an interesting interview with Don Knuth that concentrates on the writing aspects of Knuth’s career. Everyone knows about The Art of Computer Programming (AOCP) and TeX but Kiely’s interview drills down on why things are the way they are with Knuth’s writing and the original intent of TeX.

We all appreciate that AOCP is an ongoing project of long standing but it’s easy to forget what this means. That aspect was brought home to me when Kiely mentioned that Knuth started writing it before his parents were born. You gain a new appreciation for Knuth’s description of it as his “life’s work” when you realize that he’s been working on it for almost 60 years. Sixty years. That’s twice as long as many Irreal readers have been alive.

The thing that comes through in the interview is that Knuth is dedicated to bringing the same joy he finds in the material to others. He structures his prose to keep the reader turning the page. Then, of course, there’s his fanatical commitment to making his printed works look good.

Even after his first book was produced with TeX, he was despondent because he didn’t like the way he’d rendered the number ‘5’. Again, it’s easy to forget the incredible amount of work that went into making TeX not just a decent typesetter but a great typesetter.

Knuth is a treasure. Even though it’s far from certain that he will live to complete AOCP, our field—and the world at large—is better off for the work he has completed. If it weren’t for him, we’d all be writing our papers in Word and thinking it was state of the art.

Posted in General | Tagged | Leave a comment

Note Making

Anne-Laure Le Cunff over at Ness Labs has an interesting article on the difference between note taking and note making. One way of thinking of the difference is to consider note making as active note taking. Rather than simply record what you hear or read you consume the material actively by putting it in your own words and relating it to other ideas.

This distinction is important for students because there’s an impressive amount of research showing that this sort of active note making results in far better recall of the material. Ali Abdaal has a whole series of videos on the subject if you’re interested in learning more.

Note making is important to more than students. Niklas Luhmann famously used the idea for the Zettelkasten that he used to power his research career. The idea is useful for anyone learning new material or recording observations for later use. The method that Le Cunff discusses has more instantiations that just a Zettelkasten and she mentions some of them in the article.

The TL;DR of the method is

  • Put each note in your own words.
  • Link each note to other related notes.
  • Treat your notes as a living document.

That sounds a lot like a Zettelkasten but as I said, there are other ways of realizing the idea. Take a look at Le Cunff’s article for more details.

Posted in General | Tagged | Leave a comment

Yesterday’s Date

One of my daily tasks involves making a log entry in which I have to use yesterday’s date. That’s pretty easy with Org dates but the dates in the log don’t have the usual Org markup of square or angle brackets. They’re just plain dates like this: 2021-01-16. I have a function to enter dates like these bound to Ctrl+c d. For a long time, I just used this shortcut to enter today’s date and fixed it manually. That was easy enough except at a month change but was still pretty silly.

A couple of years ago, I got fed up and decided to write a function that would directly enter yesterday’s date. Getting yesterday’s date is way harder than it should be but after a bit of research, I found the secret spell and wrote the function. Recently, I’ve had a need to enter the date from two days ago. The first couple of times I just entered yesterday’s date with my function and fixed it manually but rather than go through another long period of making manual adjustments, I thought I’d just fix my function to take a numerical argument so that it could enter a day from \(n\) days ago.

Unlike the original function, the change was trivial. If you have a similar need, here’s the function:

1: (defun jcs-yesterday (days)
2:   "Insert yesterday's date."
3:   (interactive "p")
4:   (let ((ts (decode-time)))
5:     (setf (nth 3 ts) (- (nth 3 ts) (if days days 1)))
6:     (insert (format-time-string "%Y-%m-%d" (apply #'encode-time ts)))))

As an (unintended) side effect, I can even enter a negative number and get a date \(n\) days in the future. If your use case involves entering dates in the future, you can change the meaning of \(n\) so that positive arguments move forward by changing the \(-\) sign in line 5 to \(+\).

Posted in General | Tagged | Leave a comment