rime中州韵小狼毫 LaTex输入法配置

news2024/11/18 21:52:24

教程目录:rime中州韵小狼毫须鼠管安装配置教程 保姆级教程 100+增强功能配置教程

本文的分享一种在rime中州韵小狼毫须鼠管输入法中配置LaTex输入方案的方法,并不完美,仅供参考。

先睹为快

LaTex输入方案可以快捷的在公式模式下输入一些基础的数学公式,选词快捷,录入体验优良。
20240113151824_rec_

latex.schema.yaml

latex.schema.yaml 是我们的输入方案的方案文档,我们在 用户文件夹 下创建一个 txt 文档,然后改名为 latex.schema.yaml,latex.schema.yaml文档内容如下👇:

switches:
  - name: ascii_mode			# 默认为中文输出模式
    reset: 0
    states: [ 中文, 西文 ]
  - name: full_shape			# 字符默认半角输出
    reset: 0
    states: [ 半角, 全角 ]
  - name: ascii_punct			# 默认使用英文标点
    reset: 1
    states: [ 。,, ., ]
  - name: debug					# 默认debug开关为关闭状态
    reset: 0
    states: [Off, 🐞]

engine:
  processors:
    - ascii_composer
    - key_binder
    - speller
    - recognizer
    - punctuator
    - selector
    - navigator
    - express_editor
  segmentors:
    - matcher
    - ascii_segmentor
    - abc_segmentor
    - punct_segmentor
    - fallback_segmentor
  translators:
    - table_translator
    - punct_translator
  filters:
    - uniquifier
key_binder:
  import_preset: default
  speller:
    auto_select: true
    delimiter: " ;'"
recognizer:
  import_preset: default
  patterns:
    email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
    url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
schema:
  author:
    - "dyy <douyaoyuan@126.com>"
  description: "LaTex 公式输入"
  name: "LaTex"
  schema_id: latex
  version: 0.2
speller:
  alphabet: "zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA_|\\/<>-+=^()[]{}<"	# 定义输入字符的识别格式
  delimiter: " "
translator:
  dictionary: latex
  spelling_hints: 9

在上述脚本配置中,我们的schema节点中配置了以下内容:

  • schema_idlatex;这个schema_id将会在下文的default.custom.yaml中用到
  • nameLaTex;这个name的值LaTex将会出现在方案选单

latex.custom.yaml

一如既往,方案名.custom.yaml是对应方案文档的补丁文档,这个latex.custom.yaml文档中配置了用户的个性化的配置项目,此处latex.custom.yaml文档的配置如下👇:

patch:
  translator/enable_user_dict: false				# false:自动造词及动态词频功能失效;true:启用自动造词和动态词频
  style/inline_preedit: false						# 是否在输入行内进行预测生成,true 表示不单独显示输入字符
  engine/translators/+:								# 增加以下翻译器
    - lua_translator@latex_translator
    - lua_translator@latexHelp_translator
  punctuator:
    import_preset: symbols
    half_shape:
      "-": "-"
      "|": "|"
      "^": "^"
      "]": "]"
      "[": "["
      ")": ")"
      "(": "("
      "<": "<"
      ">": ">"
  custom_phrase:
    encode_commit_history: false
    disable_user_dict_for_patterns:
    #  - "^z.*$"									# 这是原始默认设置
      - "^[a-y]{1,3}$"								# 三码及以下不使用自动调频、不自动造词

在以上配置中,我们为latex输入方案指定了以下关键配置:

  • 翻译器lua_translator@latex_translator:这个latex_translator的脚本文档将在下文中介绍。
  • 翻译器lua_translator@latexHelp_translator:这个latexHelp_translator的脚本文档将在下文中介绍。

latex.dict.yaml

latex.dict.yamlLaTex输入方案的字典文档,在该文档中我们定义了一些词组和按键的映射关系,latex.dict.yaml文档中的内容如下👇:

# Rime dictionary
# mim: set ts=8 sw=8 noet:
# encoding: utf-8
#
# latex - Latex
#
# dyy <douyaoyuan@126.com>
#

---
name: latex
version: "0.1"
sort: by_weight #defaut:使用字典文档顺序;by_weight:使用权重进行排序
use_preset_vocabulary: false
...
#关于词表定义及词序权重的说明
#词表定义格式如下:
#输出项	编码	权重
#关于权重,数字大者,其在候选框内出现的位置则靠前,如果没有指定权重值,则以词表定时次序排序

#常用组合
$$\textcolor{blue}{解:}$$	qev
$$\textcolor{blue}{证:}$$	ygh

👆上述字典中的内容很少,关于latex输入方案中的候选词组,更多需要依靠lua_translator生成,这我们下文中会有介绍.

default.custom.yaml

上文中我们定义了新的输入方案 latex,我们需要在 default.custom.yaml 中的方案选单中配置该输入方案,以便我们可以选择使用latex输入方案。default.custom.yaml中的配置如下👇:

patch:
  ascii_composer/switch_key:
    Caps_Lock: commit_code  # 候选状态下,按 Caps_Lock 后编码上屏
    Control_L: noop  # 左 ctrl 键无使用效果
    Control_R: noop  # 右 ctrl 键无使用效果
    Eisu_toggle: clear  # 按 Esc 键,清除候选编码,退出候选框
    Shift_L: commit_code  # 候选状态下,按 左 Shift 后,编码上屏
    Shift_R: commit_code  # 候选状态下,按 右 Shift 后,编码上屏
  ascii_composer:
    good_old_caps_lock: true  # true 通过 caps lock 键切换入英文模式后,保持大写输入状态
  engine/filters:
    - simplifier  # 引入简体拼音输入法过滤器
    - uniquifier  # 过滤重复候选项,依赖 simplifier
  key_binder/bindings:
    - {accept: semicolon, send: 2, when: has_menu}  # 使用 ; 键选择第 2 候选词
    - {accept: apostrophe, send: 3, when: has_menu}  # 使用 . 键选择第 3 候选词
    - {accept: bracketleft, send: Page_Up, when: paging}  # 使用 PageUp 键向上翻页
    - {accept: bracketright, send: Page_Down, when: has_menu}  # 使用 PageDown 键向下翻页
  menu/page_size: 10  # 存在候选词选项时,每一页显示的候选词数量,最大是 10
  recognizer/patterns/punct: "^/([0-9]0?|[A-Za-z]+)$"  # 标点符号识别模式
  schema_list:
    - {schema: wubi_pinyin}			# 五笔・拼音 输入方案
    - {schema: easy_en}				# 英文输入方案
    - {schema: latex}				# latex输入方案
    - {schema: pinyin}				# 拼音输入
  switcher:
    abbreviate_options: true  # 功能选项显示为简写模式
    caption: "〔方案选单〕"  # 选项菜单的名字
    fold_options: true  # 功能选项折叠显示
    hotkeys: [F8]  # 使用 F8 键调出 方案选单

👆以上配置中,请注音观察schema_list节点下第三个schema的内容。

rime.lua

pinyin 输入方案中我们使用到了lua_translatorlua_filter,我们在rime.lua中增加一个translator翻译器和一个filter滤镜,rime.lua中的配置如下👇:

help_translator = require("help")
inputShow_translator = require("inputShow")
inputShow_Filter = require("inputShow_Filter")
Upper_Filter = require("Upper_Filter")
dic_4w_Filter = require("dic_4w_Filter")
phraseReplace_Filter = require("phraseReplace_Filter")
pinyinAdding_Filter = require("pinyinAdding_Filter")
dateTime_Filter = require("dateTime_filter")
dynamicPhrase_Filter = require("dynamicPhrase_Filter")
phraseExt_Filter = require("phraseExt_Filter")
phraseComment_Filter = require("phraseComment_Filter")
pinyin_translator = require("pinyin_translator")
pinyin_Filter = require("pinyin_Filter")
latexHelp_translator = require("latexHelp_translator")
latex_translator = require("latex_translator")

