Sublimetext3 乳胶升华片段

Sublimetext3 乳胶升华片段,sublimetext3,sublimetext-snippet,Sublimetext3,Sublimetext Snippet,我正在使用一个Sublime片段创建一个Latex状态机模板。但是,它什么也不做(当我键入“stmach”并按tab键时,stmach消失,但不包括Latex代码)。我不明白为什么,因为我的所有其他代码片段都工作正常 如果我删除代码段中的一些行,它会工作,但我需要整个块:/ <snippet> <content><![CDATA[ \begin{center} \begin{tikzpicture}[shorten >=1pt,node

我正在使用一个Sublime片段创建一个Latex状态机模板。但是,它什么也不做(当我键入“stmach”并按tab键时,
stmach
消失,但不包括Latex代码)。我不明白为什么,因为我的所有其他代码片段都工作正常

如果我删除代码段中的一些行,它会工作,但我需要整个块:/

<snippet>
<content><![CDATA[
    \begin{center}
        \begin{tikzpicture}[shorten >=1pt,node distance=4.5cm,on grid,auto]

        \tikzstyle{every state}=[draw=blue!50,very thick,fill=blue!20] % Node color

        \node[state,initial,initial text=reset, initial where=below] (configuration) {$conf$}; % Node name and position
        \node[state] (init) [below right=of configuration] {$init$};

        \path[->] % Arrow
        (configuration)
            edge  [bend left]                 node {finishConfiguration=1} (init)

        (init)
            edge  [bend left]                 node {} (configuration);

        \end{tikzpicture}
    \end{center}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>stmach</tabTrigger> 
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.tex</scope>

=1pt,节点距离=4.5cm,在网格上,自动]
\tikzstyle{every state}=[draw=blue!50,非常厚,fill=blue!20]%节点颜色
\节点[状态,初始,初始文本=重置,初始位置=下方](配置){$conf$};%节点名称和位置
\节点[状态](init)[右下=配置]{$init$};
\路径[->]%箭头
(配置)
边[bend left]节点{finishConfiguration=1}(初始)
(初始化)
边[向左弯曲]节点{}(配置);
\结束{tikzpicture}
\结束{中心}
]]>
斯马奇
text.tex


请注意,Latex代码工作时没有任何错误或警告。

$字符在升华文本片段中具有特殊意义,因此需要转义才能有效

可以使用前面的反斜杠将其转义,如下所示:


=1pt,节点距离=4.5cm,在网格上,自动]
\tikzstyle{every state}=[draw=blue!50,非常厚,fill=blue!20]%节点颜色
\节点[状态,初始,初始文本=重置,初始位置=下方](配置){\$conf\$};%节点名称和位置
\节点[状态](init)[右下=配置]{\$init\$};
\路径[->]%箭头
(配置)
边[bend left]节点{finishConfiguration=1}(初始)
(初始化)
边[向左弯曲]节点{}(配置);
\结束{tikzpicture}
\结束{中心}
]]>
斯马奇
text.tex

使用中的语法突出显示可以使问题更清楚,因为ST不幸没有提供任何反馈,正如您所看到的:

转义时的外观:

<snippet>
<content><![CDATA[
    \begin{center}
        \begin{tikzpicture}[shorten >=1pt,node distance=4.5cm,on grid,auto]

        \tikzstyle{every state}=[draw=blue!50,very thick,fill=blue!20] % Node color

        \node[state,initial,initial text=reset, initial where=below] (configuration) {\$conf\$}; % Node name and position
        \node[state] (init) [below right=of configuration] {\$init\$};

        \path[->] % Arrow
        (configuration)
            edge  [bend left]                 node {finishConfiguration=1} (init)

        (init)
            edge  [bend left]                 node {} (configuration);

        \end{tikzpicture}
    \end{center}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>stmach</tabTrigger> 
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.tex</scope>
</snippet>