module documentation

Render math in HTML via dvipng or dvisvgm.

Exception InvokeError errors on invoking converters.
Exception MathExtError Undocumented
Function clean_up_files Undocumented
Function compile_math Compile LaTeX macros for math to DVI.
Function convert_dvi_to_image Convert DVI file to specific image format.
Function convert_dvi_to_png Convert DVI file to PNG image.
Function convert_dvi_to_svg Convert DVI file to SVG image.
Function ensure_tempdir Create temporary directory.
Function generate_latex_macro Generate LaTeX macro.
Function get_tooltip Undocumented
Function html_visit_displaymath Undocumented
Function html_visit_math Undocumented
Function read_svg_depth Read the depth from comment at last line of SVG file
Function render_math Render the LaTeX math expression *math* using latex and dvipng or dvisvgm.
Function render_maths_to_base64 Undocumented
Function setup Undocumented
Function write_svg_depth Write the depth to SVG file as a comment at end of file
Constant SUPPORT_FORMAT Undocumented
Variable depth_re Undocumented
Variable depthsvg_re Undocumented
Variable depthsvgcomment_re Undocumented
Variable logger Undocumented
Variable templates_path Undocumented
def clean_up_files(app, exc): (source)

Undocumented

Parameters
app:SphinxUndocumented
exc:ExceptionUndocumented
def compile_math(latex, builder): (source)

Compile LaTeX macros for math to DVI.

Parameters
latex:strUndocumented
builder:BuilderUndocumented
Returns
strUndocumented
def convert_dvi_to_image(command, name): (source)

Convert DVI file to specific image format.

Parameters
command:list[str]Undocumented
name:strUndocumented
Returns
tuple[str, str]Undocumented
def convert_dvi_to_png(dvipath, builder, out_path): (source)

Convert DVI file to PNG image.

Parameters
dvipath:strUndocumented
builder:BuilderUndocumented
out_path:strUndocumented
Returns
int|NoneUndocumented
def convert_dvi_to_svg(dvipath, builder, out_path): (source)

Convert DVI file to SVG image.

Parameters
dvipath:strUndocumented
builder:BuilderUndocumented
out_path:strUndocumented
Returns
int|NoneUndocumented
def ensure_tempdir(builder): (source)

Create temporary directory. use only one tempdir per build -- the use of a directory is cleaner than using temporary files, since we can clean up everything at once just removing the whole directory (see cleanup_tempdir)

Parameters
builder:BuilderUndocumented
Returns
strUndocumented
def generate_latex_macro(image_format, math, config, confdir=''): (source)

Generate LaTeX macro.

Parameters
image_format:strUndocumented
math:strUndocumented
config:ConfigUndocumented
confdir:strUndocumented
Returns
strUndocumented
def get_tooltip(self, node): (source)

Undocumented

Parameters
self:HTML5TranslatorUndocumented
node:ElementUndocumented
Returns
strUndocumented
def html_visit_displaymath(self, node): (source)

Undocumented

Parameters
self:HTML5TranslatorUndocumented
node:nodes.math_blockUndocumented
def html_visit_math(self, node): (source)

Undocumented

Parameters
self:HTML5TranslatorUndocumented
node:nodes.mathUndocumented
def read_svg_depth(filename): (source)

Read the depth from comment at last line of SVG file

Parameters
filename:strUndocumented
Returns
int|NoneUndocumented
def render_math(self, math): (source)

Render the LaTeX math expression *math* using latex and dvipng or dvisvgm. Return the image absolute filename and the "depth", that is, the distance of image bottom and baseline in pixels, if the option to use preview_latex is switched on. Error handling may seem strange, but follows a pattern: if LaTeX or dvipng (dvisvgm) aren't available, only a warning is generated (since that enables people on machines without these programs to at least build the rest of the docs successfully). If the programs are there, however, they may not fail since that indicates a problem in the math source.

Parameters
self:HTML5TranslatorUndocumented
math:strUndocumented
Returns
tuple[str|None, int|None]Undocumented
def render_maths_to_base64(image_format, generated_path): (source)

Undocumented

Parameters
image_format:strUndocumented
generated_path:strUndocumented
Returns
strUndocumented
def setup(app): (source)

Undocumented

Parameters
app:SphinxUndocumented
Returns
dict[str, Any]Undocumented
def write_svg_depth(filename, depth): (source)

Write the depth to SVG file as a comment at end of file

Parameters
filename:strUndocumented
depth:intUndocumented
SUPPORT_FORMAT: tuple[str, ...] = (source)

Undocumented

Value
('png', 'svg')
depth_re = (source)

Undocumented

depthsvg_re = (source)

Undocumented

depthsvgcomment_re = (source)

Undocumented

Undocumented

templates_path = (source)

Undocumented