Aspose.TeX for .NET is a library that enables your C#, VB.NET, ASP.NET applications to typeset TeX files and obtain an output document in one of many supported file formats, such as XPS, PDF, JPEG, PNG, TIFF, and BMP. You do not need to install any third-party applications or components. Aspose.TeX for .NET works as a TeX engine that also features a custom TeX format creator. You can configure document typesetting preferences to have your desired output design. It also offers numerous embedded fonts available for typesetting. Using Aspose.TeX for .NET, you can define your own interface for input gathering or choose to accept input from a local directory or from a ZIP archive. Aspose.TeX for .NET consists of only safe managed code and written entirely in C#. It supports Windows Server and Desktop editions (x86, x64) as well as Windows Azure. Aspose.TeX supports all versions of the Microsoft .NET Framework from 2.0 to 4.8. It is also in compliance with the .NET Standard 2.0/2.1.
$ dotnet add package Aspose.TeXProduct Page | Docs | API Reference | Examples | Blog | Releases | Support | Temporary License
Aspose.TeX for .NET is a powerful library for typesetting TeX/LaTeX files and converting them to various output formats. It enables C#, VB.NET, and ASP.NET developers to create, process, and render LaTeX documents without installing any third-party TeX distribution.
Convert LaTeX files to multiple output formats:
Render LaTeX math formulas as standalone images:
amsmath, amsfonts, amssymb)\includegraphics (PNG, EPS, PDF)\documentclass, \begin{document}, etc.)| Format | Input | Output |
|---|---|---|
| Plain TeX (.tex) | Yes | Yes |
| LaTeX (.ltx, .tex) | Yes | Yes |
| — | Yes | |
| XPS | Yes | Yes |
| SVG | — | Yes |
| PNG | — | Yes |
| JPEG | — | Yes |
| TIFF | — | Yes |
| BMP | — | Yes |
Package Manager Console:
Install-Package Aspose.TeX
.NET CLI:
dotnet add package Aspose.TeX
PackageReference:
<PackageReference Include="Aspose.TeX" Version="*" />
using Aspose.TeX;
using Aspose.TeX.IO;
using Aspose.TeX.Presentation.Pdf;
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
options.InputWorkingDirectory = new InputFileSystemDirectory("input");
options.OutputWorkingDirectory = new OutputFileSystemDirectory("output");
options.SaveOptions = new PdfSaveOptions();
new TeXJob("document.tex", new PdfDevice(), options).Run();
using Aspose.TeX.Features;
using System.Drawing;
using System.IO;
PngMathRendererOptions options = new PngMathRendererOptions
{
Resolution = 300,
Scale = 1000,
TextColor = Color.Black,
BackgroundColor = Color.White
};
PngMathRenderer renderer = new PngMathRenderer();
using (Stream stream = File.Create("formula.png"))
{
renderer.Render(@"\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}", stream, options);
}
using Aspose.TeX;
using Aspose.TeX.IO;
using Aspose.TeX.Presentation.Svg;
TeXOptions options = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX);
options.InputWorkingDirectory = new InputFileSystemDirectory("input");
options.OutputWorkingDirectory = new OutputFileSystemDirectory("output");
options.SaveOptions = new SvgSaveOptions();
new TeXJob("document.tex", new SvgDevice(), options).Run();
using Aspose.TeX.Features;
using Aspose.TeX.IO;
LaTeXRepairerOptions options = new LaTeXRepairerOptions();
options.InputWorkingDirectory = new InputFileSystemDirectory("input");
options.OutputWorkingDirectory = new OutputFileSystemDirectory("output");
new LaTeXRepairer("broken.tex", options).Run();
// Output: broken-fixed.tex (repaired file) + broken.log (validation report)
Aspose.TeX for .NET works in evaluation mode without a license, adding watermarks to the output. To remove evaluation limitations, apply a license before processing:
Aspose.TeX.License license = new Aspose.TeX.License();
license.SetLicense("Aspose.TeX.lic");
Get a temporary license for full-featured evaluation without watermarks.
| Platform | Versions |
|---|---|
| .NET Framework | 4.0 and higher |
| .NET Standard | 2.0 |
| .NET | 6.0, 7.0 |
Supported OS: Windows, Linux, macOS (any platform supporting .NET Standard 2.0+)