1. Introduction
  2. User Guide
  3. 1. Installation
  4. 2. Quick Start
  5. 3. Changelog
  6. Usage
  7. 4. Command Line Interface
  8. 5. Editor Integration
  9. Features
  10. 6. Formatting Features
    1. 6.1. Markup
    2. 6.2. Code
    3. 6.3. Math Equations
    4. 6.4. Tables
  11. 7. Escape Hatch
  12. 8. Limitations
  13. Advanced
  14. 9. How It Works
  15. 10. Developer Guide
    1. 10.1. Core
    2. 10.2. Documentation
    3. 10.3. Playground

typstyle

#

CLI Usage

Usage: typstyle [OPTIONS] [INPUT]...

Arguments:
  [INPUT]...  List of files or directories to format [default: stdin]

Options:
  -i, --inplace  Format the file in place
      --check    Run in 'check' mode. Exits with 0 if input is formatted correctly. Exits with a non-zero status code if formatting is required
  -h, --help     Print help
  -V, --version  Print version

Format Configuration:
  -l, --line-width <LINE_WIDTH>      Maximum width of each line [default: 80] [aliases: column] [short aliases: c]
  -t, --indent-width <INDENT_WIDTH>  Number of spaces per indentation level [default: 2] [aliases: tab-width]
      --no-reorder-import-items      Disable alphabetical reordering of import items
      --wrap-text                    Wrap text in markup to fit within the line width. Implies `--collapse-spaces`

Debug Options:
  -a, --ast         Print the AST of the input file
  -p, --pretty-doc  Print the pretty document
      --timing      Show elapsed time taken by the formatter

Log Levels:
  -v, --verbose  Enable verbose logging
  -q, --quiet    Print diagnostics, but nothing else

#

Basic Usage

# Format multiple files
typstyle -i chapter1.typ chapter2.typ appendix.typ

# Format entire project
typstyle -i .

# Format with specific configuration
typstyle -l 100 -t 4 --wrap-text -i src/

#

Arguments

#

Input Files

# Format from stdin (default)
cat file.typ | typstyle

# Format specific files
typstyle file1.typ file2.typ

# Format directories (recursively)
typstyle src/ docs/

#

Main Options

#

Format Control

#
In-Place Formatting
# Modify files directly
typstyle -i file.typ
typstyle --inplace file.typ
#
Check Mode
# Exit with non-zero if formatting needed
typstyle --check src/

#

Format Configuration

#
Line Width
# Set maximum line width (default: 80)
typstyle -l 100 file.typ
typstyle --line-width 100 file.typ
#
Indentation
# Set indentation width (default: 2)
typstyle -t 4 file.typ
typstyle --indent-width 4 file.typ
#
Text Wrapping
# Wrap text in markup to fit line width
typstyle --wrap-text file.typ

#

Debug Options

#

AST Output

# Print the Abstract Syntax Tree
typstyle -a file.typ
typstyle --ast file.typ

#

Pretty Document Output

# Print the internal pretty document representation
typstyle -p file.typ
typstyle --pretty-doc file.typ

#

Timing Information

# Show elapsed time taken by the formatter
typstyle --timing file.typ

#

Logging Options

See CLI help.