ふだんはEmacs使いで,VSCodeに(も)そんな機能あるんだと思いやってみました。
「ファイル/ユーザー設定/ユーザー スニペットの構成」から
メニューの「latex」を選んで設定画面を表示させ,//
はコメントなので
それ以外の部分をコピペして次のように書きました。
json
1{
2 // Place your snippets for latex here. Each snippet is defined under a snippet name and has a prefix, body and
3 // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
4 // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
5 // same ids are connected.
6 // Example:
7 // "Print to console": {
8 // "prefix": "log",
9 // "body": [
10 // "console.log('$1');",
11 // "$2"
12 // ],
13 // "description": "Log output to console"
14 // }
15 "figure": {
16 "prefix": "figure",
17 "body": [
18 "\\begin{figure}[H]",
19 "\\centering",
20 "\\includegraphics[width=0.8\\hsize]{.png}",
21 "\\caption{画像}",
22 "\\label{fig:}",
23 "\\end{figure}"
24 ],
25 "description": "画像出力用テンプレート"
26 }
27}
.tex
ファイルを開いて figure
と入力して項目を選んだところ…うまくいきました。
質問者と何が違うんでしょうねぇ…
エラーメッセージ自体は対応していない中括弧がある時に出るような気がするので,
目に見えない対になっていない括弧が設定ファイルのどこかにあるのではないでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/06/16 13:03