4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

文字化けせずにVSCodeでLaTeXのコンパイルをする方法 (Latexmk)

Posted at

#Overview

  • 日本語が入るLaTeXファイルを,文字化けせずにコンパイルしたい
  • Latexmkを用いたい

Environment

方法

bibTeXを使うか使わないかで,タイプセットを書き直すのは非常にめんどくさいです.
なので,Latexmkを用いて,日本語が入るLaTeXファイルをコンパイルするためのタイプセットを作りました.

VSCodeのUser Settingsに,下記のオプションを追加してください.

settings.json
{
    "latex-workshop.latex.tools": [
        {
            "command": "latexmk",
            "args": [
                "-pdfdvi",
                "-latex=platex -kanji=utf-8 -synctex=1 %O %S",
                "-e",
                "$dvipdf=\"dvipdfmx %O %S\";$bibtex=\"pbibtex -kanji=utf-8\";$makeindex=\"mendex\";",
                "%DOC%"
            ],
            "name": "latexmk build"
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "command": "latexmk",
            "tools": [
                "latexmk build"
            ],
            "name": "latexmk toolchain"
        }
    ]
}
4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?