0
votes

I'm trying to enable LaTeX for Anki flashcards. I have MikTex installed and, upon attempting to view cards with LaTex formatting, I get the following error:

Définissez Problème à l’exécution de latex. Fichier généré : C:\Users\user\AppData\Local\Temp\anki_temp\tmp.tex

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6800 64-bit)
entering extended mode
(tmp.tex
LaTeX2e <2018-04-01> patch level 5
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\inputenc.sty"

! LaTeX Error: File `utf8x.def' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: def)

Enter file name: 
! Emergency stop.
<read *> 

l.165 \endinput


No pages of output.

I've already disabled automatic package installation/prompting of the user to install unknown packages in MikTex, to no avail.

What can I do to fix this so that Anki displays LaTeX cards?

2

2 Answers

1
votes

I was experiencing similar problems and none of the in-depth ansers seemed to help me , but I just stumbled upon a solution that works for me.

As long as I only use \( to begin LaTeX Code and \) to end it, everything works well on my two Windows computers, as well as my Android device.

example: \(\sum_{k = 1}^{\infty}\frac{1}{k}\)

instead of \begin{math}\sum_{k = 1}^{\infty}\frac{1}{k}\end{math}

Hope this helps other noobs as well.

0
votes

Fixed the problem by following the tutorial at http://www.eighthourlunch.com/content/anki-setting-latex-windows-7

One issue which was unclear in the tutorial was installation of the xml/sgml typesetting package. It is called passivetex and can be viewed at https://miktex.org/packages/passivetex

Use the filter menu in the packages tab of the miktex console to explicitly search for passivetex . Once installed, I updated the file name database (Tasks -> Update filename database) and Anki started working correctly.