美文网首页
ST中tex命令补全

ST中tex命令补全

作者: 霁纯 | 来源:发表于2016-09-22 16:08 被阅读0次

    今天用st写tex,发现没有补全,就上网查了一下,折腾了好久,原来Latextool包里就有写好,在LaTeX math.sublime-completions文件和LaTeX.sublime-completions文件里,如下

    {
            "scope": "text.tex.latex",
    
            "completions":
            [
                    { "trigger": "it", "contents": "\\textit{$1}$0"},
                    { "trigger": "bf", "contents": "\\textbf{$1}$0"},
                    { "trigger": "em", "contents": "\\emph{$1}$0"},
                    { "trigger": "tt", "contents": "\\texttt{$1}$0"},
                    { "trigger": "un", "contents": "\\underline{$1}$0"},
    
                    { "trigger": "bs", "contents": "\\bigskip"},
                    { "trigger": "ms", "contents": "\\medskip"},
                    { "trigger": "ss", "contents": "\\smallskip"},
    
                    { "trigger": "use", "contents": "\\usepackage"},
            
                    { "trigger": "beq", "contents": "\\[\n$0\n\\]"},               
                    { "trigger": "beqn", "contents": "\\begin{equation}\n$0\n\\end{equation}\n"},
                    { "trigger": "bga", "contents": "\\begin{gather*}\n$0\n\\end{gather*}\n"},
                    { "trigger": "bgan", "contents": "\\begin{gather}\n$0\n\\end{gather}\n"},               
                    { "trigger": "bal", "contents": "\\begin{align*}\n$0\n\\end{align*}\n"},
                    { "trigger": "baln", "contents": "\\begin{align}\n$0\n\\end{align}\n"},
                    { "trigger": "baa", "contents": "\\begin{alignat*}\n$0\n\\end{alignat*}\n"},
                    { "trigger": "baan", "contents": "\\begin{alignat}\n$0\n\\end{alignat}\n"},
                    { "trigger": "bfl", "contents": "\\begin{flalign*}\n$0\n\\end{flalign*}\n"},                
                    { "trigger": "bfln", "contents": "\\begin{flalign}\n$0\n\\end{flalign}\n"},
                    { "trigger": "bml", "contents": "\\begin{multiline*}\n$0\n\\end{multiline*}\n"},                
                    { "trigger": "bmln", "contents": "\\begin{multiline}\n$0\n\\end{multiline}\n"},
    
                    { "trigger": "bit", "contents": "\\begin{itemize}\n\t\\item $1 \n\\end{itemize}\n"},
                    { "trigger": "ben", "contents": "\\begin{enumerate}\n\t\\item $1 \n\\end{enumerate}\n"},
                    { "trigger": "i", "contents": "\\item "}
    
            ]
    }
    

    例如,只需要输入beqn,按tab,即补全equation环境。math.sublime-completion里的补全要在数学环境下才能实现。

    相关文章

      网友评论

          本文标题:ST中tex命令补全

          本文链接:https://www.haomeiwen.com/subject/tpmzettx.html