三日後に忘れるのでメモを残しておく
前準備
設定
こちらのサイトを参考にして.latexmk
ファイルを作成し,ルートフォルダに置く.
Winの場合,C:\Users\USERNAME
直下でよいらしい.
VSCodeでLaTeX-workshopのsettings.json
を修正する.
やはり上のサイトを参考にして,修正後は以下のように設定する.
{ "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-halt-on-error", "-pdfdvi", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} },
変更点はエラー時の設定と,pdfdvi
を使うところ.
上記の設定で実行したところ,よく分からないが,TeXStudioからコンパイルするよりも格段に早くなった. TeXStudioでのビルド設定がよくないのかもしれない. (余計なDVIチェーンとか除けば早くなる?)
中間ファイルを消す
「Build LaTeX project」を押すとビルドされる。 「Build -」の中にある「Clean up auxiliary files」を押すと中間ファイルを削除することができる.
ショートカットキーの登録
TeXStudioで使っているSCを使いたいので,VSCodeで登録する
// Place your key bindings in this file to override the defaults [ { "key": "ctrl+4", "command": "type", "args": { "text": "$$"}, "when": "editorTextFocus" },{ "key": "ctrl+shift+m", "command": "type", "args": { "text": "\\[ \\]"}, "when": "editorTextFocus" },{ "key": "ctrl+e", "command": "type", "args": { "text": "\\begin{align*}\n& \\\\\n& \n\\end{align*}"}, "when": "editorTextFocus" } ]
ちょっと面倒だけど,一回設定すれば後はjsonファイルを使い回しできるから,よしとしよう.