LoginSignup
0
0

More than 1 year has passed since last update.

VSCode ユーザースニペットの\\の謎

Posted at

困った

test.tex
\newcommand{\foo}{\{bar\}}

上記のような \ を含む出力を得たい場合,

latex.json
{
    "bad": {
        "prefix": "test",
        "body": ["\\newcommand{\\foo}{\\{bar\\}}",],
        "description": "bad",
    },
}

のように \ $\rightarrow$ \\ とすれば良さそうだが,実際に得られる出力は

test.tex
\newcommand{\foo}{\{bar}}

となってしまう.

解決

latex.json
{
    "good": {
        "prefix": "test",
        "body": ["\\newcommand{\\foo}{\\{bar\\\\}}",],
        "description": "good",
    },
}

と最後の \\\\\ とすれば良い.

なんで?

全然わからん.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0