Skip to content

Rendering atmxg strings

The automath render svg command renders an atmxg expression as an SVG, printed to standard output. The produced SVG is designed to be used inline in an HTML document.

See the atmxg page for the expression syntax, and the CLI reference for the exhaustive option list.

String mode

automath render svg "1/4 + 3/8 = ?"

Arguments are joined with a single space, so quoting is optional when the expression contains no shell-special characters:

automath render svg 1/4 + 3/8 = ?

Use --locale to override the locale (it affects number formatting):

automath render svg --locale en "2450"

File mode

When every argument is an existing file, automath switches to file mode and renders each .atmxg file. The per-file locale is derived from a _<locale> suffix in the filename (e.g. foo_fr3.atmxgfr), falling back to --locale.

A single file, with no other option, prints its SVG to stdout:

automath render svg pics/frac1.atmxg

With two or more files, --output-dir/-o or --write/-w is required, and each produced stem is printed to stdout:

automath render svg -o out/ pics/*.atmxg                 # write out/<name>.svg
automath render svg -w pics/frac1.atmxg pics/frac2.atmxg  # write <name>.svg next to each input