在法语模式下使用 csquote 引用常见的乳胶引号并在 SublimeText 中保留特定的突出显示

在法语模式下使用 csquote 引用常见的乳胶引号并在 SublimeText 中保留特定的突出显示

我正在使用带有 Latexing 的 Sublime Text3,并且我搜索以了解是否可以在编译过程中自动替换 latex 的常规''mytext""引号\enquote{}

这看起来很傻,但是,a)如果我想显示法语引号,而不是英语引号“”,我需要使用 csquote。b)如果我使用 csquote,我需要写入,\enquote{}结果,我失去了漂亮的亮点对于此特定语法''mytext""

因此,我搜索了如何在法语模式下使用 csquotes 包来保持漂亮的亮点,您认为这可能吗?

答案1

如果你仔细查看,Preferences > Package Settings > LaTeXing > Keybindings - Default你会发现这个键绑定:

{
    "keys": ["\""],
    "command": "insert_snippet", "args": {"contents": "``$0''"},
    "context": [
      {"key": "eol_selector", "match_all": true, "operand": "comment.line.percentage", "operator": "not_equal"},
      {"key": "selection_empty", "match_all": true, "operand": true, "operator": "equal"},
      {"key": "selector", "operand": "text.tex.latex", "operator": "equal"},
      {"key": "selector", "operand": "source.r", "operator": "not_equal"},
      {"key": "selector", "operand": "meta.block.parameters.knitr", "operator": "not_equal"},
      {"key": "selector", "operand": "meta.block.parameters.knitr", "operator": "not_equal"},
      {"key": "setting.auto_match_enabled", "operand": true, "operator": "equal"}
    ]
},

这是负责自动完成的功能。

如果你把以下内容

{
    "keys": ["\""],
    "command": "insert_snippet", "args": {"contents": "\\enquote{$0}"},
    "context": [
      {"key": "eol_selector", "match_all": true, "operand": "comment.line.percentage", "operator": "not_equal"},
      {"key": "selection_empty", "match_all": true, "operand": true, "operator": "equal"},
      {"key": "selector", "operand": "text.tex.latex", "operator": "equal"},
      {"key": "selector", "operand": "source.r", "operator": "not_equal"},
      {"key": "selector", "operand": "meta.block.parameters.knitr", "operator": "not_equal"},
      {"key": "selector", "operand": "meta.block.parameters.knitr", "operator": "not_equal"},
      {"key": "setting.auto_match_enabled", "operand": true, "operator": "equal"}
    ]
},

在您的用户键绑定(来自首选项)中,您可以获得您所要求的内容。

至于语法高亮,可以做到,但需要修改.tmLanguageLaTeXing 文件,这更复杂,并且可能会随着软件包的更新而中断。 想法是将string范围分配给 的参数\enquote

相关内容