Skip to content

Instantly share code, notes, and snippets.

@sudodo
Forked from Ikuyadeu/vscode-latex.md
Created November 29, 2023 23:20
Show Gist options
  • Save sudodo/c5e8b02c928de10c7f00ed935b02dbcb to your computer and use it in GitHub Desktop.
Save sudodo/c5e8b02c928de10c7f00ed935b02dbcb to your computer and use it in GitHub Desktop.
VSCode でLatexの日本語環境を作る

https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop に書いてあったbibのコンパイルを日本語に対応.

  1. VSCode,Latexをインストールしてなければインストール(https://code.visualstudio.com/)
  2. Latex-Workshopをインストール(https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop)
  3. settings.json(Windows: File > Preferences > Settings または Ctrl+, Mac: Code > Preferences > Settings)に以下を追加
"latex-workshop.latex.toolchain": [
        {
            "command": "ptex2pdf",
            "args": [
                "-l",
                "-ot",
                "-kanji=utf8 -synctex=1",
                "%DOC%"
            ]
        },
        {
            "command": "pbibtex",
            "args": [
                "%DOCFILE%",
                "-kanji=utf8"
            ]
        },
        {
            "command": "ptex2pdf",
            "args": [
                "-l",
                "-ot",
                "-kanji=utf8 -synctex=1",
                "%DOC%"
            ]
        },
        {
            "command": "ptex2pdf",
            "args": [
                "-l",
                "-ot",
                "-kanji=utf8 -synctex=1",
                "%DOC%"
            ]
        }
],
"editor.renderControlCharacters": true
  1. ファイルを保存またはF1キーを押してBuild Latex Projectを実行するとコンパイルされる.
  2. F1 + View PDF File in new tabでPDFを見れる.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment