MathMatrix class

MathMatrix class

Specifies the Matrix object, consisting of child elements laid out in one or more rows and columns. It is important to note that matrices do not have built in delimiters. To place the matrix in the brackets you should use the delimiter object (IMathDelimiter). Null arguments can be used to create gaps in matrices.

Inheritance:MathMatrixMathElementBase

The MathMatrix type exposes the following members:

Constructors

ConstructorDescription
__init__(self, row_count, column_count)Initializes a new instance of the MathMatrix class.

Properties

PropertyDescription
row_countNumber of rows in the matrix
column_countNumber of columns in the matrix
hide_placeholdersHide the placeholders for empty matrix elements
Default: false
base_justificationSpecifies the vertical justification respect to surrounding text.
Possible values are top, bottom, and center.
Default: Center
min_column_widthMinimum column width in twips (1/20th of a point)
The gap spacing (also referred to as “Column Gap” or “Gap Width”) is added to
the MinColumnWidth to determine the total Matrix Column Spacing
(distance between the same edges of different columns).
Default: 0.
column_gap_ruleThe type of horizontal spacing between columns of a matrix;
Horizontal spacing units can be ems or points (stored as twips).
Default: SingleSpacingGap (0)
column_gapThe value of horizontal spacing between columns of a matrix;
If the ColumnGapRule is set to 3 (“Exactly”), then the unit is interpreted as twips (1/20th of a point)
If the ColumnGapRule is set to 4 (“Multiple”), then the unit is interpreted as number of 0.5 em increments.
In other cases ignored.
Default: 0
row_gap_ruleThe type of vertical spacing between rows of a matrix;
Vertical spacing units can be lines or points (stored as twips).
Default: SingleSpacingGap (0)
row_gapThe value of vertical spacing between rows of a matrix;
If the RowGapRule is set to 3 (“Exactly”), then the unit is interpreted as twips (1/20th of a point)
If the RowGapRule is set to 4 (“Multiple”), then the unit is interpreted as half-lines.
Default: 0

Methods

MethodDescription
join(self, math_element)Joins a mathematical element and forms a mathematical block
join(self, math_text)Joins a mathematical text and forms a mathematical block
divide(self, denominator)Creates a fraction with this numerator and specified denominator
divide(self, denominator)Creates a fraction with this numerator and specified denominator
divide(self, denominator, fraction_type)Creates a fraction of the specified type with this numerator and specified denominator
divide(self, denominator, fraction_type)Creates a fraction of the specified type with this numerator and specified denominator
enclose(self)Encloses a math element in parenthesis
enclose(self, beginning_character, ending_character)Encloses a math element in specified characters such as parenthesis or another characters as framing
function(self, function_argument)Takes a function of an argument using this instance as the function name
function(self, function_argument)Takes a function of an argument using this instance as the function name
as_argument_of_function(self, function_name)Takes specified function using this instance as the argument
as_argument_of_function(self, function_name)Takes specified function using this instance as the argument
as_argument_of_function(self, function_type)Takes specified function using this instance as the argument
as_argument_of_function(self, function_type, additional_argument)Takes specified function using this instance as the argument and specified additional argument
as_argument_of_function(self, function_type, additional_argument)Takes specified function using this instance as the argument and specified additional argument
set_subscript(self, subscript)Creates subscript
set_subscript(self, subscript)Creates subscript
set_superscript(self, superscript)Creates superscript
set_superscript(self, superscript)Creates superscript
set_sub_superscript_on_the_right(self, subscript, superscript)Creates subscript and superscript on the right
set_sub_superscript_on_the_right(self, subscript, superscript)Creates subscript and superscript on the right
set_sub_superscript_on_the_left(self, subscript, superscript)Creates subscript and superscript on the left
set_sub_superscript_on_the_left(self, subscript, superscript)Creates subscript and superscript on the left
radical(self, degree)Specifies the mathematical root of the given degree from the specified argument.
radical(self, degree)Specifies the mathematical root of the given degree from the specified argument.
set_upper_limit(self, limit)Takes upper limit
set_upper_limit(self, limit)Takes upper limit
set_lower_limit(self, limit)Takes lower limit
set_lower_limit(self, limit)Takes lower limit
nary(self, type, lower_limit, upper_limit)Creates a N-ary operator
nary(self, type, lower_limit, upper_limit)Creates a N-ary operator
integral(self, integral_type, lower_limit, upper_limit, limit_locations)Takes the integral
integral(self, integral_type, lower_limit, upper_limit)Takes the integral
integral(self, integral_type)Takes the integral without limits
integral(self, integral_type, lower_limit, upper_limit, limit_locations)Takes the integral
integral(self, integral_type, lower_limit, upper_limit)Takes the integral
group(self)Places this element in a group using a bottom curly bracket
group(self, character, position, vertical_justification)Places this element in a group using a grouping character such as bottom curly bracket or another
to_border_box(self)Places this element in a border-box
to_border_box(self, hide_top, hide_bottom, hide_left, hide_right, strikethrough_horizontal, strikethrough_vertical, strikethrough_bottom_left_to_top_right, strikethrough_top_left_to_bottom_right)Places this element in a border-box
to_math_array(self)Puts in a vertical array
accent(self, accent_character)Sets an accent mark (a character on the top of this element)
overbar(self)Sets a bar on the top of this element
underbar(self)Sets a bar on the bottom of this element
to_box(self)Places this element in a non-visual box (logical grouping)
which is used to group components of an equation or other instance of mathematical text.
A boxed object can (for example) serve as an operator emulator with or without an alignment point,
serve as a line break point, or be grouped such as not to allow line breaks within.
get_column_alignment(self, column_index)Get the horizontal alignment of the specified column
set_column_alignment(self, column_index, val)Set the horizontal alignment of the specified column
set_columns_alignment(self, column_index, columns_count, val)Set the horizontal alignment of the specified columns
insert_row_before(self, row_index)Insert a new row before the specified one
Initially all elements in the new row are None.
insert_row_after(self, row_index)Insert a new row after the specified one
Initially all elements in the new row are None.
delete_row(self, row_index)Deletes the specified row
insert_column_before(self, column_index)Insert a new column before the specified one
Initially all elements in the new column are None.
insert_column_after(self, column_index)Insert a new column after the specified one
Initially all elements in the new column are None.
delete_column(self, column_index)Deletes the specified column
get_children(self)Get children elements

See Also