Batch style
Change fonts, sizes, spacing and colors of every equation in a folder, with simulation, backup, per-file verification and undo.
On this page
Batch style applies a style change to every equation in a folder at once. The priority is fidelity: only what was requested changes, everything else stays exactly as it was, and each file is verified after being written.
The same feature exists in four places: on the NeoMath screen, on the command line (neomath estilizar), in the MCP server (restyle_folder) and in NeoScript (neo.lote.estilizar).
What is included#
The .eps, .svg and .png files created by NeoMath go in; they keep the equation inside. Each file is read, the equation is recovered from the data it carries, the drawing is redone with the new preferences and the file is saved again.
| File | Result |
|---|---|
| NeoMath EPS, SVG and PNG with the equation inside | changed |
| PNG or SVG with only MathML or LaTeX | ignored (sem_dados) |
| EPS from another program | ignored (de_terceiros) |
| Read-only | ignored (somente_leitura) |
| Other extensions | untouched |
Use it on screen#
- Open Menu › Conversions and choose the Batch style tab.
- Choose the folder and, if you want, include subfolders.
- Check what to change in the Color, Fonts, Sizes, Spacing and Image sections. A dot shows in a section that has something checked.
- Click Preview to see how many files will change, the warnings and the reason each ignored file was skipped.
- Click Apply. The confirmation shows the folder, the number of files, the changes and where the backups go. After OK, the progress bar follows along and Cancel stops between one file and the next.
- The final report lists each file as applied, unchanged, ignored, error or canceled, and can be saved as JSON.
Undo the last application restores the originals from the backup.
What is preserved#
- The equation’s MathML, byte by byte (with a color change, only the color wrapper and the
mathcolorattributes). - The editor model, so the file keeps opening the same way in NeoMath.
- Preferences that were not requested, the title, the date and the metadata.
- In PNG, the resolution (deduced from the pixel size) and the transparent or white background.
- In SVG, the outlines or text mode.
Running the same change twice gives the same result: the second time every file comes out as sem_alteracao (unchanged).
Color: three policies#
A part’s own color takes priority over the general color. That is why there are three policies:
| Policy | What changes |
|---|---|
sem_cor_propria (default) |
only what has no color of its own |
todas |
also replaces the inner colors |
somente (with de) |
only what is in a specific color, such as “from black to blue” |
{"remover": true} removes the color. With Apply color to everything off, the color paints only numbers, letters and symbols, without fraction bars, delimiters and radicals.
Safety#
- Backup before anything: files are copied to
<folder>/.neomath-backup/YYYY-MM-DD_HHMMSS/. If a copy fails, nothing is changed. - Atomic writing: each new file is written to a temporary file and swapped by renaming; there is never a half-written file, even in a power failure.
- Mandatory verification: after writing, the file is read back and compared to the original; if something does not match, the original is restored.
- Symbolic links are not followed and files over 64 MB are ignored.
Command line#
neomath estilizar pasta --cor blue --cor-politica somente --cor-de black --estilo Text=Georgia
neomath estilizar pasta --tamanho Full=14pt --espacamento LineSpacing=150% --subpastas --aplicar
neomath estilizar pasta --cor blue --aplicar --sim --json
neomath estilizar-backups pasta
neomath estilizar-desfazer pasta --id 2026-10-21_143000Without a terminal (in scripts), --aplicar requires --sim. Exit codes: 0 no errors, 1 with errors or canceled, 2 failure, 3 wrong usage.
Changes object#
The same keys work in the library, in MCP and in NeoScript. Only what is present changes; an unknown key is an error.
{
"cor": { "valor": "blue", "politica": "somente", "de": "black" },
"estilos": { "Text": { "fonte": "Georgia", "negrito": false, "italico": true } },
"tamanhos": { "Full": "14 pt" },
"espacamentos": { "LineSpacing": { "valor": 150, "unidade": "%" } },
"svg": "curvas",
"png": { "dpi": 300, "fundo": "branco" }
}estilos:Text,Function,Variable,LCGreek,UCGreek,Symbol,Vector,Number,User1,User2,MTExtra(names in Portuguese such astextoandvariavelalso work).tamanhos:Full,Script,ScriptScript,Symbol,SubSymbol,User1,User2,SmallLargeIncr.- Units:
in,cm,pt,pior%.png.dpifrom 36 to 1200.