From ef8c7de1835cb04eb41e610c7ec513654270a963 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 7 Jan 2026 09:26:26 +0800 Subject: [PATCH] latex update --- application/api/controller/Production.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index f6b6a3e..d7703c4 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -2226,7 +2226,18 @@ class Production extends Base return ''; } //单行处理公式内容 + $pattern = '/^.*<\/wmath>$/'; + if(preg_match($pattern, $content) === 1){ + $pattern1 = '//'; + 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; + }