# OfficeMathMarkup

MathML and LaTeX conversion for the shared mathematical expression tree.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`013c05ace7bb` with working tree changes

**Source**

[OfficeMathMarkup.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L16)

**Modifiers**

static

MathML and LaTeX conversion for the shared mathematical expression tree.

## Inheritance

- object
- OfficeMathMarkup

Filter members 

Show inherited

## Methods

FromLatex 2 overloads

`public static OfficeMathExpression FromLatex(string latex)` [#](#method-fromlatex-string)

[OfficeMathMarkup.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L49)

Parses common LaTeX math constructs without requiring a TeX runtime.

Parameters

**latex string required**

Returns

`OfficeMathExpression`

`public static OfficeMathExpression FromLatex(string latex, int maximumDepth)` [#](#method-fromlatex-string-int32)

[OfficeMathMarkup.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L53)

Parses common LaTeX math constructs with a hard nesting-depth limit.

Parameters

**latex string required**

**maximumDepth int required**

Returns

`OfficeMathExpression`

FromMathMl 2 overloads

`public static OfficeMathExpression FromMathMl(string mathMl)` [#](#method-frommathml-string)

[OfficeMathMarkup.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L23)

Parses presentation MathML into the shared expression tree.

Parameters

**mathMl string required**

Returns

`OfficeMathExpression`

`public static OfficeMathExpression FromMathMl(string mathMl, int maximumDepth)` [#](#method-frommathml-string-int32)

[OfficeMathMarkup.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L27)

Parses presentation MathML with a hard nesting-depth limit.

Parameters

**mathMl string required**

**maximumDepth int required**

Returns

`OfficeMathExpression`

`public static string ToLatex(OfficeMathExpression expression)` [#](#method-tolatex-officeimo-drawing-officemathexpression)

[OfficeMathMarkup.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L42)

Serializes an expression as portable LaTeX math source.

Parameters

**expression OfficeIMO.Drawing.OfficeMathExpression required**

Returns

`string`

`public static string ToMathMl(OfficeMathExpression expression, bool display = false)` [#](#method-tomathml-officeimo-drawing-officemathexpression-boolean)

[OfficeMathMarkup.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L16)

Serializes an expression as presentation MathML.

Parameters

**expression OfficeIMO.Drawing.OfficeMathExpression required**

**display bool = false optional**

Returns

`string`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Fields

`public const int DefaultMaximumParseDepth` [#](#field-defaultmaximumparsedepth)

[OfficeMathMarkup.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/013c05ace7bb14e293639941ec9cf54eb5177a90/OfficeIMO.Core/Math/OfficeMathMarkup.cs#L12)

Default maximum nested structure depth accepted by portable math parsers.

Value: `128`

<!-- PowerForge markdown artifact sha256:496985361E2CA5433F439A24C8625326AF6C26E242A3B9D19EE15AFF7344806B -->