👆以上lua脚本中,注意观察最后两行内容。

💣注意:
以上所述default.custom.yamllatex.custom.yamllatex.schema.yamllatex.dict.yamlrime.lua 五个文档,应该位于 用户文件夹 下,如下👇:
20240113153723

latex_translator.lua

latex_translator.lua 是一个lua脚本,脚本实现了rime引擎的lua_translator翻译器接口;latex_translator.lua脚本实现了用户输入编码向latex词组翻译的功能。latex_translator.lua脚本内容如下👇:

--lua语言中的注释用“--” 
--声明全局变量

local colorName={"apricot",
				"aquamarine",
				"bittersweet",
				"black",
				"blue",
				"bluegreen",
				"blueviolet",
				"brickred",
				"brown",
				"burntorange",
				"cadetblue",
				"carnationpink",
				"cerulean",
				"cornflowerblue",
				"cyan",
				"dandelion",
				"darkorchid",
				"emerald",
				"forestgreen",
				"fuchsia",
				"goldenrod",
				"gray",
				"green",
				"greenyellow",
				"junglegreen",
				"lavender",
				"limegreen",
				"magenta",
				"mahogany",
				"maroon",
				"melon",
				"midnightblue",
				"mulberry",
				"navyblue",
				"olivegreen",
				"orange",
				"orangered",
				"orchid",
				"peach",
				"periwinkle",
				"pinegreen",
				"plum",
				"processblue",
				"purple",
				"rawsienna",
				"red",
				"redorange",
				"redviolet",
				"rhodamine",
				"royalblue",
				"royalpurple",
				"rubinered",
				"salmon",
				"seagreen",
				"sepia",
				"skyblue",
				"springgreen",
				"tan",
				"tealblue",
				"thistle",
				"turquoise",
				"violet",
				"violetred",
				"white",
				"wildstrawberry",
				"yellow",
				"yellowgreen",
				"yelloworange"
				}

local  xlNamesArry={
					{"alph","alpha","Alpha"},
					{"beta","beta","Beta"},
					{"delt","delta","Delta","varDelta"},
					{"epsi","varepsilon ","epsilon ","Epsilon"},
					{"gamm","gamma","varGamma","Gamma","digamma"},
					{"kapp","kappa","varkappa","Kappa"},
					{"iota","iota","Iota"},
					{"lamb","lambda","Lambda","varLambda"},
					{"omeg","omega","Omega","varOmega"},
					{"omic","omicron","Omicron"},
					{"upsi","upsilon","Upsilon","varUpsilon"},
					{"sigm","sigma","Sigma","varSigma","varsigma"},
					{"thet","theta","vartheta","Theta","varTheta"},
					{"zeta","zeta","Zeta"},
					{"chi","chi","Chi"},
					{"eta","eta","Eta"},
					{"phi","varphi","phi","Phi","varPhi"},
					{"psi","psi","Psi","varPsi"},
					{"rho","rho","varrho","Rho"},
					{"tau","tau","Tau"},
					{"mu","mu","Mu"},
					{"nu","nu","Nu"},
					{"pi","pi","Pi","varPi","varpi"},
					{"xi","xi","Xi","varXi"}
					}

