跳到主要内容

AddMathEquation

Adds a math equation to the current presentation.

Syntax

expression.AddMathEquation(sText, sFormat);

expression - A variable that represents a ApiPresentation class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTextRequiredstringThe math equation text.
sFormatRequiredstringThe math equation format. Possible values are "unicode" and "latex".

Returns

boolean

Example

This example adds a math equation to the document.

const equation = "e^x = 1 + x + \\frac{x^2}{2} + \\frac{x^3}{6} + \\cdots = \\sum_{n\\geq 0} \\frac{x^n}{n!}";
const presentation = Api.GetPresentation();
presentation.AddMathEquation(equation, "latex");