I am trying to embed images into Anki flashcards using \includegraphics.
A similar question was asked (and answered) some years ago - unfortunately the solution given there does not seem to work anymore. A related more recent (unresolved) question is this one, which however relates to .eps files only and runs up against a different type of error .
The following minimal example describes my problem.
Header:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{/home/user/Downloads/}}
\begin{document}
Footer:
\end{document}
Card Front: Most magnificent animal
Card Back:
[latex]
\begin{center}
\includegraphics{duck.jpg} \\\relax
\end{center}
[/latex]
(image source)
Error:
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./tmp.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/dvips.def)))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./tmp.aux)
! LaTeX Error: Cannot determine size of graphic in /home/user/Downloads/duc
k.jpg (no BoundingBox).
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.9 \begin{center}\includegraphics{duck.jpg}
\\\relax \end{center}
</home/user/Downloads/duck.jpg> [1] (./tmp.aux) )
(see the transcript file for additional information)
Output written on tmp.dvi (1 page, 364 bytes).
Transcript written on tmp.log.
So the relevant bit here seems to be Cannot determine size of graphic in /home/user/Downloads/duck.jpg (no BoundingBox) which does not seem to be too uncommon of an error. Unfortunately though, the solutions provided here, such as specifying natwidth and natheight do not seem to help with the matter. Notably, replacing duck.jpg with example-image-a yields a correctly compiling card.
Am I overlooking something obvious? Is it currently possible to use graphicx together with Anki?