VelociTex.Rendering.Direct2D
1.0.0
dotnet add package VelociTex.Rendering.Direct2D --version 1.0.0
NuGet\Install-Package VelociTex.Rendering.Direct2D -Version 1.0.0
<PackageReference Include="VelociTex.Rendering.Direct2D" Version="1.0.0" />
<PackageVersion Include="VelociTex.Rendering.Direct2D" Version="1.0.0" />
<PackageReference Include="VelociTex.Rendering.Direct2D" />
paket add VelociTex.Rendering.Direct2D --version 1.0.0
#r "nuget: VelociTex.Rendering.Direct2D, 1.0.0"
#:package VelociTex.Rendering.Direct2D@1.0.0
#addin nuget:?package=VelociTex.Rendering.Direct2D&version=1.0.0
#tool nuget:?package=VelociTex.Rendering.Direct2D&version=1.0.0
VelociTex
VelociTex typesets complete TeX formulas using KaTeX 0.19.0 mathematical rules. It provides native Windows rendering, PNG / SVG / MathML export, a WinUI 3 control, and an optional browser package. A native C++ typesetting core runs through .NET 10 bindings, DirectWrite and Direct2D, without a browser or JavaScript runtime.
One C++ core, two endpoints
There is exactly one formula parser and renderer in this repository: the
C++ core in native/core. Both public endpoints call it, and nothing else
parses formulas.
| Endpoint | Reaches the core through |
|---|---|
.NET (VelociTex.Core) |
the C ABI in native/core/api.cpp |
Browser (npm velocitex) |
native/core, compiled to velocitex-core.wasm |
The browser package ships no JavaScript formula parser and no Rust formula parser: the WebAssembly module is the C++ core, and its HTML and MathML are produced by the same code the .NET endpoint uses.
KaTeX-identical browser HTML
The npm package's default browser path emits the same HTML and MathML markup as KaTeX 0.19.0 for the supported core formula set, with no MathML-as-rendering shortcut. It uses the locked KaTeX 0.19.0 stylesheet and the unchanged KaTeX fonts. The native parity gate compares 5,411 formulas (1,605 real world formulas, the curated feature corpus, the frozen benchmark workloads and the repository's own fixture corpus) byte for byte against KaTeX for both the HTML and the MathML output, and the browser gate repeats 1,651 of them inside Chromium.
The browser package renders 3.9x faster than KaTeX 0.19.0 in Chromium on
the 36-formula benchmark: about 43 µs vs 165 µs per formula (three-run
median, 120 paired rounds). The native C++ core renders the same corpus in
29.2 µs per formula. See docs/benchmarks.md for the full tables,
environment and reproduction steps.
Choose a package
| Package | Use |
|---|---|
VelociTex.Core |
Compile formulas, inspect dimensions and diagnostics, export MathML |
VelociTex.Rendering.Direct2D |
Render on Windows x64 and export PNG / SVG |
VelociTex.WinUI |
Display formulas with the native MathView control |
npm velocitex |
Render formulas in a browser, with TypeScript declarations |
The source distribution also includes a portable SVG backend and an optional C++ MathML adapter.
Native packages require .NET 10. Windows rendering targets Windows 10 build
19041 or later, x64. WinUI apps supply their own Windows App SDK host. Native AOT
and trimming are supported. Browser rendering ships its own WebAssembly assets.
Use the version available from your package feed; the stable npm release uses latest.
Compile and export
using VelociTex;
using VelociTex.Rendering.Direct2D;
var engine = new MathEngine();
using var workspace = new MathWorkspace();
var options = new MathOptions { FontSize = 24, DisplayMode = true };
if (engine.TryCompile(@"\frac{a}{b}+\sqrt{x}", in options, workspace,
CancellationToken.None, out var document, out var diagnostic))
{
using var renderer = new WindowsMathRenderer();
renderer.WritePng(document!, "formula.png");
renderer.WriteSvg(document!, "formula.svg");
File.WriteAllText("formula.mathml", MathMlWriter.Write(document!));
}
else
{
Console.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
}
See docs/package-contract.md in this package for ownership, threading and
resource limits. Online documentation
also covers WinUI, browser use and examples.
Code is MIT. Bundled KaTeX fonts retain OFL-1.1 and Reserved Font Name terms;
see THIRD-PARTY-NOTICES.md and licenses/.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.26100 is compatible. |
-
net10.0-windows10.0.26100
- VelociTex.Core (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on VelociTex.Rendering.Direct2D:
| Package | Downloads |
|---|---|
|
VelociTex.WinUI
C++ TeX typesetting through .NET bindings with native DirectWrite/Direct2D rendering, WinUI controls, and PNG, SVG and MathML export. Includes refresh-independent performance comparisons. Code is MIT; fonts are OFL-1.1. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 151 | 10/25/2026 |
| 1.0.0-rc.2 | 81 | 10/19/2026 |
| 1.0.0-preview7 | 104 | 10/21/2026 |
| 1.0.0-preview6 | 132 | 10/20/2026 |
| 1.0.0-preview5 | 103 | 10/20/2026 |