function translator(input, seg)
	--声名局部变量
	local debugFlg=false
	local returnFlg=false
	local matchFlg=false
	local patterns=""
	local pattern=""
	local subpattern=""
	local str=""
	local subStr_0=""
	local subStr_1=""
	local keyW=""
	local keyW_1=""
	local keyW_2=""
	local keyW_3=""
	local keyW_u=""
	local keyW_sub=""
	local varW=""
	local varW_1=""
	local varW_2=""
	local varW_3=""
	local pos=0
	
	--在候选词中使用 '\r' 或者 '\013' 可以输出换行效果
	--在候选词中使用 '\t' 或者 '\009' 可以输出水平制表符
	--如果候选词中出现 '\n' 或者 '\010' 输入法程序会卡死退出
	
	if input == "test" and debugFlg then
		--使用键值的方式,通过单引号表示这是一个字符,而不是 '\0' 转义
		yield(Candidate("latex", seg.start, seg._end,"第一行"..'\013'.."第二行"..'\013'.."第三行", " "))
		--使用字符的方式,以下两种均可
		yield(Candidate("latex", seg.start, seg._end,"第一行"..'\r'.."第二行"..'\r'.."第三行", " "))
		yield(Candidate("latex", seg.start, seg._end,"第一行\r第二行\r第三行", " "))
		
		matchFlg=true
		returnFlg=true
	elseif input == "help" then
		--help 作为特殊输入,不做latters翻译
		returnFlg=true
	end
	
	if returnFlg then
		return 0
	end
	
	--初始化标志位
	returnFlg=false
	matchFlg = false
	
	--匹配颜色名称
	patterns={"clr[a-z]+"}
	for idx,pattern in ipairs(patterns) do
		if string.match(input,pattern)~=nil then
			str=string.match(input,"("..pattern..")")
			keyW=string.sub(str,1,3)
			varW=string.sub(str,4,string.len(str))
			
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: ".. pattern..", "..str, " "))
			end
			
			matchFlg=false
			for cidx,cname in ipairs(colorName) do
				if varW==cname then
					--命名完全相符的
					if matchFlg==false then
						matchFlg=true
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, cname, 1), " "))
				end
			end
			
			for cidx,cname in ipairs(colorName) do
				if varW==string.sub(cname,1,string.len(varW)) then
					--命名在起始位置的
					if matchFlg==false then
						matchFlg=true
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, cname, 1), " "))
				end
			end
			
			for cidx,cname in ipairs(colorName) do
				if string.find(cname,varW,2)~=nil then
					--命名在中间位置的
					if matchFlg==false then
						matchFlg=true
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, cname, 1), " "))
				end
			end
			
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--匹配带颜色的字符片段
	patterns={"tc[a-z]+","box[a-z]+"} 
	for idx,pattern in ipairs(patterns) do
		if string.match(input,pattern)~=nil then
			str=string.match(input,"("..pattern..")")
			keyW=string.sub(str,1,2)
			if keyW=="tc" then
				varW=string.sub(str,3,string.len(str))
			else
				keyW=string.sub(str,1,3)
				varW=string.sub(str,4,string.len(str))
			end
			
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: ".. pattern..", "..str, " "))
			end
			
			matchFlg=false
			for cidx,cname in ipairs(colorName) do
				if varW==cname then
					--命名完全相符的
					if matchFlg==false then
						matchFlg=true
					end
					if keyW=="tc" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\textcolor{"..cname.."}{}", 1), " "))
					elseif keyW=="box" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\fcolorbox{"..cname.."}{white}{}", 1), " "))
					end
				end
			end
			
			for cidx,cname in ipairs(colorName) do
				if varW==string.sub(cname,1,string.len(varW)) then
					--命名在起始位置的
					if matchFlg==false then
						matchFlg=true
					end
					if keyW=="tc" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\textcolor{"..cname.."}{}", 1), " "))
					elseif keyW=="box" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\fcolorbox{"..cname.."}{white}{}", 1), " "))
					end
				end
			end
			
			for cidx,cname in ipairs(colorName) do
				if string.find(cname,varW,2)~=nil then
					--命名在中间位置的
					if matchFlg==false then
						matchFlg=true
					end
					if keyW=="tc" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\textcolor{"..cname.."}{}", 1), " "))
					elseif keyW=="box" then
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\fcolorbox{"..cname.."}{white}{}", 1), " "))
					end
				end
			end
			
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--4字符关键字匹配 之 反三角函数匹配
	patterns={"asin","acos","acos","atan","acot"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: 反三角函数匹配", " "))
			end
			
			if pattern=="acot" then
				keyW = "{\\rm arccot}"
			elseif pattern=="arccot" then
				keyW = "{\\rm arccot}"
			else
				keyW = "\\"..string.sub(pattern,1,1).."rc"..string.sub(pattern,2)
			end
			local thisPattern=""
			
			--匹配希腊字母参数
			for xlidx,xlNames in ipairs(xlNamesArry) do
				local nameKey=xlNames[1]
				--生成xl字符名称
				local names={}
				for k,v in ipairs(xlNames) do
					if k>1 then
						table.insert(names,v)
					end
				end
				
				if(string.match(input,pattern..".+_")~=nil) then
					--匹配希腊字母带下标
					thisPattern=pattern..nameKey.."_"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{n}}",1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{0}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				elseif(string.match(input,pattern..".+^")~=nil) then
					--匹配希腊字母本身带上标
					thisPattern=pattern..nameKey.."^"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{n}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				else
					--匹配希腊字母本身
					thisPattern=pattern..nameKey
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{\\"..name.."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{\\"..name.."}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				break
			end
			
			--匹配正常字母参数
			thisPattern=pattern.."[a-zA-Z][_^]?"
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				varW=string.sub(str,string.len(pattern)+1,string.len(pattern)+1)
				varW_1=string.sub(str,string.len(str))
				
				if varW_1=='_' then
					--匹配正常字母参数,带下标
					for i=1,8 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{n}}",1), " "))
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{0}}",1), " "))
					
					--标记过程状态
					matchFlg=true
				elseif varW_1=='^' then
					--匹配正常字母参数,带上标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{n}}",1), " "))
					--标记过程状态
					matchFlg=true
				else
					--匹配正常字母参数,无上下标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{"..varW.."}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{"..varW.."}",1), " "))
					--标记过程状态
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
			
			--匹配无参数
			thisPattern=pattern
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end
	
	--3字符关键字匹配 之 反双曲函数匹配
	patterns={"ash","ach","ath"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: 反双曲函数匹配", " "))
			end
			
			keyW = "{\\rm "..string.sub(pattern,1,1)..'r'..string.sub(pattern,2).."}"
			
			local thisPattern=""
			
			--匹配希腊字母参数
			for xlidx,xlNames in ipairs(xlNamesArry) do
				local nameKey=xlNames[1]
				--生成xl字符名称
				local names={}
				for k,v in ipairs(xlNames) do
					if k>1 then
						table.insert(names,v)
					end
				end
				
				if(string.match(input,pattern..".+_")~=nil) then
					--匹配希腊字母带下标
					thisPattern=pattern..nameKey.."_"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{n}}",1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{0}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				elseif(string.match(input,pattern..".+^")~=nil) then
					--匹配希腊字母本身带上标
					thisPattern=pattern..nameKey.."^"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{n}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				else
					--匹配希腊字母本身
					thisPattern=pattern..nameKey
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{\\"..name.."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{\\"..name.."}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				break
			end
			
			--匹配正常字母参数
			thisPattern=pattern.."[a-zA-Z][_^]?"
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				varW=string.sub(str,string.len(pattern)+1,string.len(pattern)+1)
				varW_1=string.sub(str,string.len(str))
				
				if varW_1=='_' then
					--匹配正常字母参数,带下标
					for i=1,8 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{n}}",1), " "))
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{0}}",1), " "))
					
					--标记过程状态
					matchFlg=true
				elseif varW_1=='^' then
					--匹配正常字母参数,带上标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{n}}",1), " "))
					--标记过程状态
					matchFlg=true
				else
					--匹配正常字母参数,不带上下标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{"..varW.."}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{"..varW.."}",1), " "))
					--标记过程状态
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
			
			--匹配无参数
			thisPattern=pattern
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end
	
	--5字符关键字匹配 之 双曲函数匹配
	patterns={"sech","csch","sh","ch","th","cth"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: 双曲三角函数匹配", " "))
			end
			
			if pattern=="sech" then
				keyW = "{\\rm sech}"
			elseif pattern=="csch" then
				keyW = "{\\rm csch}"
			elseif pattern=="sinh" then
				keyW = "\\sh"
			elseif pattern=="cosh" then
				keyW = "\\ch"
			elseif pattern=="tanh" then
				keyW = "\\th"
			elseif pattern=="coth" then
				keyW = "\\cth"
			else
				keyW = "\\"..pattern
			end
			local thisPattern=""
			
			--匹配希腊字母参数
			for xlidx,xlNames in ipairs(xlNamesArry) do
				local nameKey=xlNames[1]
				--生成xl字符名称
				local names={}
				for k,v in ipairs(xlNames) do
					if k>1 then
						table.insert(names,v)
					end
				end
				
				if(string.match(input,pattern..".+_")~=nil) then
					--匹配希腊字母带下标
					thisPattern=pattern..nameKey.."_"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{n}}",1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{0}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				elseif(string.match(input,pattern..".+^")~=nil) then
					--匹配希腊字母本身带上标
					thisPattern=pattern..nameKey.."^"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{n}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				else
					--匹配希腊字母本身
					thisPattern=pattern..nameKey
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{\\"..name.."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{\\"..name.."}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				break
			end
			
			--匹配正常字母参数
			thisPattern=pattern.."[a-zA-Z][_^]?"
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				varW=string.sub(str,string.len(pattern)+1,string.len(pattern)+1)
				varW_1=string.sub(str,string.len(str))
				
				if varW_1=='_' then
					--匹配正常字母参数,带下标
					for i=1,8 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{n}}",1), " "))
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{0}}",1), " "))
					
					--标记过程状态
					matchFlg=true
				elseif varW_1=='^' then
					--匹配正常字母参数,带上标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{n}}",1), " "))
					--标记过程状态
					matchFlg=true
				else
					--匹配正常字母参数,不带上下标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{"..varW.."}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{"..varW.."}",1), " "))
					--标记过程状态
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
			
			--匹配无参数
			thisPattern=pattern
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end
	
	--4+字符关键字匹配 之 微商匹配
	patterns={"d[a-zA-Z]+d[a-zA-Z]+_?"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: 微商匹配", " "))
			end
			
			local thisPattern=""
			
			--匹配希腊字母因变量
			for bidx,yNames in ipairs(xlNamesArry) do
				local yNameKey=yNames[1]
				if(string.match(input,"d"..yNameKey.."d[a-zA-Z]+_?")~=nil) then
					--生成xl字符名称
					local yNameNames={}
					for k,v in ipairs(yNames) do
						if k>1 then
							table.insert(yNameNames,v)
						end
					end
					
					--匹配希腊字母自变量
					for xidx,xNames in ipairs(xlNamesArry) do
						local xNameKey=xNames[1]
						--生成xl字符名称
						local xNameNames={}
						for k,v in ipairs(xNames) do
							if k>1 then
								table.insert(xNameNames,v)
							end
						end
						
						--带下标场景
						thisPattern="d"..yNameKey.."d"..xNameKey.."_"
						if(string.match(input,thisPattern)~=nil) then
							--dpsidphi_类的输入
							for fk,fn in ipairs(yNameNames) do
								for xk,xn in ipairs(xNameNames) do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d\\"..fn.."}{d\\"..xn.."}\\right|_{\\"..xn.."=0}",1), " "))
									for i=2,9 do
										yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{"..tostring(i).."}\\"..fn.."}{d\\"..xn.."^{"..tostring(i).."}}\\right|_{\\"..xn.."=0}",1), " "))
									end
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{n}\\"..fn.."}{d\\"..xn.."^{n}}\\right|_{\\"..xn.."=0}",1), " "))
								end
							end
							--标记过程状态
							matchFlg=true
						end
						if matchFlg then
							break
						end
						
						--不带下标场景
						thisPattern="d"..yNameKey.."d"..xNameKey
						if(string.match(input,thisPattern)~=nil) then
							--dpsidphi_类的输入
							for fk,fn in ipairs(yNameNames) do
								for xk,xn in ipairs(xNameNames) do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\frac{d\\"..fn.."}{d\\"..xn.."}",1), " "))
									for i=2,9 do
										yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\frac{d^{"..tostring(i).."}\\"..fn.."}{d\\"..xn.."^{"..tostring(i).."}}",1), " "))
									end
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\frac{d^{n}\\"..fn.."}{d\\"..xn.."^{n}}",1), " "))
								end
							end
							--标记过程状态
							matchFlg=true
						end
						if matchFlg then
							break
						end
					end
					if matchFlg then
						break
					end
					
					--匹配单字母自变量
					--带下标场景
					thisPattern="d"..yNameKey.."d[a-zA-Z]_"
					if(string.match(input,thisPattern)~=nil) then
						--dpsidx_类的输入
						str=string.match(input,"("..thisPattern..")")
						varW=string.sub(str,string.len(str)-1,string.len(str)-1)
						
						for fk,fn in ipairs(yNameNames) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d\\"..fn.."}{d"..varW.."}\\right|_{"..varW.."=0}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{"..tostring(i).."}\\"..fn.."}{d"..varW.."^{"..tostring(i).."}}\\right|_{"..varW.."=0}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{n}\\"..fn.."}{d"..varW.."^{n}}\\right|_{"..varW.."=0}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
					
					--不带下标场景
					thisPattern="d"..yNameKey.."d[a-zA-Z]"
					if(string.match(input,thisPattern)~=nil) then
						--dpsidx_类的输入
						str=string.match(input,"("..thisPattern..")")
						varW=string.sub(str,string.len(str))
						
						for fk,fn in ipairs(yNameNames) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d\\"..fn.."}{d"..varW.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{"..tostring(i).."}\\"..fn.."}{d"..varW.."^{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{n}\\"..fn.."}{d"..varW.."^{n}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
				end
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字母因变量,匹配希腊字母自变量
			for xidx,xNames in ipairs(xlNamesArry) do
				local xNameKey=xNames[1]
				--生成xl字符名称
				local xNameNames={}
				for k,v in ipairs(xNames) do
					if k>1 then
						table.insert(xNameNames,v)
					end
				end
				
				--带下标场景
				thisPattern="d[a-zA-Z]d"..xNameKey.."_"
				if(string.match(input,thisPattern)~=nil) then
					--dpsidx_类的输入
					str=string.match(input,"("..thisPattern..")")
					varW_1=string.sub(str,2,2)
					
					for xk,xn in ipairs(xNameNames) do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d"..varW_1.."}{d\\"..xn.."}\\right|_{\\"..xn.."=0}",1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{"..tostring(i).."}"..varW_1.."}{d\\"..xn.."^{"..tostring(i).."}}\\right|_{\\"..xn.."=0}",1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{n}"..varW_1.."}{d\\"..xn.."^{n}}\\right|_{\\"..xn.."=0}",1), " "))
					end
					--标记过程状态
					matchFlg=true
				end
				if matchFlg then
					break
				end
				
				--不带下标场景
				thisPattern="d[a-zA-Z]d"..xNameKey
				if(string.match(input,thisPattern)~=nil) then
					--dpsidx_类的输入
					str=string.match(input,"("..thisPattern..")")
					varW_1=string.sub(str,2,2)
					
					for xk,xn in ipairs(xNameNames) do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d"..varW_1.."}{d\\"..xn.."}",1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{"..tostring(i).."}"..varW_1.."}{d\\"..xn.."^{"..tostring(i).."}}",1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{n}"..varW_1.."}{d\\"..xn.."^{n}}",1), " "))
					end
					--标记过程状态
					matchFlg=true
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字母因变量,匹配单字母自变量,带下标场景
			thisPattern="d[a-zA-Z]d[a-zA-Z]_"
			if(string.match(input,thisPattern)~=nil) then
				--dydx_类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,2,2)
				varW_2=string.sub(str,4,4)
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d"..varW_1.."}{d"..varW_2.."}\\right|_{"..varW_2.."=0}",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{"..tostring(i).."}"..varW_1.."}{d"..varW_2.."^{"..tostring(i).."}}\\right|_{"..varW_2.."=0}",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\left.\\cfrac{d^{n}"..varW_1.."}{d"..varW_2.."^{n}}\\right|_{"..varW_2.."=0}",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字母因变量,匹配单字母自变量,不带下标场景
			thisPattern="d[a-zA-Z]d[a-zA-Z]"
			if(string.match(input,thisPattern)~=nil) then
				--dydx类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,2,2)
				varW_2=string.sub(str,4,4)
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d"..varW_1.."}{d"..varW_2.."}",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{"..tostring(i).."}"..varW_1.."}{d"..varW_2.."^{"..tostring(i).."}}",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\cfrac{d^{n}"..varW_1.."}{d"..varW_2.."^{n}}",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--4字符关键字,latex专用组合
	patterns={"[a-zA-Z][a-zA-Z][a-zA-Z][a-zA-Z]"}
	for pos=1,string.len(input) do
		matchFlg=false
		for idx,pattern in ipairs(patterns) do
			if string.match(input,pattern,pos)~=nil then
				str=string.match(input,"("..pattern..")",pos)
				if pos==1 then
					subStr_0=""
				else
					subStr_0=string.sub(input,1,pos-1)
				end
				subStr_1=string.sub(input,pos,string.len(input))
				
				if debugFlg then
					yield(Candidate("latex", seg.start, seg._end,"latexLetters: latex专用组合,4字符", " "))
				end
				
				if str=="alig" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{aligned}\r  \\end{aligned}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{equation}\\begin{aligned}\r    \\end{aligned}\\end{equation}", 1), " "))
					matchFlg=true
				elseif str=="appr" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\approx ", 1), " "))
					matchFlg=true
				elseif str=="arra" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{array}{rl} ab & c \\\\ b & cd \\end{array}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{array}{cc} ab & c \\\\ b & cd \\end{array}", 1), " "))
					matchFlg=true
				elseif str=="beca" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\because ", 1), " "))
					matchFlg=true
				elseif str=="canc" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\cancel{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\xcancel{}", 1), " "))
					matchFlg=true
				elseif str=="case" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{cases}\r ?&=? \\\\ \r\\end{cases}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "x=\\begin{cases}\r ?=? &\\text{if} ? \\\\ \r\\end{cases}", 1), " "))
					matchFlg=true
				elseif str=="disp" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\displaystyle", 1), " "))
					matchFlg=true
				elseif str=="exis" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\exist ", 1), " "))
					matchFlg=true
				elseif str=="fora" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\forall ", 1), " "))
					matchFlg=true
				elseif str=="frac" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\frac{}{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\cfrac{}{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\dfrac{}{}", 1), " "))
					matchFlg=true
				elseif str=="grou" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\overgroup{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\undergroup{}", 1), " "))
					matchFlg=true
				elseif str=="idxx" then
					for i=1,10 do
						yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "式("..tostring(i)..")", 1), " "))
					end
					matchFlg=true
				elseif str=="infi" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\infin", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "-\\infin", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "+\\infin", 1), " "))
					matchFlg=true
				elseif str=="line" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\overline{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\underline{}", 1), " "))
					matchFlg=true
				elseif str=="matr" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{matrix}\r a & b \\\\\r c & d \r\\end{matrix}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{bmatrix}\r a & b \\\\\r c & d \r\\end{bmatrix}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{pmatrix}\r a & b \\\\\r c & d \r\\end{pmatrix}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{vmatrix}\r a & b \\\\\r c & d \r\\end{vmatrix}", 1), " "))
					matchFlg=true
				elseif str=="nexi" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\nexists ", 1), " "))
					matchFlg=true
				elseif str=="prod" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\prod_{}^{n}{}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\displaystyle\\prod_{}^{n}{}", 1), " "))
					matchFlg=true
				elseif str=="suba" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{subarray}{c} ab \\\\ c \\end{subarray}", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\begin{subarray}{l} ab \\\\ c \\end{subarray}", 1), " "))
					matchFlg=true
				elseif str=="subs" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\substack{ab\\\\c}", 1), " "))
					matchFlg=true
				elseif str=="sout" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\sout{}", 1), " "))
					matchFlg=true
				elseif str=="tria" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\triangleq ", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\vartriangle ", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\vartriangleleft ", 1), " "))
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\vartriangleright ", 1), " "))
					matchFlg=true
				elseif str=="ther" then
					yield(Candidate("latex", seg.start, seg._end, subStr_0..string.gsub (subStr_1, pattern, "\\therefore ", 1), " "))
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
		end
		if matchFlg then
			returnFlg=true
			break
		end
	end
	if returnFlg then
		return 0
	end

	--3+字符关键字匹配 之 log匹配
	patterns={"log[a-zA-Z]*_?"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: log匹配", " "))
			end
			
			local thisPattern=""
			
			--匹配希腊字母底
			for bidx,bNames in ipairs(xlNamesArry) do
				local bNameKey=bNames[1]
				if(string.match(input,"log"..bNameKey.."[a-zA-Z]*_?")~=nil) then
					--生成xl字符名称
					local bNameNames={}
					for k,v in ipairs(bNames) do
						if k>1 then
							table.insert(bNameNames,v)
						end
					end
					
					--匹配希腊字母自变量
					for xidx,xNames in ipairs(xlNamesArry) do
						local xNameKey=xNames[1]
						--生成xl字符名称
						local xNameNames={}
						for k,v in ipairs(xNames) do
							if k>1 then
								table.insert(xNameNames,v)
							end
						end
						
						--带下标场景
						thisPattern="log"..bNameKey..xNameKey.."_"
						if(string.match(input,thisPattern)~=nil) then
							--logpsiphi_类的输入
							for bk,bn in ipairs(bNameNames) do
								for xk,xn in ipairs(xNameNames) do
									for i=1,8 do
										yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.."_{"..tostring(i).."}",1), " "))
									end
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.."_{n}",1), " "))
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.."_{0}",1), " "))
								end
							end
							--标记过程状态
							matchFlg=true
						end
						if matchFlg then
							break
						end
						
						--带上标场景
						thisPattern="log"..bNameKey..xNameKey.."^"
						if(string.match(input,thisPattern)~=nil) then
							--logpsiphi^类的输入
							for bk,bn in ipairs(bNameNames) do
								for xk,xn in ipairs(xNameNames) do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.." ",1), " "))
									for i=2,9 do
										yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.."^{"..tostring(i).."}",1), " "))
									end
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.."^{n}",1), " "))
								end
							end
							--标记过程状态
							matchFlg=true
						end
						if matchFlg then
							break
						end
						
						--不带上下标场景
						thisPattern="log"..bNameKey..xNameKey
						if(string.match(input,thisPattern)~=nil) then
							--logpsiphi类的输入
							for bk,bn in ipairs(bNameNames) do
								for xk,xn in ipairs(xNameNames) do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}\\"..xn.." ",1), " "))
									for i=2,9 do
										yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{"..tostring(i).."}\\"..xn.." ",1), " "))
									end
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{n}\\"..xn.." ",1), " "))
								end
							end
							--标记过程状态
							matchFlg=true
						end
						if matchFlg then
							break
						end
					end
					if matchFlg then
						break
					end
					
					--匹配单字母自变量,带下标场景
					thisPattern="log"..bNameKey.."[a-zA-Z]_"
					if(string.match(input,thisPattern)~=nil) then
						--logpsia_类的输入
						str=string.match(input,"("..thisPattern..")")
						varW=string.sub(str,string.len(str)-1,string.len(str)-1)
						
						for bk,bn in ipairs(bNameNames) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.."_{"..tostring(i).."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.."_{n}",1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.."_{0}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
					
					--匹配单字母自变量,带上标场景
					thisPattern="log"..bNameKey.."[a-zA-Z]^"
					if(string.match(input,thisPattern)~=nil) then
						--logpsia^类的输入
						str=string.match(input,"("..thisPattern..")")
						varW=string.sub(str,string.len(str)-1,string.len(str)-1)
						
						for bk,bn in ipairs(bNameNames) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.." ",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.."^{"..tostring(i).."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.."^{n}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
					
					--匹配单字母自变量,不带上下标场景
					thisPattern="log"..bNameKey.."[a-zA-Z]"
					if(string.match(input,thisPattern)~=nil) then
						--logpsia类的输入
						str=string.match(input,"("..thisPattern..")")
						varW=string.sub(str,string.len(str),string.len(str))
						
						for bk,bn in ipairs(bNameNames) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}"..varW.." ",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{"..tostring(i).."}"..varW.." ",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{n}"..varW.." ",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
					
					--匹配单字母自变量,不带参数场景
					thisPattern="log"..bNameKey
					if(string.match(input,thisPattern)~=nil) then
						--logpsi类的输入
						for bk,bn in ipairs(bNameNames) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}()",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{"..tostring(i).."}()",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{\\"..bn.."}^{n}()",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
					if matchFlg then
						break
					end
				end
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字母底,匹配希腊字母自变量
			for xidx,xNames in ipairs(xlNamesArry) do
				local xNameKey=xNames[1]
				--生成xl字符名称
				local xNameNames={}
				for k,v in ipairs(xNames) do
					if k>1 then
						table.insert(xNameNames,v)
					end
				end
				
				--带下标场景
				thisPattern="log[a-zA-Z]"..xNameKey.."_"
				if(string.match(input,thisPattern)~=nil) then
					--logapsi_类的输入
					str=string.match(input,"("..thisPattern..")")
					varW_1=string.sub(str,4,4)
					
					for xk,xn in ipairs(xNameNames) do
						for i=1,8 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.."_{"..tostring(i).."}",1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.."_{n}",1), " "))
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.."_{0}",1), " "))
					end
					
					--标记过程状态
					matchFlg=true
				end
				if matchFlg then
					break
				end
				
				--带上标场景
				thisPattern="log[a-zA-Z]"..xNameKey.."^"
				if(string.match(input,thisPattern)~=nil) then
					--logapsi^类的输入
					str=string.match(input,"("..thisPattern..")")
					varW_1=string.sub(str,4,4)
					
					for xk,xn in ipairs(xNameNames) do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.." ",1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.."^{"..tostring(i).."}",1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.."^{n}",1), " "))
					end
					
					--标记过程状态
					matchFlg=true
				end
				if matchFlg then
					break
				end
				
				--不带上下标场景
				thisPattern="log[a-zA-Z]"..xNameKey
				if(string.match(input,thisPattern)~=nil) then
					--logapsi类的输入
					str=string.match(input,"("..thisPattern..")")
					varW_1=string.sub(str,4,4)
					
					for xk,xn in ipairs(xNameNames) do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}\\"..xn.." ",1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{"..tostring(i).."}\\"..xn.." ",1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{n}\\"..xn.." ",1), " "))
					end
					
					--标记过程状态
					matchFlg=true
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字底,匹配单字母自变量,带下标场景
			thisPattern="log[a-zA-Z][a-zA-Z]_"
			if(string.match(input,thisPattern)~=nil) then
				--logab_类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,4,4)
				varW_2=string.sub(str,5,5)
				
				for i=1,8 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.."_{"..tostring(i).."}",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.."_{n}",1), " "))
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.."_{0}",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字底,匹配单字母自变量,带上标场景
			thisPattern="log[a-zA-Z][a-zA-Z]^"
			if(string.match(input,thisPattern)~=nil) then
				--logab_类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,4,4)
				varW_2=string.sub(str,5,5)
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.." ",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.."^{"..tostring(i).."}",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.."^{n}",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字底,匹配单字母自变量,不带上下标场景
			thisPattern="log[a-zA-Z][a-zA-Z]"
			if(string.match(input,thisPattern)~=nil) then
				--logab_类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,4,4)
				varW_2=string.sub(str,5,5)
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}"..varW_2.." ",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{"..tostring(i).."}"..varW_2.." ",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{n}"..varW_2.." ",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配单字母自变量,不带参数场景
			thisPattern="log[a-zA-Z]"
			if(string.match(input,thisPattern)~=nil) then
				--loga类的输入
				str=string.match(input,"("..thisPattern..")")
				varW_1=string.sub(str,4,4)
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{"..varW_1.."}^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
			
			--匹配无底无参数场景
			thisPattern="log"
			if(string.match(input,thisPattern)~=nil) then
				--log类的输入
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{?}()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{?}^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\log_{?}^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			
			returnFlg = matchFlg
			
			if returnFlg then
				break
			end
		end
	end
	if returnFlg then
		return 0
	end
	
	--3+字符关键字
	patterns={"lim[a-zA-Z]+"}
	for idx,pattern in ipairs(patterns) do
		if string.match(input,pattern)~=nil then
			str=string.match(input,"("..pattern..")")
			keyW=string.sub(str,1,3)
			varW=string.sub(str,4,4)
			
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: ".. pattern..", "..str, " "))
			end
			
			if keyW=="lim" then
				
				local thisPattern=""
				
				--匹配希腊字母参数
				for xlidx,xlNames in ipairs(xlNamesArry) do
					local nameKey=xlNames[1]
					--生成xl字符名称
					local names={}
					for k,v in ipairs(xlNames) do
						if k>1 then
							table.insert(names,v)
						end
					end
					
					if(string.match(input,pattern..".+_")~=nil) then
						--匹配希腊字母带下标
						thisPattern=keyW..nameKey.."_"
						if(string.match(input,thisPattern)~=nil) then
							--生成候选词
							for k,name in ipairs(names) do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to0}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{"..tostring(i).."}".."\\to0}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{n}\\to0}{}", 1), " "))
								
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to\\infin}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{"..tostring(i).."}".."\\to\\infin}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{n}\\to\\infin}{}", 1), " "))
								
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to-\\infin}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{"..tostring(i).."}".."\\to-\\infin}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."_{n}\\to-\\infin}{}", 1), " "))
							end
							--标记过程状态
							matchFlg=true
						end
					elseif(string.match(input,pattern..".+^")~=nil) then
						--匹配希腊字母本身带上标
						thisPattern=keyW..nameKey.."^"
						if(string.match(input,thisPattern)~=nil) then
							--生成候选词
							for k,name in ipairs(names) do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to0}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{"..tostring(i).."}".."\\to0}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{n}\\to0}{}", 1), " "))
								
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to\\infin}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{"..tostring(i).."}".."\\to\\infin}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{n}\\to\\infin}{}", 1), " "))
								
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to-\\infin}{}", 1), " "))
								for i=2,9 do
									yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{"..tostring(i).."}".."\\to-\\infin}{}", 1), " "))
								end
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."^{n}\\to-\\infin}{}", 1), " "))
							end
							--标记过程状态
							matchFlg=true
						end
					else
						--匹配希腊字母本身
						thisPattern=keyW..nameKey
						if(string.match(input,thisPattern)~=nil) then
							--生成候选词
							for k,name in ipairs(names) do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to0}{}", 1), " "))
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to\\infin}{}", 1), " "))
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{\\"..name.."\\to-\\infin}{}", 1), " "))
							end
							--标记过程状态
							matchFlg=true
						end
					end
					if matchFlg then
						break
					end
				end
				if matchFlg then
					break
				end
				
				--匹配正常字母参数
				thisPattern=keyW.."[a-zA-Z][_^]?"
				if(string.match(input,thisPattern)~=nil) then
					str=string.match(input,"("..thisPattern..")")
					varW=string.sub(str,string.len(keyW)+1,string.len(keyW)+1)
					varW_1=string.sub(str,string.len(str))
					
					if varW_1=='_' then
						--匹配正常字母参数,带下标
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to0}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{"..tostring(i).."}".."\\to0}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{n}\\to0}{}", 1), " "))
						
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to\\infin}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{"..tostring(i).."}".."\\to\\infin}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{n}\\to\\infin}{}", 1), " "))
						
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to-\\infin}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{"..tostring(i).."}".."\\to-\\infin}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."_{n}\\to-\\infin}{}", 1), " "))
						
						--标记过程状态
						matchFlg=true
					elseif varW_1=='^' then
						--匹配正常字母参数,带上标
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to0}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{"..tostring(i).."}".."\\to0}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{n}\\to0}{}", 1), " "))
						
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to\\infin}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{"..tostring(i).."}".."\\to\\infin}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{n}\\to\\infin}{}", 1), " "))
						
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to-\\infin}{}", 1), " "))
						for i=2,9 do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{"..tostring(i).."}".."\\to-\\infin}{}", 1), " "))
						end
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."^{n}\\to-\\infin}{}", 1), " "))
						
						--标记过程状态
						matchFlg=true
					else
						--匹配正常字母参数,不带上下标
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to0}{}", 1), " "))
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to\\infin}{}", 1), " "))
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, "\\displaystyle\\"..keyW.."_{"..varW.."\\to-\\infin}{}", 1), " "))
						
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			
			returnFlg=matchFlg
			
			if returnFlg then
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--3+字符关键字,匹配点
	patterns={"dot[-\\_]?"}
	for idx,pattern in ipairs(patterns) do
		if string.match(input,pattern)~=nil then
			str=string.match(input,"("..pattern..")")
			if string.len(str)==4 then
				varW=string.sub(str,4,4)
			else
				varW=""
			end
			
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: ".. pattern..", "..str, " "))
			end
			
			matchFlg=false
			if varW=='-' then
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\cdots ", 1), " "))
				matchFlg=true
			elseif varW=='_' then
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\ldots ", 1), " "))
				matchFlg=true
			elseif varW=='|' then
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\vdots ", 1), " "))
				matchFlg=true
			elseif varW=='\\' then
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\ddots ", 1), " "))
				matchFlg=true
			else
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\sdot ", 1), " "))
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, pattern, "\\dots ", 1), " "))
				matchFlg=true
			end
			
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--3+字符关键字匹配 之 三角函数匹配
	patterns={"sin","cos","tan","cot","sec","csc"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: 三角函数匹配", " "))
			end
			
			keyW="\\"..pattern
			local thisPattern=""
			
			--匹配希腊字母参数
			for xlidx,xlNames in ipairs(xlNamesArry) do
				local nameKey=xlNames[1]
				--生成xl字符名称
				local names={}
				for k,v in ipairs(xlNames) do
					if k>1 then
						table.insert(names,v)
					end
				end
				
				if(string.match(input,pattern..".+_")~=nil) then
					--匹配希腊字母带下标
					thisPattern=pattern..nameKey.."_"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{n}}",1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{0}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				elseif(string.match(input,pattern..".+^")~=nil) then
					--匹配希腊字母本身带上标
					thisPattern=pattern..nameKey.."^"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{"..tostring(i).."}}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."^{n}}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				else
					--匹配希腊字母本身
					thisPattern=pattern..nameKey
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}",1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{\\"..name.."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{\\"..name.."}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				break
			end
			
			--匹配正常字母参数
			thisPattern=pattern.."[a-zA-Z][_^]?"
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				varW=string.sub(str,string.len(pattern)+1,string.len(pattern)+1)
				varW_1=string.sub(str,string.len(str))
				
				if varW_1=='_' then
					--匹配正常字母参数,带下标
					for i=1,8 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{n}}",1), " "))
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{0}}",1), " "))
					
					--标记过程状态
					matchFlg=true
				elseif varW_1=='^' then
					--匹配正常字母参数,带上标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{"..tostring(i).."}}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{n}}",1), " "))
					--标记过程状态
					matchFlg=true
				else
					--匹配正常字母参数,不带上下标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}",1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}{"..varW.."}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}{"..varW.."}",1), " "))
					--标记过程状态
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
			
			--匹配无参数
			thisPattern=pattern
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."()",1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{"..tostring(i).."}()",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."^{n}()",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end

	--3+字符关键字匹配 之 abs操作符匹配
	patterns={"abs"}
	for pidx,pattern in ipairs(patterns) do
		if(string.match(input,pattern)~=nil) then
			if debugFlg then
				yield(Candidate("latex", seg.start, seg._end,"latexLetters: abs 操作符匹配", " "))
			end
			
			keyW="\\left|"
			keyWEnd="\\right|"
			local thisPattern=""
			
			--匹配希腊字母参数
			for xlidx,xlNames in ipairs(xlNamesArry) do
				local nameKey=xlNames[1]
				--生成xl字符名称
				local names={}
				for k,v in ipairs(xlNames) do
					if k>1 then
						table.insert(names,v)
					end
				end
				
				if(string.match(input,pattern..".+_")~=nil) then
					--匹配希腊字母带下标
					thisPattern=pattern..nameKey.."_"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							for i=1,8 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{"..tostring(i).."}}"..keyWEnd,1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{n}}"..keyWEnd,1), " "))
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."_{0}}"..keyWEnd,1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				elseif(string.match(input,pattern..".+^")~=nil) then
					--匹配希腊字母本身带上标
					thisPattern=pattern..nameKey.."^"
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd,1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd.."^{"..tostring(i).."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd.."^{n}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				else
					--匹配希腊字母本身
					thisPattern=pattern..nameKey
					if(string.match(input,thisPattern)~=nil) then
						--生成候选词
						for k,name in ipairs(names) do
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd,1), " "))
							for i=2,9 do
								yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd.."^{"..tostring(i).."}",1), " "))
							end
							yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{\\"..name.."}"..keyWEnd.."^{n}",1), " "))
						end
						--标记过程状态
						matchFlg=true
					end
				end
				if matchFlg then
					break
				end
			end
			if matchFlg then
				break
			end
			
			--匹配正常字母参数
			thisPattern=pattern.."[a-zA-Z][_^]?"
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				varW=string.sub(str,string.len(pattern)+1,string.len(pattern)+1)
				varW_1=string.sub(str,string.len(str))
				
				if varW_1=='_' then
					--匹配正常字母参数,带下标
					for i=1,8 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{"..tostring(i).."}}"..keyWEnd,1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{n}}"..keyWEnd,1), " "))
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."_{0}}"..keyWEnd,1), " "))
					
					--标记过程状态
					matchFlg=true
				elseif varW_1=='^' then
					--匹配正常字母参数,带上标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}"..keyWEnd,1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{"..tostring(i).."}}"..keyWEnd,1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."^{n}}"..keyWEnd,1), " "))
					
					--标记过程状态
					matchFlg=true
				else
					--匹配正常字母参数,不带上下标
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}"..keyWEnd,1), " "))
					for i=2,9 do
						yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}"..keyWEnd.."^{"..tostring(i).."}",1), " "))
					end
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{"..varW.."}"..keyWEnd.."^{n}",1), " "))
					
					--标记过程状态
					matchFlg=true
				end
			end
			if matchFlg then
				break
			end
			
			--匹配无参数
			thisPattern=pattern
			if(string.match(input,thisPattern)~=nil) then
				str=string.match(input,"("..thisPattern..")")
				
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{?}"..keyWEnd,1), " "))
				for i=2,9 do
					yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{?}"..keyWEnd.."^{"..tostring(i).."}",1), " "))
				end
				yield(Candidate("latex", seg.start, seg._end, string.gsub (input, thisPattern, keyW.."{?}"..keyWEnd.."^{n}",1), " "))
				
				--标记过程状态
				matchFlg=true
			end
			if matchFlg then
				returnFlg=true
				break
			end
		end
	end
	if returnFlg then
		return 0
	end
	
