0
1

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 3 years have passed since last update.

IntelliJでLateX環境を作る(Mac)

Last updated at Posted at 2021-11-04

環境

  • Mac OS Catalina 10.15.7
  • Homebrew 3.3.2

MacTeXのインストール

MacTeXとは

MacTeX は TeX Live をベースにした macOS 専用の TeX ディストリビューションです。 TeX Live をフルインストールし,オプションでいくつかの追加アプリケーションもインストールします。

MacTeX - TeX Users Group

インストール

homebrewを利用してインストールできます。インストールには時間がかかります。

/*GUIアプリケーションも込みでインストール、今回はこちら*/
$ brew install --cask mactex 

/*GUIアプリケーションを除いたものをインストール*/
$ brew install --cask mactex-no-gui 

以下のコマンドウを実行して最新版にアップデート、デフォルトの用紙サイズをA4に変更します。

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

/Library/Tex/texbinに諸コマンドが格納されています。

サイトからのダウンロードだと完全なアンインストールが難しくなるようなのでbrewを用いたインストールがおすすめです。

MacTeX をおすすめできる場合とそうでない場合(私見)

IntelliJ IDEAの諸設定

Pluginの導入

TeXiFy IDEA

Preferences → Plugins → texで検索
TeXiFy IDEA - IntelliJ IDEs Plugin | Marketplace

PDF Viewr

Preferences → Plugins → PDFで検索
[PDF Viewer - IntelliJ IDEs Plugin | Marketplace]
(https://plugins.jetbrains.com/plugin/14494-pdf-viewer)

PDF出力に伴うRun/Debug Configrationsの設定

Run/Debug Configrationsの設定

  1. '+' → Shell Script を選択

  2. Script Path : スクリプトが存在するパスを指定

    Working Directory : PDF出力したいtexファイルが存在するパスを指定

    Execute in Terminal : チェック

Shell Scriptの例

for file in *.tex #ディレクトリ直下のtexファイルに対して処理
do
  filename=${file%.*} #拡張子を除いたファイル名を取得
  platex "$filename" 
  dvipdfmx "$filename"
done

画面

画像のようにtexファイルを編集、実行するとすぐにPDFに反映するような形で作業が進められます。
スクリーンショット 2021-11-04 21.31.23.png

おわりに

ご拝読ありがとうございました。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?