LoginSignup
6
7

More than 3 years have passed since last update.

TeXLive2016~で使える全エンジン共用プリアンブル

Last updated at Posted at 2016-07-29

まえがき

最近の日本語TeXエンジンは、従来pLaTeXだけでしたが、現在はupLaTX、XeLaTeX、LuaLaTeXという機種依存文字・Unicodeも扱える新しい物が登場しています。そのため、エンジン同士の比較を行ったり、乗り換えたりするために、比較的文書の変更が最小限で済むようなプリアンブルの書き方が求められています。そのため、その要求に応じられる、比較的新しい日本語文書クラスBXjsclsを使用して、全エンジンで1行の変更もせずに使いまわせる基本的なプリアンブルを作りました。

プリアンブル

\documentclass[autodetect-engine,dvi=dvipdfmx,ja=standard]{bxjsarticle}

\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{xltxtra}
\usepackage{unicode-math}
\setmainfont[Mapping=tex-text]{TeX Gyre Termes}
\setsansfont[Mapping=tex-text]{TeX Gyre Heros}
\setmonofont[Mapping=tex]{Inconsolatazi4}
\setjamonofont[Mapping=tex]{IPAexGothic}
% \setmathfont[Mapping=tex-math]{XITS Math}
\else\ifluatex
\usepackage{unicode-math}
\setmainfont[Ligatures=TeX]{TeXGyreTermes}
\setsansfont[Ligatures=TeX]{TeXGyreHeros}
\setmonofont{Inconsolatazi4}
% \setmathfont{XITSMath}
\else
\usepackage[T1]{fontenc}
\usepackage{tgtermes}
\usepackage{tgheros}
\usepackage{inconsolata}
% \usepackage{newtxmath}
\newcommand{\symbf}[1]{\mbox{\boldmath $#1$}}
\fi\fi

設定内容

DVIエンジン: dvipdfmx((u)pLaTeXのみ)
本文: Times (TeX Gyre Termes)
見出し: Helvetica (TeX Gyre Heros)
プログラム: Inconsolata
数式(コメント解除時): Times系(XITS Math / NewTX)
ギリシャ文字の太字に「\symbf」で対応((u)pLaTeXでもOK)

画像挿入について

これの後ろに

\usepackage{graphicx}

を挿入します。dvipdfmxオプションは不要です。他のDVIエンジンに依存するパッケージも同様です。

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