Anki Forums

Latex Rendering Error Only for Some Note Types

For some of my note types, Latex seems to work fine.
E.g.,

[latex][
a^2 + b^9 = c^2
][/latex]

in a field renders as

Screen Shot 2021-03-03 at 6.21.49 am

Great!

For other of my note types, the same or similar input in a field gives this error:

Error executing ⁨latex⁩.
Generated file: ⁨/var/folders/pp/0qxsh_fn6fx5lvd8hhp3d7xc0000gn/T/anki_temp/tmp.tex⁩
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./tmp.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))

! LaTeX Error: File `myAnkiAll.sty' not found.

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

Enter file name: 
! Emergency stop.
<read *> 
         
l.5 \pagestyle
              {empty}^^M
No pages of output.
Transcript written on tmp.log.

myAnkiAll.sty is an old file from an old computer (which got destroyed in a house fire). The new computer was not a reinstall from a time machine backup (backup hard drive also lost in fire), it is a fresh install of everything. I can’t work out why Anki is trying to use this old style file? And why for only some note types? I’m not using any addons.

The Latex preamble, etc., in Options is unchanged from the default, i.e.:

\documentclass[12pt]{article}

\special{papersize=3in,5in}

\usepackage{amssymb,amsmath}

\pagestyle{empty}

\setlength{\parindent}{0in}

\begin{document}

and

\end{document}

Each note type has its own latex header/footer - my guess is you were looking at a different note type.