content转成latex
This commit is contained in:
@@ -2053,7 +2053,7 @@ class Production extends Base
|
|||||||
//整理引用信息的内容
|
//整理引用信息的内容
|
||||||
// $updatedContent = $this->convertReferencesToLatex($article_main_info['content'], $refArray);
|
// $updatedContent = $this->convertReferencesToLatex($article_main_info['content'], $refArray);
|
||||||
//替换其他标签
|
//替换其他标签
|
||||||
$updatedContent = $this->convertToLatex($updatedContent,$refArray);
|
$updatedContent = $this->convertToLatex($article_main_info['content'],$refArray);
|
||||||
//做内容替换
|
//做内容替换
|
||||||
$article_main_info['content'] = $updatedContent;
|
$article_main_info['content'] = $updatedContent;
|
||||||
$fragContentList[] = $article_main_info;
|
$fragContentList[] = $article_main_info;
|
||||||
@@ -2095,6 +2095,8 @@ class Production extends Base
|
|||||||
->where('state', 0)
|
->where('state', 0)
|
||||||
->order('index ASC')
|
->order('index ASC')
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
|
||||||
$refArray = [];
|
$refArray = [];
|
||||||
foreach ($references as $ref) {
|
foreach ($references as $ref) {
|
||||||
$refArray[$ref['index'] + 1] = $ref;
|
$refArray[$ref['index'] + 1] = $ref;
|
||||||
@@ -2112,7 +2114,10 @@ class Production extends Base
|
|||||||
if (empty(trim($content))) {
|
if (empty(trim($content))) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
$content = str_replace("–","-",$content);
|
||||||
|
|
||||||
$content = $this->convertReferencesToLatex($content, $refArray);
|
$content = $this->convertReferencesToLatex($content, $refArray);
|
||||||
|
|
||||||
// 步骤1:忽略并移除<tr>、</tr>和<nbsp/>标签
|
// 步骤1:忽略并移除<tr>、</tr>和<nbsp/>标签
|
||||||
$content = $this->removeIgnoredTags($content);
|
$content = $this->removeIgnoredTags($content);
|
||||||
|
|
||||||
@@ -2428,7 +2433,7 @@ class Production extends Base
|
|||||||
'%' => '\\%',
|
'%' => '\\%',
|
||||||
'#' => '\\#',
|
'#' => '\\#',
|
||||||
'&' => '\\&',
|
'&' => '\\&',
|
||||||
'_' => '\\_',
|
// '_' => '\\_',
|
||||||
'^' => '\\textasciicircum',
|
'^' => '\\textasciicircum',
|
||||||
'~' => '\\textasciitilde',
|
'~' => '\\textasciitilde',
|
||||||
];
|
];
|
||||||
@@ -2619,7 +2624,6 @@ class Production extends Base
|
|||||||
function ($matches) use ($references) {
|
function ($matches) use ($references) {
|
||||||
// 去除匹配中的 <blue> 和 </blue>
|
// 去除匹配中的 <blue> 和 </blue>
|
||||||
$cleanedMatch = str_replace(['<blue>', '</blue>'], '', $matches[0]);
|
$cleanedMatch = str_replace(['<blue>', '</blue>'], '', $matches[0]);
|
||||||
|
|
||||||
// 提取引用编号部分(去掉方括号)
|
// 提取引用编号部分(去掉方括号)
|
||||||
$referencePart = trim($cleanedMatch, '[]');
|
$referencePart = trim($cleanedMatch, '[]');
|
||||||
|
|
||||||
@@ -2647,7 +2651,6 @@ class Production extends Base
|
|||||||
// 单个引用编号处理
|
// 单个引用编号处理
|
||||||
$index = intval($part);
|
$index = intval($part);
|
||||||
$arrayIndex = $index;
|
$arrayIndex = $index;
|
||||||
|
|
||||||
if (isset($references[$arrayIndex]) && !empty($references[$arrayIndex]['p_refer_id'])) {
|
if (isset($references[$arrayIndex]) && !empty($references[$arrayIndex]['p_refer_id'])) {
|
||||||
$latexRefs[] = 'ref_' . $references[$arrayIndex]['p_refer_id'];
|
$latexRefs[] = 'ref_' . $references[$arrayIndex]['p_refer_id'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user