Class MatrixEquationNode
Contents
[
Hide
]MatrixEquationNode class
This class specifies the Matrix equation, consisting of one or more elements laid out in one or more rows and one or more columns.
public class MatrixEquationNode : EquationNode
Properties
| Name | Description | 
|---|---|
| BaseJc { get; set; } | This attribute specifies the justification of the matrix. Text outside of the matrix can be aligned with the bottom, top, or center of a matrix function. Default, the matrix assumes center justification. | 
| EquationType { get; } | Get the equation type of the current node(Inherited from EquationNode.) | 
| Font { get; } | Returns the font of this object.(Inherited from FontSetting.) | 
| IsHidePlaceholder { get; set; } | This attribute specifies the Hide Placeholders property on a matrix. When this property is on, placeholders do not appear in the matrix.Default, placeholders do appear such that the locations where text can be inserted are made visible. | 
| Length { get; } | Gets the length of the characters.(Inherited from FontSetting.) | 
| ParentNode { get; set; } | Specifies the parent node of the current node(Inherited from EquationNode.) | 
| StartIndex { get; } | Gets the start index of the characters.(Inherited from FontSetting.) | 
| TextOptions { get; } | Returns the text options.(Inherited from FontSetting.) | 
| override Type { get; } | Represents the type of the node.(Inherited from EquationNode.) | 
Methods
| Name | Description | 
|---|---|
| AddChild(EquationNode) | Inserts the specified node at the end of the current node’s list of child nodes.(Inherited from EquationNode.) | 
| AddChild(EquationNodeType) | Insert a node of the specified type at the end of the child node list of the current node.(Inherited from EquationNode.) | 
| override Equals(object) | Determine whether the current equation node is equal to the specified node | 
| GetChild(int) | Returns the node at the specified index among the children of the current node.(Inherited from EquationNode.) | 
| InsertAfter(EquationNodeType) | Inserts the specified node after the current node.(Inherited from EquationNode.) | 
| InsertBefore(EquationNodeType) | Inserts the specified node before the current node.(Inherited from EquationNode.) | 
| InsertChild(int, EquationNodeType) | Inserts a node of the specified type at the specified index position in the current node’s child node list.(Inherited from EquationNode.) | 
| Remove() | Removes itself from the parent.(Inherited from EquationNode.) | 
| RemoveAllChildren() | Removes all the child nodes of the current node.(Inherited from EquationNode.) | 
| RemoveChild(EquationNode) | Removes the specified node from the current node’s children.(Inherited from EquationNode.) | 
| RemoveChild(int) | Removes the node at the specified index from the current node’s children.(Inherited from EquationNode.) | 
| SetWordArtStyle(PresetWordArtStyle) | Sets the preset WordArt style.(Inherited from FontSetting.) | 
| ToLaTeX() | Convert this equtation to LaTeX expression.(Inherited from EquationNode.) | 
| ToMathML() | Convert this equtation to MathML expression.(Inherited from EquationNode.) | 
Examples
using System;
using Aspose.Cells;
using Aspose.Cells.Drawing;
using Aspose.Cells.Drawing.Equations;
namespace AsposeCellsExamples
{
    public class EquationsClassMatrixEquationNodeDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            
            // Add a textbox with equation to the first worksheet
            TextBox textBox = workbook.Worksheets[0].Shapes.AddEquation(3, 0, 3, 0, 100, 200);
            // Get the equation paragraph and add a matrix node
            EquationNode mathNode = textBox.GetEquationParagraph().GetChild(0);
            MatrixEquationNode matrixNode = (MatrixEquationNode)mathNode.AddChild(EquationNodeType.Matrix);
            // Set matrix properties
            matrixNode.BaseJc = EquationVerticalJustificationType.Bottom;
            matrixNode.IsHidePlaceholder = true;
            // Add 2x2 matrix with 1s on diagonal
            for (int i = 0; i < 2; i++)
            {
                EquationNode rowNode = matrixNode.AddChild(EquationNodeType.MatrixRow);
                for (int j = 0; j < 2; j++)
                {
                    EquationNode baseNode = rowNode.AddChild(EquationNodeType.Base);
                    TextRunEquationNode textNode = (TextRunEquationNode)baseNode.AddChild(EquationNodeType.Text);
                    textNode.Text = (i == j) ? "1" : "0";
                }
            }
            // Save the workbook
            string outputPath = "MatrixEquationDemo.xlsx";
            workbook.Save(outputPath);
            Console.WriteLine("Matrix equation created successfully. File saved to: " + outputPath);
        }
    }
}
See Also
- class EquationNode
 - namespace Aspose.Cells.Drawing.Equations
 - assembly Aspose.Cells