Using latex tikz package with anki version 23.12.1

Using tikz with latex (Anki 23.12.1)

I’m facing some issues with rendering latex code with anki.

Procedure and attempted remedies

I use lervag/apy to upload markdown notes to anki database and
would think that using the [latex] text [/latex] convention
would allow me to insert tikzpicture diagrams into the flash notation
with ease, however after altering the ‘basic’ note type preamble to

\usepackage{tabularx} % added line for tables
\usepackage[table]{xcolor} % added to color rows

I cannot get the latex tags to be rendered as I would like.

(1) Changing the preamble

I have tried changing the preamble to use a standalone docuemnt
without success. Following the suggestions of [user315536 on stackoverflow]
in a thread about the use of tikz in anki. The thread is windows centric which is problemic to me since I use mac, abtu eh user there did post a solution that I’ve been unable to get into something funcitonal.
I did this by creating a new note type and changing the first line to


Instead, I get this as a preview to a note I’ve created:

What are the three layers of behaviour change?

The three layers are a model where you can apply desired outcomes, set goals, or adjust the systems you are using. They form a model to understand your own behaviour with the identity behing the deepest level.

[latex] \begin{tikzpicture} % Draw the circles \draw[thick] (0,0) circle (1); \draw[thick] (0,0) circle (2); \draw[thick] (0,0) circle (3); % Add lines to labels \draw[->, thick] (0,0.2) -- (4,0.2) node[right] {Identity}; \draw[->, thick] (0,1.5) -- (4,1.5) node[right] {Processes}; \draw[->, thick] (0,2.5) -- (4,2.5) node[right] {outcomes}; \end{tikzpicture} [\latex]

I have noticed that when there are errors in the tex file the errors get thrown
into the /var/folders/g0/skv2hbbx10j7sk7_zxk8rpm40000gn/T/anki_temp, but it
isn’t clear whether anki generates these folders at random using the base /var/folders/g0/, so it can’t be use as a consistent resource to debug the process.

It would definitely seem as if there were errors in the coding above, except that
I know there isn’t because I placed it into a separate tex file and compiled it using latex and it worked fine, so the problem is in the anki parsing of the same latex code.
It’s as if it won’t compile because it dosn’t look like latex code despite it being quoted
as latex coding. Maybe the line breaks, or something else is interfering, but
if that is the case then why doesn’t the compiler return an error.

I wish that debugging were easier for anki, as I can’t seem to find consistent resources
into the process. For information sake, I’m running macOS monterey.

Any help in getting the a solution would be appreciated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.