anki.latex#

Attributes#

Classes#

Functions#

on_card_did_render(→ None)

render_latex(→ str)

Convert embedded latex tags in text to image links.

render_latex_returning_errors(→ tuple[str, list[str]])

Returns (text, errors).

setup_hook(→ None)

Module Contents#

anki.latex.pngCommands = [['latex', '-interaction=nonstopmode', 'tmp.tex'], ['dvipng', '-bg', 'Transparent', '-D', '200',...#
anki.latex.svgCommands = [['latex', '-interaction=nonstopmode', 'tmp.tex'], ['dvisvgm', '--no-fonts', '--exact', '-Z',...#
class anki.latex.ExtractedLatex#
filename: str#
latex_body: str#
class anki.latex.ExtractedLatexOutput#
html: str#
latex: list[ExtractedLatex]#
static from_proto(proto: anki.card_rendering_pb2.ExtractLatexResponse) ExtractedLatexOutput#
anki.latex.on_card_did_render(output: anki.template.TemplateRenderOutput, ctx: anki.template.TemplateRenderContext) None#
anki.latex.render_latex(html: str, model: anki.models.NotetypeDict, col: anki.collection.Collection) str#

Convert embedded latex tags in text to image links.

anki.latex.render_latex_returning_errors(html: str, model: anki.models.NotetypeDict, col: anki.collection.Collection, expand_clozes: bool = False) tuple[str, list[str]]#

Returns (text, errors).

errors will be non-empty if LaTeX failed to render.

anki.latex.setup_hook() None#