...由于博文限制字符数量,无法粘贴完整代码,请下载脚本文档或者在gitHug中查阅

以上 latex_translator.lua 脚本比较长,但这也仅实现了小部分的latex功能,后续慢慢再完善。

latexHelp_translator.lua

latexHelp_translator.lua是一个lua脚本定义的lua_translator翻译器。latexHelp_translator.lua所实现的功能比较简单,即在用户输入 help 字符时,将与latex输入方案有关的提示信息以候选词组的方式展示出来。latexHelp_translator.lua脚本的内容如下👇:

--lua语言中的注释用“--” 
function translator(input, seg)
	if (input == "help") then
		yield(Candidate("help", seg.start, seg._end, "三角函数-->sin|cos|tan|cot|sec|csc", " "))
		yield(Candidate("help", seg.start, seg._end, "反三角函数-->asin|acos|atan|acot", " "))
		yield(Candidate("help", seg.start, seg._end, "双曲函数-->sh|ch|th|cth|sech|csch", " "))
		yield(Candidate("help", seg.start, seg._end, "反双曲函数-->ash|ach|ath", " "))
		yield(Candidate("help", seg.start, seg._end, "微分-->d?d?_", " "))
		yield(Candidate("help", seg.start, seg._end, "积分-->intc|int", " "))
		yield(Candidate("help", seg.start, seg._end, "对数-->log|lg|ln", " "))
		yield(Candidate("help", seg.start, seg._end, "极限-->lim", " "))
		yield(Candidate("help", seg.start, seg._end, "开方-->sqr", " "))
		yield(Candidate("help", seg.start, seg._end, "上标-->?^", " "))
		yield(Candidate("help", seg.start, seg._end, "下标-->?_", " "))
		yield(Candidate("help", seg.start, seg._end, "线-->bar", " "))
		yield(Candidate("help", seg.start, seg._end, "点-->dot", " "))
		yield(Candidate("help", seg.start, seg._end, "临域-->mr", " "))
		yield(Candidate("help", seg.start, seg._end, "R-->?n?", " "))
		yield(Candidate("help", seg.start, seg._end, "颜色名称-->clr", " "))
		yield(Candidate("help", seg.start, seg._end, "颜色文本-->tc|box", " "))
		yield(Candidate("help", seg.start, seg._end, "特殊字符4-->alig|appr|arra|beca|canc|case|disp|doll|exis|fora|frac|grou|idxx|infi|line|matr|nexi|prod|suba|subs|sout|tria|ther", " "))
		yield(Candidate("help", seg.start, seg._end, "特殊字符3-->big|gox|cap|cup|idx|max|min|neq|not|set|sim|sum|tau", " "))
		yield(Candidate("help", seg.start, seg._end, "特殊字符2-->in|mp|ni|to|gt|ge|lt|le|", " "))
		yield(Candidate("help", seg.start, seg._end, "希腊字符-->alph|beta|其它名称", " "))
		--yield(Candidate("help", seg.start, seg._end, "-->", " "))
	end
