Problems setting up latex

I’ve tried several times to set up Anki with MiKTeX. Each time, I followed the common advice: to select “no” instead of “install missing packages on the fly” and update MiK manually. This, however, has not worked.

This is the error notification:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.10)
entering extended mode
LaTeX2e <2020-10-01> patch level 1
L3 programming layer <2020-10-05> xparse <2020-03-03>
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
For additional information on amsmath, use the `?’ option.
! Undefined control sequence.

l.5 \pagestyle{fancy}

No file tmp.aux.
! Missing inserted. <inserted text>
l.9 s_
! Missing inserted. <inserted text>
l.10 \end{document}

[1] (tmp.aux) )
(see the transcript file for additional information)
Output written on tmp.dvi (1 page, 320 bytes).
Transcript written on tmp.log.

It seems to me that LaTeX is installed and working well, and telling you that there is an error in your input. More specifically, it is complaining about an Undefined control sequence, aka an unknown command

Try some very basic commands to see if it is really a latex problem or just if it’s your input which is faulty.

Thanks for the answer.

Following your advice, i put:

[latex]1 + 2 = 3[/latex]

into the flashcard. It still doesn’t work. I’ll include the present error notice just to be sure.

Try using the [$]...[/$] and [$$]...[/$$] shortened notation instead. I don’t think your example will work as it is.


I think what you really want is more like

On the other hand, in the first example you gave the problem reported by latex makes me think that you didn’t import the fancyhdr package. Try adding \usepackage{fancyhdr} in the header section of the LaTeX configuration in the note options. If it works, then I think it means that you are actually compiling with TeX and not LaTeX, as the said package is already included in the latter but not the former.