
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
WebTeX is a modern, enhanced fork of LaTeX.js - a JavaScript LaTeX to HTML5 translator that converts LaTeX documents into web-ready HTML while preserving formatting and mathematical expressions.
CLI Usage (Global):
npm install -g webtex
Library Usage (Project):
npm install webtex
Command Line:
# Convert LaTeX file to HTML
webtex input.tex -o output.html
# Include CSS and assets
webtex input.tex -o output.html -a
# Pretty print output
webtex input.tex -o output.html -p
JavaScript API:
import { HtmlGenerator, parse } from 'webtex';
const latex = `
\\documentclass{article}
\\begin{document}
\\section{Hello WebTeX}
This is a LaTeX document with math: $E = mc^2$
\\end{document}
`;
const generator = new HtmlGenerator({ hyphenate: false });
const doc = parse(latex, { generator }).htmlDocument();
console.log(doc.documentElement.outerHTML);
WebTeX includes a modern live preview application with real-time LaTeX compilation. You can use it online or run it locally:
Online Demo: Visit https://webtex.pages.dev/app for the live editor.
Local Development:
cd app
python3 -m http.server 8080
# Open http://localhost:8080 in your browser
Features:
WebTeX is a comprehensive modernization of the original LaTeX.js project with significant architectural improvements:
Original LaTeX.js | WebTeX |
---|---|
Rollup bundler | esbuild - Modern, fast build tool |
LiveScript source | TypeScript - Type-safe development |
Legacy tooling | Modern ecosystem (Biome, Vitest) |
amsmath
, amsfonts
, amssymb
bussproofs
package for proof treesUsage: webtex [options] [files...]
Options:
-o, --output <file> Specify output file (default: STDOUT)
-a, --assets [dir] Copy CSS to output directory
-u, --url <url> Set base URL for assets
-b, --body Output body content only (no HTML boilerplate)
-e, --entities Encode HTML entities instead of UTF-8
-p, --pretty Beautify HTML output
-c, --class <class> Default document class (default: "article")
-m, --macros <file> Load custom macro definitions
-s, --stylesheet <css> Additional stylesheets (comma-separated)
-n, --hyphenation Enable hyphenation (default: true)
-l, --language <lang> Hyphenation language (default: "en")
-h, --help Show help
-v, --version Show version
Document Classes: article
, book
, report
Mathematics:
amsmath
, amsfonts
, amssymb
)bussproofs
package)Text Formatting:
Advanced Features:
git clone https://github.com/tani/webtex.git
cd webtex
npm install
npm run build
npm run build # Full production build
npm run build:check # Build only if dist/ doesn't exist
npm run test:watch # Development mode with tests
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run lint # Code linting and formatting
npm run typecheck # TypeScript type checking
WebTeX includes comprehensive testing:
npm test test/unit/api.spec.ts # API functionality tests
npm test test/visual/ # Visual regression tests
npm test test/integration/ # Integration tests
We welcome contributions! This project maintains the original LaTeX.js commitment to LaTeX compatibility while embracing modern development practices.
Guidelines:
npm run lint && npm run typecheck && npm test
WebTeX is licensed under the MIT License. See LICENSE for details.
WebTeX is built upon the excellent foundation of LaTeX.js by Michael Brade. We extend our gratitude to the original author and contributors for creating such a robust LaTeX parsing and rendering system.
Original LaTeX.js:
WebTeX Enhancements:
WebTeX represents a significant evolution while maintaining compatibility:
Related Projects:
If WebTeX helps your project, please consider giving it a star on GitHub! Your support helps drive continued development and improvement.
Made with ❤️ by the WebTeX team
FAQs
JavaScript LaTeX to HTML5 translator - WebTeX fork with enhanced features
The npm package webtex receives a total of 594 weekly downloads. As such, webtex popularity was classified as not popular.
We found that webtex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.