LoginSignup
7
5

More than 5 years have passed since last update.

[Tex] How to install Tex in Mac by Homebrew

Posted at

はじめに

Texを導入方法を調べるとめっちゃ面倒な方法が多くて…泣
でも、確かbrewでできるよな!
って気づいたので、その簡単な方法をメモっときます。

注意事項

SSDなどを10GBほど占領するので容量に余裕がある人限定です。
大した操作はないけど、installにはめっちゃ時間かかるから時間にも余裕がある時に行うのを推奨します。

インストール手順

前提条件

・Homebrewがinstallされていること
  →installしてない場合はこちら
・Homebrew-Caskがinstallされていること
  →installされていない場合はbrew tap caskroom/caskを実行

Homebrewでinstall

terminal
$ brew update 
$ brew cask install mactex

tlmgrのPATH設定

下記コードを一番下に記載する。
shellをbashを使用してる人は~/.bash_profileに上記コードを記載すること。

~/.zshrc
export PATH=/usr/local/texlive/2018/bin/x86_64-darwin:$PATH

tlmgrでパッケージ管理

下記コマンドの実行直後にMacの管理者パスワード入力を求められる。

terminal
$ sudo tlmgr update --self --all
$ sudo tlmgr paper a4

動作確認

サンプルファイルの作成

下記のようなサンプルファイルを作成する。

sample.tex
\documentclass{jsarticle}
\begin{document}
\section{日本語}
今年は暑かった。
\end{document}

PDFを作成

今回はterminalから確認する。

terminal
$ platex sample
$ dvipdfmx sample 

これでsample.pdfが作成され、記述内容が合っていれば完了です!

参考文献

Homebrewを使ったmactexのインストール・アンインストール
MacでTeXを使えるようにした

7
5
1

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
7
5