Installation & Setup
Typstyle can be installed and used in multiple ways. Choose the method that best fits your workflow.
The easiest way to get started is to download the pre-built binary from the release page.
Typstyle is available in many package managers. Check the packaging status for your distribution.
Notably, typstyle is available in Archlinux CN repo.
cargo binstall typstyle
cargo binstall typstyle
cargo install typstyle --locked
cargo install typstyle --locked
--locked--locked may fail due to API changes: an older typstyletypstyle could depend on a newer, incompatible typstyle-coretypstyle-core. Always use --locked--locked to ensure version compatibility.Typstyle has been integrated into tinymist. You can use it in your editor by installing the tinymist plugin and set tinymist.formatterModetinymist.formatterMode to typstyletypstyle.
- Install the Tinymist extension
- Set
tinymist.formatterModetinymist.formatterModeto"typstyle""typstyle"in your settings - Enable format on save or use
Ctrl+Shift+PCtrl+Shift+P→ “Format Document”
Typstyle is also available as a library integrated in your project.
[dependencies]typstyle-core = "=0.14.4"
[dependencies]typstyle-core = "=0.14.4"
For web projects using WebAssembly bindings:
npm install @typstyle/typstyle-wasm-bundler
npm install @typstyle/typstyle-wasm-bundler
The @typstyle/typstyle-wasm-bundler@typstyle/typstyle-wasm-bundler package provides WebAssembly bindings for web bundlers like Webpack, Vite, and Rollup. Please see its README for details.
The typstyle-action maintained by grayespinoza can install and run Typstyle in a GitHub Action.
- name: Run typstyle uses: typstyle-rs/typstyle-action@main
- name: Run typstyle uses: typstyle-rs/typstyle-action@main
Add this to your .pre-commit-config.yaml.pre-commit-config.yaml:
- repo: https://github.com/typstyle-rs/pre-commit-typstyle rev: '' # The revision or tag you want to use hooks: - id: typstyle
- repo: https://github.com/typstyle-rs/pre-commit-typstyle rev: '' # The revision or tag you want to use hooks: - id: typstyle