end

return translator

💣注意:
👆上述latex_translator.lualatexHelp_translator.lua两个脚本文档,均应该位于 用户文件夹下的lua文件夹内,如下👇:
20240113155248

配置文档

👆以上所述配置文档,你可以在 rime中州韵小狼毫须鼠管输入法 LaTex输入方案配置包.zip 下载取用。

如果你可以访问gitHub,你也可以在 dyyRime 中找到完全版本的配置包。

效果欣赏

当你完成了以上的所有设置时,你需要重新部署你的rime,然后通过F4/F8调出方案选单,你应该可以看到LaTex输入方案,如下👇:
20240113160253
选择LaTex输入方案后,就可以愉快的开始体验LaTex输入公式了。

小结

本文分享了一中在rime中州韵小狼毫须鼠管输入法中配置LaTex输入方案的方法,从而实现了LaTex公式的快速录入,当前LaTex仅支持部分基础的公式录入,更多功能正在完善中。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1389960.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

猫咪全罐喂养一个月多少钱?适合给猫咪全罐喂养的猫罐头推荐

不少铲屎官为了防止猫咪挑食和营养吸收不均衡&#xff0c;打算给猫咪进行全罐喂养&#xff0c;但是又担心全罐喂养花费太多钱了。猫咪全罐喂养一个月多少钱&#xff1f;别担心&#xff0c;咱们打工人的养猫攻略&#xff0c;花小钱办大事&#xff01;追求高性价比的猫罐头才是王…

