Skip to main content

postprocess_math_xml

Function postprocess_math_xml 

Source
pub fn postprocess_math_xml(
    document_xml: &str,
    math: &[(String, String, bool)],
) -> String
Expand description

把 document.xml 中的 Math 占位标记替换为原生 <m:oMath> 元素。

§参数

§返回

替换完成后的 document.xml。每个占位段落(<w:p> 内含标记 run)被 替换为包含 <m:oMath>(行内)或 <m:oMathPara>(块级、居中)的段落; 根元素补充 xmlns:m 声明。无法转换的公式保留 LaTeX 文本 ($$...$$ / $...$ 形式),保证内容不丢失。

§错误

无(转换失败时回退为 LaTeX 文本,由 latex_to_omml::convert 的 严格错误通道保证不静默丢内容)。