Skip to content
Command line
API, CLI e MCP

Command line

The neomath, neochem and neoscript commands to generate, convert, style and automate equations and chemical structures in batch, in any terminal.

On this page

The command-line tools give the same result as the apps: the result is identical to what comes out of NeoMath and NeoChem. Help and errors are in Portuguese, with a suggestion when a command is mistyped (“did you mean…”).

neomath#

Terminal
neomath eps formula.tex -o formula.eps
neomath svg formula.txt --texto
neomath png formula.tex --dpi 600 --fundo-branco
echo "x^2+y^2=r^2" | neomath eps - -o circulo.eps

The input is a file with MathML or LaTeX, or - to read from standard input. Without -o, the output goes next to the input (or to standard output).

Commands#

Command What it does
eps, svg, png generates the image (svg --texto with text instead of outlines; png --dpi N --fundo-branco)
layout glyph and stroke positions as JSON
normalizar clean MathML (with --json, the list of corrections)
latex, para-latex LaTeX to MathML and MathML to LaTeX
abrir recovers the equation from a file created by NeoMath
lote folder of .txt with MathML to .eps, or .zip to .zip
docx extracts the equations of a .docx: a MathML .txt and the image of each
converter converts files and folders between the types Neo understands
estilizar, estilizar-desfazer, estilizar-backups batch style
tradutores, traduzir lists the languages and translates between them through MathML
fontes available fonts
servidor local HTTP API
word controls the open Word (Windows)
completar generates autocompletion for bash, zsh, fish, powershell or elvish
versao, ajuda version and help

Generation options#

Option Effect
--neqp FILE style; default Times + Symbol 12 pt
--opcoes JSON options as JSON (the same as the API)
--cor COLOR equation color: #RRGGBB, name or cmyk(C,M,Y,K)
--cmyk C,M,Y,K color in CMYK; the EPS carries the four exact inks
--cor-so-texto color applies only to numbers, letters and symbols
--titulo NAME, --data MM/DD/YY the title and date of the EPS
--sem-normalizar, --corrigir-simbolos turns off the normalizer; measures symbols by the real glyph
--json structured result on standard output

Exit codes: 0 ok, 1 unsupported construct, 2 error, 3 wrong usage.

Examples#

Terminal
neomath lote input --saida output --json
neomath docx capitulo.docx --saida extraidas --imagem eps
neomath converter eps-neof acervo --saida acervo-neof --recursivo
neomath traduzir latex mathml "\frac{a}{b}"
neomath completar bash > /etc/bash_completion.d/neomath

neochem#

Terminal
neochem propriedades --texto "CC(=O)Oc1ccccc1C(=O)O" --explicar
neochem converter --texto CCO --para sdf -o etanol.sdf
neochem renderizar molecula.mol --para png --dpi 300 --fundo-branco -o molecula.png
neochem laudo aspirina.smi --titulo Aspirina -o aspirina.md
neochem verificar molecula.mol --json
neochem reacao --texto "2H2 + O2 -> 2H2O" --para svg -o agua.svg
neochem catalogo pesquisar benzeno
neochem lote estruturas --para svg --subpastas

Output of propriedades:

Text
Formula: C9H8O4
Massa molar: 180,159 g/mol
Aneis: 1 (1 aromaticos)
Composicao:
  Carbono (C): 9 atomo(s), 60,0 % da massa
  Hidrogênio (H): 8 atomo(s), 4,48 % da massa
  Oxigênio (O): 4 atomo(s), 35,52 % da massa

Common options: --json, --explicar, --de FORMAT, --para FORMAT, -o FILE, --sobrescrever, --estilo key=value.

Code Meaning
0 success
2 wrong usage
3 file error
4 invalid structure or format
5 failed verification
6 feature not yet available

neoscript#

Text
neoscript [options] file.js
  --permitir FOLDER          allows read and write on FOLDER (repeatable)
  --permitir-leitura FOLDER  allows read-only on FOLDER (repeatable)
  --tempo SECONDS            time limit (default 60)
  --memoria MB               memory limit (default 256)
  --codigo TEXT              runs TEXT instead of a file

The folder of the script file is allowed automatically; the others need --permitir. console.log goes to stdout; warnings and errors go to stderr.

Terminal
neoscript --permitir C:/Equacoes exportar_tudo.js
neoscript --codigo "neo.equacao.definir('x^2'); console.log(neo.equacao.mathml())"
neoscript docs --formato html -o NeoScript.html
neoscript docs --buscar exportar
Code Meaning
0 success
1 script error
2 timed out
3 wrong usage

Without an interface, neo.ocr.* does not work and neo.acao only knows desfazer, refazer, selecionar-tudo and novo. NeoMath --script file.js does the same through the app, without opening the window.