【问题标题】:VSCode Snippets for Latex: Combining placeholders and curly bracesLatex 的 VSCode 片段:结合占位符和花括号
【发布时间】:2021-04-18 21:44:52
【问题描述】:

我正在为 LaTeX 的 VSCode 中的个人 sn-ps 设置文件。 有没有办法将占位符(语法:${1:foo})和普通花括号结合起来? 在我的示例中,我希望我的代码输出: \fcolorbox {frame}{background}{text} 其中每个变量都是占位符。我生成的 sn-p 代码 (.json) 如下所示:

    "Colorbox fcolorbox": {
  "prefix": "colbox",
  "body": [
    "\\fcolorbox ${{1:frame}}${{2:background}}${{3:text}}"
  ],
  "description": "Colorbox fcolorbox"
}

但不起作用,因为它将 $ 和 {} 输出并解释为 LaTeX 符号。 有没有办法解决这个问题并使占位符起作用?

【问题讨论】:

    标签: visual-studio-code latex code-snippets vscode-snippets


    【解决方案1】:

    这会产生请求的结果:\fcolorbox {frame}{background}{text}

    "Colorbox fcolorbox": {
        "prefix": "colbox",
        "body": [
          "\\fcolorbox {${1:frame}}{${2:background}}{${3:text}}"
        ],
        "description": "Colorbox fcolorbox"
      }
    

    【讨论】:

    • 非常感谢,解决了。不知何故,我没想过这样安排大括号。
    猜你喜欢
    • 2020-02-13
    • 1970-01-01
    • 1970-01-01
    • 2012-03-24
    • 2016-08-11
    • 2019-07-22
    • 1970-01-01
    • 1970-01-01
    • 2021-07-25
    相关资源
    最近更新 更多