latexmkの利用
lualatex用の.latexmkrc
ファイルを用意する。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
@default_files = ('main.tex');
$aux_dir = "build/"; $out_dir = "build/";
$max_repeat = 5;
$lualatex = 'lualatex -shell-escape -synctex=1 -interaction=nonstopmode'; $pdflualatex = $lualatex; $biber = 'biber %O --bblencoding=utf8 -u -U --output_safechars %B'; $bibtex = 'upbibtex %O %B';
$pdf_mode = 4;
|
vscode latexプラグインのインストール
名前: LaTeX Workshop
ID: James-Yu.latex-workshop
説明: Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
バージョン: 8.24.1
パブリッシャー: James Yu
VS Marketplace リンク: https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop
名前: LaTeX language support
ID: torn4dom4n.latex-support
説明: LaTeX language support for Visual Studio Code
バージョン: 3.10.0
パブリッシャー: Long Nhat Nguyen
VS Marketplace リンク: https://marketplace.visualstudio.com/items?itemName=torn4dom4n.latex-support
名前: Error Lens
ID: usernamehw.errorlens
説明: Improve highlighting of errors, warnings and other language diagnostics.
バージョン: 3.4.2
パブリッシャー: Alexander
VS Marketplace リンク: https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens
vscodeの設定
設定ファイルsettings.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| "latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.outDir": "%DIR%/build/",
"[tex]": { "editor.wordWrap": "on" "editor.suggest.snippetsPreventQuickSuggestions": false, "editor.tabSize": 2 },
"latex-workshop.latex.recipes": [ { "name": "latexmk", "tools": [ "latexmk" ] }, ],
"latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-f", "-file-line-error", "-outdir=%OUTDIR%", "%DOC%" ], }, ],
|
以上の設定で、main.tex
ファイルを保存したら自動にコンパイルしくれるはず。
たまにuplatexを書くなら
.latexmkrc
ファイルの内容を
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| @default_files = ('main.tex'); $aux_dir = "build/"; $out_dir = "build/"; $max_repeat = 5;
$latex = 'uplatex %O -shell-escape -kanji=utf8 -no-guess-input-enc -synctex=1 -interaction=nonstopmode %S'; $pdflatex = 'pdflatex %O -synctex=1 -interaction=nonstopmode %S'; $lualatex = 'lualatex %O -synctex=1 -interaction=nonstopmode %S'; $xelatex = 'xelatex %O -synctex=1 -interaction=nonstopmode %S'; $biber = 'biber %O --bblencoding=utf8 -u -U --output_safechars %B'; $bibtex = 'upbibtex %O %B'; $makeindex = 'upmendex %O -o %D %S'; $dvipdf = 'dvipdfmx %O -o %D %S'; $dvips = 'dvips %O -z -f %S | convbkmk -u > %D'; $ps2pdf = 'ps2pdf.exe %O %S %D'; $pdf_mode = 3;
|
に変更すると、uplatexを書くことができる。