This library provides an Elixir wrapper around the Rust RaTeX library. This allows you render SVGs and PNGs of mathematical expressions right in Elixir.
Summary
Functions
Generate a PNG binary from a given LaTeX math expression.
Same as render_png/2 but raises on error.
Generate an SVG from a given LaTeX math expression.
Same as render_svg/2 but raises on error.
Types
Functions
@spec render_png(expression :: String.t(), opts :: png_opts()) :: {:ok, binary()} | {:error, term()}
Generate a PNG binary from a given LaTeX math expression.
Options
:font_size(float/0) - The base font size in pixels. The default value is32.0.:pixel_ratio(float/0) - The device pixel ratio for retina rasters. The default value is2.0.:color(String.t/0) - The color of the glpyhs as hexadecimal (e.g.#112233). The default value is"#000000".:inline(boolean/0) - Render the expression as inline text as opposed to display. The default value isfalse.:unicode_font_path(String.t/0) - The absolute path to a TTF font file for non-ASCII text that may be used inside of an\\text{...}expression. If a font path is not provided the underlying RaTeX Rust library will attempt to use the platform fallback.
Same as render_png/2 but raises on error.
@spec render_svg(expression :: String.t(), opts :: svg_opts()) :: {:ok, binary()} | {:error, term()}
Generate an SVG from a given LaTeX math expression.
Options
:font_size(float/0) - The base font size in pixels. The default value is32.0.:color(String.t/0) - The color of the glpyhs as hexadecimal (e.g.#112233). The default value is"#000000".:inline(boolean/0) - Render the expression as inline text as opposed to display. The default value isfalse.:unicode_font_path(String.t/0) - The absolute path to a TTF font file for non-ASCII text that may be used inside of an\\text{...}expression. If a font path is not provided the underlying RaTeX Rust library will attempt to use the platform fallback.
Same as render_svg/2 but raises on error.