That's what he said.

Anki: Setting up LaTeX on Windows 7

Wed, 03/21/2012 - 17:30 -- Doug

Lately, I've been spending a lot of time studying calculus, statistics and physics. While I believe that the best way to memorize the formulas is to use them over and over again, I thought it would be nice to reinforce some of the concepts with flash cards. Anki seemed like a perfect fit.

Anki is a free and extremely powerful flash card tool that I've found invaluable for memorizing tons of facts in a way that sticks. I've used it to learn about cognitive biases, the periodic table, and have added around 3500 words to my French vocabulary—all in my spare time, and in less than a year.

The problem is, there didn't seem to be an easy way to write equations in a way that was memorable. I mean you could write s=vot+1/2at^2, but that's a lot harder to read and conceptualize than:

\bg_black \fn_jvn s=v_{0}t+\frac{1}{2}at^{2}

If you want to get if you want your written equations to look like the latter example, you're going to need to use a markup language called LaTeX. Fortunately, there are free, easy-to-use wysiwyg editors like this one online that will save you from having to learn the language right away. They'll take your equation and turn it into something like this: s=v_{0}t+\frac{1}{2}at^{2}. This is what you'll eventually paste into your flash cards, but you'll need to do some setup work before it will work.

Anki doesn't have the built in ability to interpret LaTeX, so you'll need to install MiKTeX 2.9 (free). The install is pretty straight forward, but you could get lost, because it doesn't give you anything in the start menu. I used the 64-bit version, so the install files landed here: C:\Program Files\MiKTeX 2.9\miktex\bin\x64. In that directory, you should see a file named mo_admin.exe. Right-click on it and choose Run as adminstrator. The options window should appear. I don't know if all the steps below are strictly necessary, but here's how I got it to work:

  • On the Packages tab, check SGML/XML/HTML. Leave the others on their defaults.
  • On the On the General tab, press Refresh FNDB and Update Formats.
  • Further down on General, set Install missing packages on-the-fly to No.
  • Press OK.

Now, open your flash card deck in Anki and press the Browse Items button.

Now, in a new or existing card, click in the Front or Back window and press the Latex equation button.

You should see something like this: [$][/$]. Paste your equation in the middle like this [$]s=v_{0}t+\frac{1}{2}at^{2}[/$] and save. That should do it! From what little I've read, I think Anki creates an image from this code, so if you want it to have this content show up on your phone and other computers, you'll need to make sure you save your media files to Dropbox or some other cloud storage service. Happy memorizing!