{"library":"prettier-plugin-latex","title":"Prettier Plugin for LaTeX","description":"Prettier plugin for formatting LaTeX source files. Version 2.0.1 supports Prettier v3 (ESM) and requires Node >= 18. Uses the @unified-latex/unified-latex-prettier library for parsing LaTeX into an AST, enabling smart formatting of environments, math mode, and macros. Notable caveats: Prettier v3 dropped automatic plugin resolution (must specify --plugin), and the plugin cannot parse arbitrary TeX — it assumes standard LaTeX. Online playground available.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-latex"],"cli":{"name":"prettier","version":null}},"imports":["import prettier from 'prettier'","import { printPrettier } from 'prettier-plugin-latex/standalone'","import * as plugin from 'prettier-plugin-latex'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import prettier from 'prettier';\nimport * as plugin from 'prettier-plugin-latex';\n\nconst code = `\\begin{enumerate}\n    \\item[55,4] Hi there\n\\end{enumerate}`;\n\nprettier.format(code, {\n  parser: 'latex',\n  plugins: [plugin],\n  tabWidth: 4,\n  printWidth: 80\n}).then(result => console.log(result));","lang":"javascript","description":"Shows how to format LaTeX using prettier-plugin-latex programmatically with Prettier v3 ESM import.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}