Latex Sublime Text Snippet 不起作用

Latex Sublime Text Snippet 不起作用

我正在使用 Sublime 代码片段创建状态机模板。但是,它什么也没做。我不明白为什么,因为我的所有其他代码片段都运行良好。

如果删除代码片段中的几行,它就可以工作,但我需要整个块:/

<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>

答案1

找到答案:在每个“$”前添加一个“\”。

=1pt,节点距离=4.5cm,在网格上,自动]

        \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>

相关内容