From adf4f4687c967c9acd3e1eaaada7553e24c58053 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 18 Jul 2013 19:04:38 +0900 Subject: [PATCH] allow includegraphics in latex --- anki/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/latex.py b/anki/latex.py index 062adfcb1..97b1ae496 100644 --- a/anki/latex.py +++ b/anki/latex.py @@ -72,9 +72,10 @@ def _buildImg(col, latex, fname, model): model["latexPost"]) latex = latex.encode("utf8") # it's only really secure if run in a jail, but these are the most common + tmplatex = latex.replace("\\includegraphics", "") for bad in ("write18", "\\readline", "\\input", "\\include", "\\catcode", "\\openout", "\\write", "\\loop", "\\def", "\\shipout"): - if bad in latex: + if bad in tmplatex: return _("""\ For security reasons, '%s' is not allowed on cards. You can still use \ it by placing the command in a different package, and importing that \