Skip to content

Rendering .atmxs files

.atmxs files are an intermediate format (see Creating .atmxs files). Several commands consume them. Some options only support the grid preset and not slideshow, where they make no sense; see below.

Note The render verbs are named after their output: automath render html produces HTML, automath render templates/render wrappers produce JSON. automath render atmxs does the opposite — it produces .atmxs from a script source (see Creating .atmxs files) — so it does not take an .atmxs file as input.

.atmxs → HTML (stdout)

Pass a single .atmxs file to automath render html. The output contains both the question and answer sections, always visible, with a print button only (no interactive form). The HTML is printed to standard output. Supported for both presets:

automath render html output.atmxs > static.html

Font delivery (--font-mode)

How fonts reach the produced HTML — embedded (base64 data URI, self-contained), served (a static URL; needs fonts.served_base_url) or local (referenced by name, must be installed on the viewing machine) — is resolved by this precedence:

  1. the --font-mode option on render html, if given;
  2. otherwise the font_mode entry stamped in the .atmxs (see Creating .atmxs files), if present;
  3. otherwise the fonts.mode config default (shipped as embedded).

So a snapshot stamped with a mode re-renders in that mode by default, and --font-mode still overrides it for a one-off:

automath render html output.atmxs > static.html          # uses the stamp, or the config default
automath render html --font-mode embedded output.atmxs   # override for this render

With -w each file is resolved independently, so a batch may mix stamped modes.

.atmxs → HTML (written next to the file)

With -w / --write, the HTML is written next to each source .atmxs file instead of to stdout. One or more files are accepted. Supported for both presets. For the grid preset, if a valid rotate entry is present, two HTML files are written (<stem>0.html and <stem>1.html):

automath render html -w file.atmxs
automath render html -w file1.atmxs file2.atmxs

--answers: answers-only page

Render a single HTML page containing only the answer sections of one or more files (one printed page per file, or two when a rotate entry is present). Useful for printing an answer key. Only supported for grid documents:

automath render html --answers file1.atmxs file2.atmxs > answers.html

Mail-merge template

Output a JSON template for mail-merge assembly from exactly one .atmxs file. The result is printed to stdout (use -o FILE to write it to a file). Only supported for grid documents:

automath render templates my_snapshot.atmxs
automath render templates my_snapshot.atmxs -o my_sheet.json

Mail-merge HTML wrappers

Output a JSON object containing the HTML wrapper parts (head, section openers, foot) for assembling a mail-merge document. No .atmxs file is required:

automath render wrappers