latex update

This commit is contained in:
wangjinlei
2026-01-07 09:26:26 +08:00
parent 87f6a01c94
commit ef8c7de183

View File

@@ -2226,7 +2226,18 @@ class Production extends Base
return ''; return '';
} }
//单行处理公式内容 //单行处理公式内容
$pattern = '/^<wmath\s+data-latex="([^"]*)">.*<\/wmath>$/';
if(preg_match($pattern, $content) === 1){
$pattern1 = '/<wmath\s+data-latex="([^"]*)">/';
if (preg_match($pattern1, $content, $matches)) {
$latexContent = $matches[1];
// 将 $$ 转换为 $因为equation环境不需要$$
$latexContent = str_replace('$$', '', $latexContent);
return "\\begin{equation}\n\t{$latexContent}\n\\end{equation}";
}
return $content;
}