Linux command
tex-fmt 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Format file
tex-fmt [document.tex]
Format in place
tex-fmt -w [document.tex]
Check formatting
tex-fmt --check [document.tex]
Format from stdin
cat [document.tex] | tex-fmt
With config
tex-fmt -c [tex-fmt.toml] [document.tex]
说明
tex-fmt is a fast LaTeX source code formatter written in Rust that standardizes indentation and whitespace in .tex files. It ensures consistent formatting across documents and teams by applying configurable indentation rules to LaTeX environments, commands, and structures. The -w flag writes changes in place, while --check mode verifies formatting without modifying files, making it suitable for CI pipelines. Configuration can be provided via a TOML file to customize indentation width, tab handling, and other style preferences.
参数
- -w
- Write in place.
- --check
- Check only.
- -c _FILE_
- Config file.
- --stdin
- Read stdin.
- --tabsize _N_
- Tab size.
FAQ
What is the tex-fmt command used for?
tex-fmt is a fast LaTeX source code formatter written in Rust that standardizes indentation and whitespace in .tex files. It ensures consistent formatting across documents and teams by applying configurable indentation rules to LaTeX environments, commands, and structures. The -w flag writes changes in place, while --check mode verifies formatting without modifying files, making it suitable for CI pipelines. Configuration can be provided via a TOML file to customize indentation width, tab handling, and other style preferences.
How do I run a basic tex-fmt example?
Run `tex-fmt [document.tex]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -w do in tex-fmt?
Write in place.