てきとーになんか書きます

過去の記事はね,汚点.

TeX環境

はじめに

軽いまとめとして自信のTeX環境のまとめをしたかった.適宜追加はしたい.
最新版は

spark6251.hatenablog.com

2016/12/02追記.

使用しているパッケージ

大体CTANに落ちているものだと思うが,構築が結構前なものもあるので怪しい.

\documentclass[12pt,a4paper,uplatex]{jsarticle}
\usepackage[dvipdfmx]{graphicx}
\usepackage{ascmac}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[thmmarks]{ntheorem}
\usepackage{lscape}
\usepackage{enumitem}
\usepackage{cite}
\usepackage{float}
\usepackage{comment}
\usepackage{multicol}
\usepackage{mathptmx}
\usepackage[left=20truemm,right=20truemm,top=25truemm,bottom=25truemm]{geometry}

まずはこれらを1つ1つ説明していく.

CTAN: Package graphicx

画像ファイルを扱う.

ascmac

複数行で枠を囲む.

amssymb

数学で使う文字を整える.
例えば

$\textbb{R},\mathfrak{m}$

でそれぞれ白抜きのR,ドイツ文字のmになる.

CTAN: Package amsmath

数学環境を整える.
正直言って何が入っているのかは知らないけど\begin{align*}\end{align*}などはこれがないと使えない.

CTAN: Package ntheorem

定理環境.
要するにDef 1.xとか定理2.x.yとかそういうの.筆者の環境では

\theorembodyfont{\normalfont}
\theoremstyle{break}
\newtheorem{Def}{Def}[subsection]
\theoremstyle{break}
\newtheorem{thm}{Thm}[subsection]
\theoremstyle{break}
\newtheorem{lem}{Lem}[subsection]
\theoremstyle{nonumberplain}
\theoremsymbol{\ensuremath{\blacksquare}}
\newtheorem{pf}{pf}
\theoremstyle{break}
\newtheorem{eg}{e.g.}[subsection]
\theoremstyle{nonumberplain}
\newtheorem{sign}{目標}

になっている.
どうも\theoremstyleを複数適用できなさそうで,例えば証明は「番号付け無し」且つ「まず改行」させたいのだけれど,どちらかしかできなさそう.
両方applyするにはどうしたらいいんだろう.
[thmmarks]の記述がなければ,定理環境において記号の使用ができない.
また\theorembodyfont{\normalfont}の指定がなければ以降でアルファベットが勝手にイタリックになるよう.
……そういえばfactがないな.

CTAN: Package lscape

横置きを設定できる.

CTAN: Package enumitem

リストを色々いじれる.
ググれば色々触り方は出てくる.

CTAN: Package cite

参考文献とかで使うやつ.

CTAN: Package float

キャプションの設定とか色々.

CTAN: Package comment

複数行コメントが使える.

\begin{comment}
複数行
複数
\end{comment}

CTAN: Package multicol

2段組とかできる.

CTAN: Package mathptmx

数式のフォントをTimesに変更するらしい.
花文字をより花文字っぽくする目的で使用した.

CTAN: Package geometry

余白の設定.筆者は

\usepackage[left=20truemm,right=20truemm,top=25truemm,bottom=25truemm]{geometry}

である.長さ指定にはtrueが必須である.

ページ先頭のセクションの上の余白をなくす.

\makeatletter
\def\@startsection#1#2#3#4#5#6{%
\if@noskipsec \leavevmode \fi
\par
\@tempskipa #4\relax
\@afterindenttrue
\ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse
\fi
\if@nobreak
\everypar{}%
\else
\addpenalty\@secpenalty\addvspace\@tempskipa
\fi
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

コピーをしたので実際どういう動作をしているのかは知らない.

キャプションをゴシックにする

\makeatletter
\long\def\@makecaption#1#2{\sf
\vskip\abovecaptionskip
\iftdir\sbox\@tempboxa{#1\hskip1zw#2}
\else\sbox\@tempboxa{#1~ #2}
\fi
\ifdim \wd\@tempboxa >\hsize
\iftdir #1\hskip1zw#2\relax\par
\else #1~ #2\relax\par\fi
\else
\global \@minipagefalse
\hbox to\hsize{\hfil\box\@tempboxa\hfil}
\fi
\vskip\belowcaptionskip}
\makeatother

同上.

コマンドの定義

\newcommand{\Forall}[1]{{\forall}\hiderel{#1}\mathrm{\colon\;}}
\newcommand{\Exists}[1]{{\exists}\hiderel{#1}\mathrm{\colon\;}}
\newcommand{\openr}[1]{\left[#1\right)}
\newcommand{\openl}[1]{\left(#1\right]}
\newcommand{\open}[1]{\left(#1\right)}
\newcommand{\opencb}[1]{\left\{#1\right\}}
\newcommand{\desceq}[1]{\underset{\text{\fbox{\tiny #1}}}{=}}
\newcommand{\Lra}{\Leftrightarrow}
\newcommand{\DEF}{\underset{\textrm{Def}}{\Leftrightarrow}}
\newcommand{\IFF}{\underset{\textrm{iff}}{\Leftrightarrow}}
\def\MARU#1{\textcircled{\scriptsize #1}}
\newcommand{\ub}{\underbrace}
\newcommand{\tr}{\textrm}
\newcommand{\mb}{\mathbb}
\newcommand{\rd}{\mb{R}^\tr{d}}
\newcommand{\doub}[1]{\begin{equation*}
    \left\{
    \begin{aligned}
        #1
    \end{aligned}
    \right.
\end{equation*}
}

もうちょっと色々追加していきたい.

おわりに

意外とそんなに多くなかった.