MarkView.Avalonia.Math 12.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MarkView.Avalonia.Math --version 12.2.0
                    
NuGet\Install-Package MarkView.Avalonia.Math -Version 12.2.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="MarkView.Avalonia.Math" Version="12.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MarkView.Avalonia.Math" Version="12.2.0" />
                    
Directory.Packages.props
<PackageReference Include="MarkView.Avalonia.Math" />
                    
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 MarkView.Avalonia.Math --version 12.2.0
                    
#r "nuget: MarkView.Avalonia.Math, 12.2.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 MarkView.Avalonia.Math@12.2.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=MarkView.Avalonia.Math&version=12.2.0
                    
Install as a Cake Addin
#tool nuget:?package=MarkView.Avalonia.Math&version=12.2.0
                    
Install as a Cake Tool

MarkView.Avalonia.Math

NuGet Version NuGet Downloads Avalonia CI License

LaTeX math rendering extension for MarkView.Avalonia. Renders $...$ (inline) and $$...$$ (block) math using CSharpMath's SkiaSharp renderer — pure .NET, no browser, no WebView, no JavaScript runtime.

Because $ is common in ordinary prose (currency amounts, etc.), this parsing is opt-in only — enabling it changes how literal $ characters are interpreted in your documents.

Installation

dotnet add package MarkView.Avalonia.Math

Quick Start

Call UseMath() before setting Markdown:

var viewer = new MarkdownViewer();
viewer.UseMath();
viewer.Markdown = markdownText;

Or activate globally at application startup:

// App.axaml.cs
MarkdownViewerDefaults.Extensions.AddMath();
MarkdownViewerDefaults.Pipeline = new MarkdownPipelineBuilder()
    .UseSupportedExtensions()
    .UseMathematics()
    .Build();

Unlike most opt-in extensions in this repo, math needs both a pipeline change (.UseMathematics(), so $/$$ are even parsed) and a renderer registration — UseMath() does both for you.

Inline: Einstein's famous equation is $E = mc^2$.

Block:

$$
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
$$

Theme Awareness

Formulas are rendered with colours matching the active Avalonia theme variant (dark #FAFAFA, light #27272A text), and are automatically re-rendered when the user switches between light and dark.

Combining with Mermaid

MathExtension and MermaidExtension can both be registered in either order — each scans for (rather than assumes) its position in the renderer list, so $$...$$ blocks are never mistaken for a Mermaid diagram or a plain code block regardless of registration order.

Error Handling

Invalid LaTeX renders CSharpMath's own inline error text rather than throwing. Unexpected rendering failures fall back to a plain-text panel (block math) or leave the last successfully rendered formula in place (inline math).

License

MIT © Nicolas Musset

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
12.2.1 49 8/23/2026
12.2.0 52 8/22/2026