@notatki/mathfmt
v0.10.0
Published
A formatter for math in TeX files.
Readme
@notatki/mathfmt
mathfmt formats the math in TeX files. It finds math in $…$, $$…$$, \(…\), \[…\] and the
math environments (equation, align, gather, ...), formats it with @notatki/math, and leaves
the rest of the file as is.
mathfmt [options] [paths...]Paths are files or directories (searched for *.tex, skipping node_modules and dot-directories);
the default is .. Without --write the files are only checked: those that need formatting are
listed and the exit code is 1. Exit code 2 means an error, such as unbalanced delimiters.
| Option | Values |
| ------------------------- | ---------------------------------- |
| -w, --write | rewrite the files in place |
| --diff | print a diff of the needed changes |
| --parens <mode> | add, normalize, unchanged |
| --brace-commands <mode> | add, remove, unchanged |
| --brace-scripts <mode> | add, remove, unchanged |
| --spacing <mode> | compact, padded, unchanged |
All math options default to unchanged.
Not formatted: comments, verbatim environments, \verb, the preamble, macro definitions, and any
math that contains a % comment.
