Good morning.
I try to apply advice given on this page to be able to include drawings in Latex with Anki. But, for a reason of which I am unaware, Anki does not want to convert files.tex into.png.
It is possible to have a little of assistant ? Thank you
Hardware : Mac book pro os : El capitain
Anki error :
An error occurred. It may have been caused by a harmless bug,
or your deck may have a problem.
To confirm it's not a problem with your deck, please run Tools > Check Database.
If that doesn't fix the problem, please copy the following
into a bug report:
Traceback (most recent call last):
File "aqt/editor.pyc", line 434, in onCardLayout
File "aqt/clayout.pyc", line 48, in __init__
File "aqt/clayout.pyc", line 60, in redraw
File "aqt/clayout.pyc", line 186, in selectCard
File "aqt/clayout.pyc", line 199, in onCardSelected
File "aqt/clayout.pyc", line 234, in renderPreview
File "anki/cards.pyc", line 120, in q
File "anki/cards.pyc", line 137, in _getQA
File "anki/collection.pyc", line 529, in _renderQA
File "anki/hooks.pyc", line 32, in runFilter
File "anki/latex.pyc", line 41, in mungeQA
File "anki/latex.pyc", line 61, in _imgLink
File "anki/latex.pyc", line 107, in _buildImg
File "shutil.pyc", line 82, in copyfile
IOError: [Errno 2] No such file or directory: u'/var/folders/v1/psh6j3c139x1wkj2k38_77v40000gn/T/anki_temp/tmp.png'
Add-ons Anki "Edit_Latex_build_process.py
# -*- coding: utf-8 -*-
# Edit LaTeX generation procedure
# Soren I. Bjornstad <soren.bjornstad@gmail.com>
# add-on Version 2, for Anki 2.0.27+
# I do not think this add-on is really eligible for copyright protection, since
# it simply overwrites a variable in Anki's code, but in case it is, you are
# free to do anything you want with it without needing to ask for permission.
# ========== INSTRUCTIONS ==========
# This add-on does not change anything until you edit it.
#
# Between the square brackets at the far left, you may insert any number of
# lines, each of which specifies a command to be run on your system. When Anki
# goes to generate LaTeX images, it will run each command in sequence. At the
# end of each line, after the closing square bracket, there should be a comma,
# except on the final command.
#
# Each command must be enclosed in square brackets and may contain any number
# of quoted, comma-separated arguments, the first being the command to run and
# the remainder being command-line arguments.
#
# Please see the default command set for an example. If you are having trouble
# configuring this add-on, you may ask on the add-ons forum.
#
# NOTE: If you are using this add-on on Windows, you must use double
# backslashes (\\) in any paths you include: "C:\\Windows", not "C:\Windows".
# ==================================
#newLaTeX = \
#[
# ["latex", "-interaction=nonstopmode", "tmp.tex"],
# ["dvipng", "-D", "200", "-T", "tight", "tmp.dvi", "-o", "tmp.png"]
#]
# TikZ compliant setting
newLaTeX = \
[
["pdflatex", "-interaction=nonstopmode", "--shell-escape", "tmp.tex"]
]
# make the changes
import anki.latex
anki.latex.latexCmds = newLaTeX
Latex code :
\providecommand{\pgfsyspdfmark}[3]{}
\documentclass[convert={convertexe={convert}},border=2]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsmath, amsfonts, mathrsfs}
\usepackage[paperwidth=5in, paperheight=100in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage{pgf, tikz}
\usepackage{xcolor}
\pagestyle{empty}
\setlength{\parindent}{0in}
\begin{document}
\ce{{{c1::H3O}}+}
\begin{tikzpicture}
\draw (0, 0) -- (4, 0) -- (4, 4) -- (0, 4) -- (0, 0);
\end{tikzpicture}
\end{document}






geometrypackage. It doesn't make sense with thestandaloneclass, but influences the output. With this line, the page is empty, without it I get the stringc1::H30^+followed by a square, which one would expect from the code. Btw, what is the expected output? – gernot Oct 08 '16 at 08:08\ce{{{c1::H3O}}+}? It doesn't look like themhchempackage is able to handle it, in contrast to\ce{H3O+}. – gernot Oct 08 '16 at 08:22