SublimeText3でUTF-8のLaTeX環境を構築する(Mac)


確認済みのバージョン

  • macOS Mojave
  • Sublime Text 3
  • MacTex2019

手順

  • MacTex2019のインストール(時間かかります)
brew cask install mactex
  • PDF ViewerのSkimをインストールする
brew cask install skim
  • Sublime Text 3をインストールする
  • SublimeにPackage ControlをインストールしてLaTeXToolsをインストールする

  • Sublimeのメニュー[Preferences]->[Package Settings]->[LaTeXTools]->[Settings-User]を選択してLaTeXTools.sublime-settingsのbuidlder_settingsの部分を下記のように編集する

LaTeXTools.sublime-settings
    "builder_settings" : {

        // General settings:
        // See README or third-party documentation

        "command" : ["latexmk", "-cd",
                "-e", "$latex = 'platex %O -no-guess-input-enc -kanji=utf8 -interaction=nonstopmode -synctex=1 %S'",
                "-e", "$biber = 'biber %O --bblencoding=utf8 -u -U --output_safechars %B'",
                "-e", "$bibtex = 'pbibtex %O %B -kanji=utf8'",
                "-e", "$makeindex = 'upmendex %O -o %D %S'",
                "-e", "$dvipdf = 'dvipdfmx %O -o %D %S'",
                "-f", "-%E", "-norc", "-gg", "-pdfdvi"],

        // (built-ins): true shows the log of each command in the output panel
        "display_log" : false,

        // Platform-specific settings:
        "osx" : {
            // See README or third-party documentation
        },

        "windows" : {
            // See README or third-party documentation
        },

        "linux" : {
            // See README or third-party documentation
        }
    },

確認

下記のソースをコピペしてCtrl+bを押し、Skimが起動すればOKです。
初回はビルド方法を聞いてくるのでBuild With LaTeX - Traditionalを選ぶ。[Tool]->[Build With...]からもビルド方法の選択は可能です。

sample.tex
\documentclass[a4j,12pt]{jarticle}

\title{ {\LaTeX} サンプルファイル}
\author{長谷川大}
\date{\today}
\begin{document}
\maketitle

\section{はじめに}
ハローワールド!

\section{おわりに}
ハローワールド!

\end{document}