tex-fmt
v0.5.7-npm.1
Published
WebAssembly build of the tex-fmt LaTeX formatter.
Downloads
426
Readme
tex-fmt WASM
This is an unofficial npm distribution of the WebAssembly build of
WGUNDERWOOD/tex-fmt, a fast LaTeX
formatter written in Rust.
The package is generated from an upstream release tag by this repository's
GitHub Actions workflow. See UPSTREAM.md in the published package for the
exact source tag and commit.
Usage
import { main, version } from "tex-fmt";
const result = main(sourceText, `
wrap = true
wraplen = 80
`);
console.log(version());
console.log(result.output);
console.log(result.logs);main accepts LaTeX text and a TOML configuration string. It returns an
object with output and logs fields. The default bundler WebAssembly
target initializes automatically when the package is imported and is
suitable for Vite, Webpack, and similar tools.
When wasmTarget is set to web, use the generated initializer before
calling main:
import init, { main, version } from "tex-fmt";
await init();
const result = main(sourceText, "");License
The upstream project is distributed under the MIT license. The upstream
license is included in the package as LICENSE.
