ドキュメント構造
最小限のドキュメント
\documentclass{article} \begin{document} Hello, LaTeX! \end{document}
ドキュメントクラス
article短いドキュメント、論文、レポート
report章を含む長いドキュメント
book部・章を含む書籍
beamerスライドプレゼンテーション
letter正式な手紙
プリアンブル
\documentclass[12pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, graphicx} \title{My Document} \author{Alice} \date{\today}
セクション分け
\part{}最上位の区切り(book / report)
\chapter{}章(report / book のみ)
\section{}セクション
\subsection{}サブセクション
\subsubsection{}サブサブセクション
\paragraph{}名前付き段落
テキスト整形
フォントスタイル
\textbf{bold}**太字**テキスト
\textit{italic}*斜体*テキスト
\underline{text}下線付きテキスト
\texttt{code}等幅 / タイプライター
\textsc{Small Caps}スモールキャピタル
\emph{emphasis}強調(文脈に応じた斜体)
フォントサイズ
\tiny最小
\small標準より小さい
\normalsizeデフォルトサイズ
\large / \Large大きい / さらに大きい
\huge / \Huge巨大 / 最大
スペースと改行
\\改行
\newpage改ページ
\vspace{1cm}垂直スペース
\hspace{1cm}水平スペース
\noindent段落インデントを抑制
~ノーブレークスペース
数式モード
インラインと表示数式
Inline: $E = mc^2$ or \( a^2 + b^2 = c^2 \) Display: \[ \int_0^\infty e^{-x} dx = 1 \] Numbered: \begin{equation} F = ma \label{eq:newton} \end{equation}
よく使う記号
^ and _上付き / 下付き:x^2a_i
\frac{a}{b}分数:a/b
\sqrt{x} / \sqrt[3]{x}平方根 / 立方根
\sum_{i=1}^{n}総和
\int_a^b積分
\lim_{x \to 0}極限
\infty無限大記号
ギリシャ文字
\alpha \beta \gamma \delta小文字ギリシャ文字
\Gamma \Delta \Theta \Lambda大文字ギリシャ文字
\epsilon \sigma \omega \piその他の小文字ギリシャ文字
\mu \nu \rho \tau \phi統計 / 物理学でよく使われる文字
行列
\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} % pmatrix = (), vmatrix = ||, Bmatrix = {}
環境
よく使う環境
documentメインコンテンツ領域
equation番号付き数式
align複数行の整列された数式
figureフローティング図
tableフローティング表
verbatimリテラルテキスト(整形なし)
abstract概要ブロック(article)
整列した数式
\begin{align} x &= a + b \\ y &= c + d \end{align} % & marks alignment point, \\ breaks lines
リストと表
リスト
\begin{itemize} \item Bullet point \item Another item \end{itemize} \begin{enumerate} \item First \item Second \end{enumerate}
\begin{tabular}{|l|c|r|} \hline Name & Age & Score \\ \hline Alice & 25 & 88 \\ Bob & 30 & 92 \\ \hline \end{tabular}
カラム指定子
l / c / r左 / 中央 / 右揃え
|カラム間の縦線
p{3cm}段落カラム(固定幅)
\hline横線
\cline{2-3}部分的な横線(カラム 2〜3)
画像の挿入
\usepackage{graphicx} % in preamble \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{img.png} \caption{A figure caption} \label{fig:example} \end{figure}
配置指定子
hここに(おおよそ)
tページ上部
bページ下部
p専用フロートページ
!内部制限をオーバーライド
H厳密にここに(float パッケージ必須)
相互参照
See Figure~\ref{fig:example} on page~\pageref{fig:example}. % Requires two compilations to resolve
参考文献
BibTeX ワークフロー
% In .bib file: @article{smith2025, author = {Smith, John}, title = {A Great Paper}, journal = {Nature}, year = {2025} }
ドキュメント内での引用
According to~\cite{smith2025} ... \bibliographystyle{plain} \bibliography{refs} % refs.bib
参考文献スタイル
plain番号付き、アルファベット順にソート
unsrt番号付き、引用順
abbrvplain と同様、名前を省略
apalike著者-年(APA 形式)
パッケージ
必須パッケージ
amsmath高度な数式環境
graphicx画像の挿入
hyperrefクリック可能なリンクと参照
geometryページ余白:\usepackage[margin=1in]{geometry}
booktabsプロ品質の表(\toprule\midrule
xcolorテキストと背景の色
listingsソースコードのリスト
tikzプログラムによるグラフィックと図
babel多言語サポート
natbib柔軟な引用(著者-年、番号)
カスタムコマンド
新しいコマンド
\newcommand{\R}{\mathbb{R}} % shortcut \newcommand{\norm}[1]{\|#1\|} % 1 argument Now use: $x \in \R$, $\norm{v}$
コマンドの再定義と環境
\renewcommand{\abstractname}{Summary} \newenvironment{boxed} {\begin{center}\begin{tabular}{|p{0.9\textwidth}|}\hline} {\hline\end{tabular}\end{center}}
便利なショートカット
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} \newcommand{\dd}[2]{\frac{d #1}{d #2}} % Usage: $\pd{f}{x}$, $\dd{y}{t}$
よく使うパターン
タイトルページ
\begin{document} \maketitle \tableofcontents \newpage
コンパイル
pdflatex doc.texPDF にコンパイル
bibtex doc参考文献を処理
latexmk -pdf doc.tex自動コンパイル(再実行を処理)
xelatex doc.texUnicode / カスタムフォントのサポート
特殊文字
\% \$ \& \# \_エスケープされた予約文字
\textbackslashテキスト内のバックスラッシュ
\{ \}リテラルの波括弧
``text''スマートダブルクォート
---em ダッシュ
--en ダッシュ
便利なヒント
\label{} + \ref{}任意のものへの相互参照
\input{file}別の .tex ファイルをインクルード
% comment単一行コメント
\usepackage{lipsum}ダミーテキスト:\lipsum[1-3]