Skip to content

The beermat command

The beermat command works on worksheets without opening the app: for scripts, build servers and AI assistants. It comes with the desktop app (Install).

Works out the sheet and prints every line with a result or an error:

12: M_max := q*L^2/8 = ? kN*m #= 54 kN*m
14: y := x + 2 m #! units do not match: L·M vs L
  • --write saves the fresh results into the file.
  • --json prints the same as JSON.
  • --allow-python lets the sheet run the Python files it uses.

Lists the problems in a sheet, one per line, without changing it: errors, and results saved in the file that are out of date. Prints ok when there is nothing to report.

beermat export <file> [--to md|latex] [--out <file>]

Section titled “beermat export <file> [--to md|latex] [--out <file>]”

Writes the sheet as Markdown (the default) or as a LaTeX document.

beermat import <file.xmcd> [--out <file.bbm>]

Section titled “beermat import <file.xmcd> [--out <file.bbm>]”

Converts an .xmcd worksheet to a .bbm one, and lists what couldn’t be brought across exactly.

Lets AI assistants that speak MCP, such as Claude Code, read and work out worksheets.

CodeMeaning
0Success, nothing to report
1The sheet has errors, or (check) out-of-date results
2Bad arguments, or the file can’t be read or written