LoginSignup
6
5

More than 5 years have passed since last update.

LaTeX で日本語で普通のレポートを書くときの cookbook

Last updated at Posted at 2017-03-26

LaTeX 周りの情報は調べれば大抵あるのですが欲しい時に調べなければならないのが問題で,そうした知見がぼつぼつと溜まってきたので僕自身が2回めググらなくてよいようにまとめます.随時更新予定.ここでいう「日本語で」とは uplatex+dvipdfmx を想定していることを指し,「普通」は特定の専門分野によらない(数式周りも扱わない)ことを示します.所詮は場当たり的に調べたことの集まりなので,間違ってるとか別解があるとかでもコメントで指摘したり編集リクエストを送ったりして頂けると嬉しいです.

また,この文書は CC-BY-SA で公開します.

ふつうの文書

後で beamer-specific なことを書くのでそうでないものがこちら.

なんか用紙サイズとかがアレ

LaTeX の「アレなデフォルト」 傾向と対策#その8:用紙サイズの扱いがアレ を読もう.最終的な解決は LaTeX 文書の出力用紙サイズを指定する(だけ) ― bxpapersize パッケージ - マクロツイーター をみるといいらしい.

複数個をいっぺんに \cite するときの区切り文字を設定したい

\cite{friends0,kemono1} で [1, 2] じゃなくて [1; 2] として欲しいようなとき.以下で設定できる.

\renewcommand\multicitedelim{\addsemicolon\space}

ref. separator for citing multiple sources, some of them with page, some not

caption のフォント変えたいんだけど

\usepackage[font={small,it}]{caption}

ref. Change the font of figure captions - tex.stackexchange

ひとつの figure 環境で複数の絵を入れてそれぞれ caption 付けたい

subfigure 環境と subcaption パッケージを使おう. ref. Insert multiple figures in LaTeX

kg*m*s^{-1} とか ℃ とか ° とか,色々

siunitxを使うのがよい.
色々あるが

\usepackage{siunitx}
\si{kg.m.s^{-1}}
\si{\kilogram\metre\per\second}
\num{12345} 
\ang{180} % degrees
\degreeCelsius

とか.

tabular の各列の横幅を指定したい

tabular*tabularx を使おう,という予定だったが tabu のほうがよいらしい. ref. LaTeX/Tables#width and streaching -- wikibooks

tabularx で更に中央揃えにしたい

Centering in tabularx and X columns

1. Foo 2. Bar みたいな inline の enumerate をしたい

enumitemパッケージから

\usepackage[inline]{enumitem}
...
\begin{enumerate*}
  \item foo
  \item bar
\end{enumerate*}

本文を2段組に

\documentclass[a4paper,uplatex,twocolumn]{jsarticle}

最近は bxjsarticle 使うべきという説がありますが,なんかこんな感じで

本文2段組だけど概要はセンターで1段がいい

\twocolumn[ここは1段になる]

でよさそう.(ref. TeX文書で, 本文は2段, 概要は1段で表示させたい - 300億円欲しい)

footnote を2列で組ませたい

やってみると思ったほど綺麗ではないことがある.

\usepackage{dblfnote}
\DFNalwaysdouble

(ref.Split LaTeX footnotes into two columns - tex.stackexchange

biblatex で bibliography をxxごとに分けたい

CTAN: /tex-archive//macros/latex/contrib/biblatex/doc/examplesに大体何でもあるので参照のこと.

biblatex で bibliography のフォントを変えたい

\renewcommand*{\bibfont}{\small}
% あるいは
\AtBeginBibliography{\small}

(ref. With BibLatex, how do I make the fontsize of the bibliography smaller? - tex.stackexchange)

\citesetupよさそう

beamer

\tableofcontents を二列にしたい

普通に multicols を使えばよい.

\begin{frame}{Contents}
  \begin{multicols}{2}
    \tableofcontents
  \end{multicols}
\end{frame}

\printbibliography を複数枚にまたがらせたい

\begin{frame}[t,allowframebreaks]{References} % :::
    \printbibliography
\end{frame} % ;;;

なんか標準以外でいい theme ないの

metropolis とか…?


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

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