Anki + Latex not working : I have installed BasicTex + dvipng

I'm trying to get Anki to work with Latex. Currently, when I open a flashcard with latex on it I get: Generated file: /var/folders/41/v5plvhx12wg0qlrj9h_l0g680000gn/T/anki_temp/tmp.tex Have you installed latex and dvipng?

However, I have already installed BasicTex + dvipng. In fact, when I run which latex and which dvipng on terminal I get: /Library/TeX/texbin/latex and /Library/TeX/texbin/dvipng.

So I need some help. Would anyone know how to make Anki work with Latex? Thanks for your help!


I found the answer here Anki+Latex.

Basically you have to download this Anki add-on, which allows you to edit the path Anki uses to find latex and dvipng. Then you use which latex and which dvipng (on Mac terminal) to get the full path to each of them, and then you use the add-on to modify Anki's path.


Updated for 2020: You can find LaTeX installation instructions in the Anki User Manual here.

To install LaTeX, on Windows use MiKTeX; on OSX use MacTex, and on Linux use your distro’s package manager. Dvipng must also be installed.

For example, on Mac you can run brew install --cask mactex and that should be all you need to get it working with Anki. I had the same error as you, and this process fixed it for me.

You can then use Anki's Tools > Check Media... to generate all LaTeX images and sync them to AnkiWeb in order to use them on mobile devices.