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 typstyle
typstyle
could depend on a newer, incompatible typstyle-core
typstyle-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.formatterMode
tinymist.formatterMode
to typstyle
typstyle
.
- Install the Tinymist extension
- Set
tinymist.formatterMode
tinymist.formatterMode
to"typstyle"
"typstyle"
in your settings - Enable format on save or use
Ctrl+Shift+P
Ctrl+Shift+P
→ "Format Document"
Typstyle is also available as a library integrated in your project.
[dependencies]
typstyle-core = "=0.13.17"
[dependencies]
typstyle-core = "=0.13.17"
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
You can use your local installation:
repos:
- repo: local
hooks:
- id: typstyle
name: typstyle
entry: typstyle -i
language: system
files: \.typ$
args: [] # set your style args here
repos:
- repo: local
hooks:
- id: typstyle
name: typstyle
entry: typstyle -i
language: system
files: \.typ$
args: [] # set your style args here
This method requires typstyle to be installed and available in your PATH.