VelociTex.WinUI 1.0.0

dotnet add package VelociTex.WinUI --version 1.0.0
                    
NuGet\Install-Package VelociTex.WinUI -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VelociTex.WinUI" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VelociTex.WinUI" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="VelociTex.WinUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VelociTex.WinUI --version 1.0.0
                    
#r "nuget: VelociTex.WinUI, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VelociTex.WinUI@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VelociTex.WinUI&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=VelociTex.WinUI&version=1.0.0
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.26100 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

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 76 10/19/2026
1.0.0-preview7 102 10/21/2026
1.0.0-preview6 130 10/20/2026
1.0.0-preview5 99 10/20/2026