软件测试|使用selenium处理单选框和多选框

简介 我们在web自动化测试工作中&#xff0c;经常会遇到对单选框&#xff08;Radio Buttons&#xff09;或者多选框&#xff08;Checkboxes&#xff09;进行操作的场景&#xff0c;单选框和多选框主要是用于我们做出选择或提交数据。本文将主要介绍selenium对于单选框和多选框…

嵌入式新人要坚持嵌入式吗?

今日话题&#xff0c;嵌入式新人要坚持嵌入式吗?这问题让我想起了我大学时学习嵌入式的经历。当时&#xff0c;学校还发了一些开发板&#xff0c;可惜我自己的学习进展不顺利&#xff0c;最终我决定转向了纯软件开发领域。但是&#xff0c;我大学时有一个同学&#xff0c;他一…

Flink启动Yarn Session报错:Couldn‘t deploy Yarn session cluster

Flink版本&#xff1a;1.1.3 启动Yarn Session的语句&#xff1a;bin/yarn-session.sh -nm test -d 报错截图如下&#xff1a; 仅通过ERROR信息只能知道是yarn session集群未能正常启动&#xff0c;因此继续向下查找&#xff1a; 找到报错信息的Caused by部分&#xff1a; 报…

网络原理--http

目录 一、 DNS&#xff08;应用层协议&#xff09; 1、域名概念 2、维护ip地址和域名之间的映射&#xff08;域名解析系统&#xff09; 3、DNS系统&#xff08;服务器&#xff09; 4、如何解决DNS服务器高并发问题 二、HTTP&#xff08;应用层协议&#xff09; 1、htt…

