0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCode-Overleafでスニペットを利用する

0
Posted at

スニペットつかってますか

スニペット(英語: snippet)とは、「断片」という意味で、再利用可能なソースコード、マシンコード、またはテキストの小さな領域を表すプログラミング用語である。(中略) これにより、ユーザーは日常の編集操作中に繰り返し入力する必要がなくなる。
ウィキペディア-スニペットより

VSCodeにはスニペットが存在しており,毎回の決まった入力をサポートしてくれます
image.png
左下の設定>スニペットより使用したい言語のスニペットファイルを作成できます
image.png

実際に作成する

今回はLaTeX用のlatexmkrcを作成します
新規ファイルとしてlatexmkrcを作成して同様に設定からスニペットを開くとglobalのスニペットファイルが作成されます.
ここにlatexmkrcの内容を記述します.
記法は決まっています.

{
  "name":{
    "prefix":"ここに呼び出すときの入力を指定する",
    "body":[
      "入力内容を記述する",
      "'\'などの入力にはエスケープ文字を使用するか,文字コード入力を利用する"
      ],
      "description": "スニペットの説明を記述する"
    }
}

作成したスニペットファイルはGitHubにて公開しています

https://github.com/sauhits/latex_myTemplate/tree/main

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?