Class OdfFormulaLatexConverter
Converts between LaTeX formula strings and MathML XML structures. 提供 LaTeX 公式字串與 MathML XML 結構之間的轉換器。
public static class OdfFormulaLatexConverter
- Inheritance
-
OdfFormulaLatexConverter
- Inherited Members
Methods
Convert(string)
Converts a LaTeX formula string to a standard MathML XML string. 將 LaTeX 公式字串轉換為標準 MathML XML 字串。
public static string Convert(string latex)
Parameters
latexstringThe LaTeX formula string. / LaTeX 公式字串。
Returns
- string
The standard MathML XML string. / 標準 MathML XML 字串。
Exceptions
- ArgumentNullException
- ArgumentException
When the LaTeX formula syntax is invalid. / 當 LaTeX 公式語法錯誤時擲出。
ToLatex(IReadOnlyList<OdfMathToken>)
Converts a set of OdfMathToken tokens back to a LaTeX formula string on a best-effort basis. 將一組 OdfMathToken token 反向轉換為 LaTeX 公式字串(best-effort)。
public static string ToLatex(IReadOnlyList<OdfMathToken> tokens)
Parameters
tokensIReadOnlyList<OdfMathToken>The token list to convert. / 要轉換的 token 清單。
Returns
- string
The LaTeX formula string. / LaTeX 公式字串。
Remarks
Because LaTeX and MathML are not a one-to-one mapping, some semantics may not be fully preserved. 因 LaTeX 與 MathML 並非一對一對應,部分語意可能無法完整保留。