觉得做文档不被重视?来看看你未来的可能性

▲ 搜索“大龙谈智能内容”关注公众号▲ 在《2023中国技术传播行业调研报告》中&#xff0c;“从业者心中的痛”这项调研的统计如下图。 其中&#xff0c;“企业内高层不够重视”排在第一位。 图1 - “从业者心中的痛”统计 对于行业的发展趋势&#xff0c;大家是这样看的…

海外代理IP怎么用?常见使用问题及解决方案

海外代理IP是指提供全球范围内的代理服务器&#xff0c;代理服务器充当IP与目标网站之间的中介&#xff0c;可以起到安全匿名、提高网速、突破网络壁垒的作用。在使用代理IP的过程中&#xff0c;用户可能会遇到各种挑战&#xff0c;如连接问题、速度慢等。理解这些问题的原因并…

计算机导论06-人机交互

人机交互基础 人机交互概述 人机交互及其发展 人机交互是指人与计算机之间&#xff0c;使用某种对话语言&#xff0c;以一定的交互方式&#xff0c;为完成确定任务的信息交换过程。 从计算机的诞生之日起&#xff0c;人机交互技术的发展已经历了以下阶段&#xff1a; 早期的…

Linux 有哪些搜索方式?5分钟带你搞懂!

5分钟带你掌握 Linux 的三种搜索方式 前言 1.find 命令 find 命令是用来在给定的目录下查找符合给定条件的文件 语法格式&#xff1a;find [查找起始路径] [查找条件] [处理动作] &#xff08;1&#xff09;根据名称查找&#xff1a;find [查找起始路径] -name 文件名 或者…

