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
(tmp.tex
LaTeX2e <2020-10-01> patch level 1
L3 programming layer <2020-10-05> xparse <2020-03-03>
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/base\size12.clo))
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/base\inputenc.sty)
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amssymb.sty
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\amsfonts.sty))
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsmath.sty
For additional information on amsmath, use the `?’ option.
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amstext.sty
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsgen.sty))
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsbsy.sty)
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsopn.sty))
! Undefined control sequence.
\undefinedpagestyle

l.5 \pagestyle{fancy}

(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-dvi
ps.def)
No file tmp.aux.
! Missing inserted. <inserted text>
l.9 s_
{n}
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsa.fd)
(C:\Users\ADMIN\AppData\Local\Programs\MiKTeX\tex/latex/amsfonts\umsb.fd)
! 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.

See https://docs.ankiweb.net/#/math?id=example

I think what you really want is more like
[latex]$1+2=3$[/latex]

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.