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

LaTeXで文書を書く時によく使う設定などの備忘録

Last updated at Posted at 2018-02-25

注意

それぞれの意味が何であったのかをメモし忘れたので,後で書きます.
なお,TeXLiveのuplatex+dvipdfmxを普段は使用しています.

また,日本語フォントの埋め込みに関しては,色々と変わっている所があるようなので,現在のバージョンに適合しないかもしれません(未検証).
ご注意下さい.
ここここを読むと良い気がします.

TeXLiveにおける日本語フォント埋め込みのセットアップ

セットアップは1回やればよいので,この記事に書くべきか迷ったけれど,とりあえず書いておきます.

  • macOS Sierra 10.12.6
  • TeXLive 2018

日本語組版でヒラギノフォントなどを使用する場合は,その設定を行うパッケージが必要.
それらはメインストリームのリポジトリ(main)からTLContribというリポジトリに移動した模様.

リポジトリの設定方法を参考にして,リポジトリを追加:

$ tlmgr repository add http://contrib.texlive.info/current tlcontrib
$ tlmgr pinning add tlcontrib '*'
$ sudo tlmgr update --self --all

次に必要なパッケージをインストール:

$ sudo tlmgr install japanese-otf-nonfree
$ sudo tlmgr install japanese-otf-uptex-nonfree
$ sudo tlmgr install ptex-fontmaps-macos
$ sudo tlmgr install cjk-gs-integrate-macos

その後は,TeXWikiの解説に従って,フォント関連の設定を実行:

$ sudo cjk-gs-integrate --link-texmf --cleanup
$ sudo cjk-gs-integrate-macos --link-texmf
$ sudo kanji-config-updmap-sys --jis2004 hiragino-elcapitan-pron

ここまで実行すれば,日本語のフォント(上の場合はヒラギノ)が埋め込まれるようになる.
フォントが埋め込まれているかどうかは,Adobe Readerなどで開いて「プロパティ」から,またはpdffontsコマンドなどで確認できる.
最後のコマンドについては,自分の環境に合致したコマンドを実行すること.

TeXファイル内で行うパッケージなどの設定

まずは,冒頭の部分,クラスファイルを指定する前に:

\RequirePackage[l2tabu, orthodox]{nag}

次はpreamble:

\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[full]{textcomp}
\usepackage[utf8]{inputenc}

\usepackage[all,warning]{onlyamsmath}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{type1cm}
\usepackage{amsthm}

%% ここからは好きなものを使う.同時に使えないものもある.

%\usepackage{newtxtext}\usepackage[varg]{newtxmath}
\usepackage{newpxtext}\usepackage[varg]{newpxmath}
\usepackage[zerostyle=c]{newtxtt}

% \usepackage{txfonts}
% \usepackage{euler}

参考文献

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