开源云真机平台-Sonic平台-python自定义脚本-config.ini方式实现全局配置参数的读写操作

【主要功能】 config.ini方式实现全局配置参数的读写操作 使用python实现以下功能&#xff1a; 1、使用将接口获取的变量值&#xff0c;写入到当前目录下的config文件中&#xff0c;如delayTime10&#xff1b; 2、读取当前目录下的config文件中&#xff0c;特定变量的值&…

【Java】equals和hashCode需要一起重写的原因

方法实现&#xff1a; equals和hashCode两个方法是属于Object基类的两个方法&#xff0c;我们先来看看两个方法的默认实现。 equals方法&#xff1a; public boolean equals(Object obj) {return (this obj);} 可以看到equals方法的默认实现是使用 比较两个对象&#xff0c…

Selenium使用指南(超详细)

&#x1f345; 视频学习&#xff1a;文末有免费的配套视频可观看 &#x1f345; 关注公众号【互联网杂货铺】&#xff0c;回复 1 &#xff0c;免费获取软件测试全套资料&#xff0c;资料在手&#xff0c;涨薪更快 概述 selenium是网页应用中最流行的自动化测试工具&#xff0c…

Kafka-生产者

Kafka在实际应用中&#xff0c;经常被用作高性能、可扩展的消息中间件。 Kafka自定义了一套网络协议&#xff0c;只要遵守这套协议的格式&#xff0c;就可以向Kafka发送消息&#xff0c;也可以从Kafka中拉取消息。 在实践生产过程中&#xff0c;一套API封装良好、灵活易用的客…

C语言——详解字符函数和字符串数组(上)

目录 一、strlen的使用和模拟实现 1.strlen()函数的介绍 2.strlen()函数的具体使用 3.strlen函数的注意事项 4.strlen函数的模拟实现 二、strcpy的使用和模拟实现 1.strcpy()函数的介绍 2.strcpy()函数的具体使用 3.strcpy()函数的注意事项 4.strcpy函数的模拟实现 …

js逆向第19例:猿人学第17题天杀的Http2.0

文章目录 一、前言二、定位关键参数三、代码实现四、参考文献一、前言 任务十七:抓取这5页的数字,计算加和并提交结果 题目已经给出来标准答案,而且此题设置为“非常简单”其关键就是HTTP/2.0请求,打开控制台查看请求接口数据如下: 二、定位关键参数 可以看到控制台显示…

计算机毕业设计-----SSH学生请假管理系统

项目介绍 本项目分为管理员、教师、学生三种角色&#xff1b; 教师角色包含以下功能&#xff1a; 教师角色登录,请假查看,审批学生请假,学生管理等功能。 管理员角色包含以下功能&#xff1a; 班级管理,班主任管理,公告管理,留言板管理,学生管理等功能。 学生角色包含以下…

MySQL 中有关 NULL 的三个坑

mysql sum 函数、count 函数&#xff0c;以及 NULL 值条件可能踩的坑。 SELECT SUM(score) FROM person ; nullSELECT COUNT(score) FROM person; 0select id from person where scoreNULL; null 显然&#xff0c;这三条 SQL 语句的执行结果和我们的期望不同&#xf…

一篇文章带你搞懂---全排序

顾得泉&#xff1a;个人主页 个人专栏&#xff1a;《Linux操作系统》 《C/C》 《LeedCode刷题》 键盘敲烂&#xff0c;年薪百万&#xff01; 全排序&#xff08;Permutation&#xff09;是指将一组元素按照一定的顺序进行排列的过程。在计算机科学中&#xff0c;全排序是一…

Centos系统安全设置

1 设置密码复杂度&#xff0c;帐号密码有效期3个月 密码复杂度要求&#xff1a;最小长度8位&#xff0c;至少2位大写字母&#xff0c;1位小写字母&#xff0c;4位数字&#xff0c;1位特殊字符 1&#xff09;执行备份&#xff1a; #cp -p /etc/login.defs /etc/login.defs_bak…

zotero使用gpt

zotero使用gpt 下载 zotero下载&#xff1a;https://www.zotero.org/download/ 插件下载&#xff1a;https://github.com/MuiseDestiny/zotero-gpt?tabreadme-ov-file 插件安装 zotero中选择 工具->添加组件 选择右上角的齿轮&#xff0c;选择Install add-on from fil…