Question

I am trying to create an Anki deck with, for example, a word on the front. Then I add the word with definitions on the back with a picture as well. But I am having trouble including graphics when there are already two fields (front text and back text). Here is an example note:

\begin{note}
\begin{field}
\textbf{\large ruminate}
\end{field}
\begin{field}
\textbf{\large ruminate}
\begin{description}
\item[verb] \hfill \\ 
chew the cuds

\item[verb] \hfill \\ 
reflect deeply on a subject

\end{description}
\end{field}
\end{note}

This note works just dandy, but when I try to include a graphic (as follows) Anki will not let me have two fields on the back.

\begin{note}
\begin{field}
\textbf{\large ruminate}
\end{field}
\begin{field}
\textbf{\large ruminate}
\begin{description}
\item[verb] \hfill \\ 
chew the cuds

\item[verb] \hfill \\ 
reflect deeply on a subject

\end{description}
\end{field}

\xplain(<img src="files/image.jpg" />)

\end{note}

I tried to use \includegraphics (Anki prohibits this, but I changed the source and got the package to work) but then on compiling the image could not be found.

Was it helpful?

Solution

Ok, so what did the trick was learning first to change the Anki card template.

Front Template

{{Word}}

Back Template

<img src="{{Picture}}" width="250" /><br>
{{Definition}}

<hr id=answer>

Then, I had to just put the filename inside \xplain{} (making sure to include the graphic in my user's media folder). Then the note would look like this.

\begin{note}
\begin{field}
\textbf{\large ruminate}
\end{field}
\begin{field}
\textbf{\large ruminate}
\begin{description}
\item[verb] \hfill \\ 
chew the cuds

\item[verb] \hfill \\ 
reflect deeply on a subject

\end{description}
\end{field}

\xplain(<img src="image.jpg" />)

\end{note}

OTHER TIPS

It seems that you are overusing Anki's LaTeX capabilities where it is unnecessary. Anki allows for great editing, formatting, coloring, etc. of cards.

It also allows you to just drag and drop images into any text field; in which case Anki will save, and sync it for you automatically. Instead of using Latex for the whole card, you should just create the card in the standard Anki way and only use Latex for formulae, etc.

Here's an example of how a typical language note and one of its cards would look like, no Latex used at all:

-- can't post images in this corner of stackexchange yet, as for low reputation -- http://i.stack.imgur.com/jDNEl.png

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top