Class MathRendererPlugin

MathRendererPlugin class

MathRenderer plugin class. The example shows how to render a LaTeX formula in PNG.

// Create MathRenderer.
MathRendererPlugin renderer = new MathRendererPlugin();
// Create the PngMathRendererPluginOptions instance and set up options.
PngMathRendererPluginOptions options = new PngMathRendererPluginOptions()
{
    BackgroundColor = Color.Yellow,
    TextColor = Color.Blue,
    Resolution = 150,
    Margin = 10,
    Preamble = "LaTeX preamble"
};
// Add a source formula.
options.AddInputDataSource(new StringDataSource("LaTeX formula"));
// Create a stream to write the image to.
using (Stream stream = File.Open("output path", FileMode.Create))
{
    // Add an output stream.
    options.AddOutputDataTarget(new StreamDataSource(stream));
    // Run the process.
    ResultContainer result = renderer.Process(options);
}
public class MathRendererPlugin : IDisposable, IPlugin

Constructors

NameDescription
MathRendererPlugin()The default constructor.

Methods

NameDescription
Dispose()Disposes this instance.
Process(IPluginOptions)Runs Math Renderer processing with the specified parameters.

See Also