段階 6 · 出版・マクロ・パッケージ 46 / 48 ≈ 18 分で読める

LaTeXのbookクラス:部・章・前付から頁眉まで

book クラスは、いくつもの決定を代わりに下しています。どんな区分単位が存在するか、それぞれが頁のどこから始まるか、番号はどこで振り直されるか、どの余白がノド分を背負うか。その中身が読めていれば、学位論文は他人から受け継いだテンプレートコードの山ではなくなり、一つひとつを意図的に書き換えられるようになります。

    四つのクラス、一つのカーネル、オプションが動かすもの

    article・report・book・letter は、LaTeX 基本配布のたった一つのソースから展開される兄弟で、区分コマンドの機構は共通、違いは少数の設定に集約されます。\chapter も \part も存在するのが book と report の二つだけ、\frontmatter・\mainmatter・\backmatter は book 専用です。つまり book の代わりに report を選ぶのは見た目の選択ではなく、「章番号がスイッチ一つで止まるか」と「両面印刷を前提とするか」を表明する行為になります。

    既定値も同じ話をします。book は twoside と openright が既定で、\pagestyle{headings} で始まります。report は oneside が既定で家具は \pagestyle{plain}、章番号も頼まなければ振りません。article には章そのものが無く、ページ番号はフッター側へ回ります。片方のクラスをもう片方で再現し始めているなら、クラス選びを間違えています。

    提出の場で効いてくるオプションは、10pt・11pt・12pt(これは基本クラスだけの話で、もっと細かい指定が要るなら KOMA の fontsize=12.5pt へ移ります)、a4paper か letterpaper、oneside/twoside、openright/openany、titlepage/notitlepage、数式の寄せ位置を決める fleqn と leqno、そして draft/final です。どれもしっかりクラス内部のスイッチを切り替えるだけの話で、クラスがそれらを読むのは \documentclass の瞬間に一度限りです。だからラッパファイル側から \PassOptionsToClass で送る以外に到達手段が無いことがあります。

    代替として知っておく価値があるのは二系列です。KOMA-Script(scrbook)は上の大半を文書化されたオプションとして公開し、番号は付けないのに登録はされる区分用の \addchap/\addsec も添えてきます。memoir は章スタイル・頁眉・キャプション・tocbibind の挙動を単一のクラスへ畳み込み、\chapterstyle{header} のようなコマンドで切り替えます。大学テンプレートの実体が book に \makeatletter の当て書き四十行を貼り付けたものなら、だいたい memoir の再発明です。

    \textstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \displaystyle \lim_{N\to\infty} \sum_{n=1}^{N} \frac{1}{n^{2}}
    \textstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \displaystyle \lim_{N\to\infty} \sum_{n=1}^{N} \frac{1}{n^{2}}

    frontmatter・mainmatter・backmatter が実際に切り替えるもの

    三つの定義を、クラスからそのまま写します。このあたりを巡る言い伝えは、決まった一点で間違っているからです。\frontmatter の中身は \cleardoublepage、続いて \@mainmatterfalse、そして \pagenumbering{roman}。\mainmatter は \cleardoublepage、\@mainmattertrue、\pagenumbering{arabic}。\backmatter は条件付きの改頁と \@mainmatterfalse だけで、ページ番号には一切触りません。

    要するに、三つのうち二つはページカウンタを振り直し、三つとも \if@mainmatter というスイッチを動かし、ページスタイルを変えるものはゼロです。「前付は plain、本編は headings」という定番の説明は裏返っています。book が headings をインストールするのは文書全体に対して一度きりなので、目次頁に走りが出て当然だということ。消したければ \thispagestyle{empty} で個別に黙らせるか、自分で \pagestyle{plain} を当てるしかありません。

    \if@mainmatter の仕事はもっと狭く、そこが見落としやすい。\@chapter の中で握っているのは、\refstepcounter{chapter}、\typeout のログ行、そして目次エントリに \numberline を付けるかどうかです。後付に書いた \chapter が番号なしで目次に載り、しかもマークまで設定されるのはこの挙動の帰結。索引や参考文献には正しくて、番号付きで残したい付録の章には間違いで、それを担当するのが \appendix です。

    振り直しの別の帰結は、噛まれるまで見えません。ローマ数字の 1 とアラビア数字の 1、同じ「1」を打った頁が二枚存在することになります。ページ参照の機構は印字された番号を鍵にするので、\pagenumbering を何度も切り替える論文ではリンクが別頁へ着地することがある。荒っぽい解消策が hypertexnames=false で、丁寧な方は \frontmatter を \maketitle より前にではなく後に置くことです。

    Timeline of a book: front matter with roman numbers, main matter restarting at arabic 1, back matter, and where the recto and blank verso pages fall \frontmatter · \pagenumbering{roman} · NO CHAPTER NUMBERS title page \thispagestyle{empty} unnumbered and uncounted in practice contents i–iii \tableofcontents plus \listoffigures, \listoftables, preface blank iv verso left by \cleardoublepage THE ONLY TWO THINGS \mainmatter CHANGES: NUMBERING STYLE AND \@mainmatter \mainmatter = \cleardoublepage + \@mainmattertrue + \pagenumbering{arabic} Part I · page 1 \part → \thispagestyle{empty} part page is a recto; \@endpart adds a blank Chapter 1 · page 3 \chapter → \thispagestyle{plain} openright forces the recto; \@topnum=0 so no float lands chapters 2 … n · running arabic \ps@headings: even page = author/titles, odd page = marks set by \chaptermark, page numbers in the outer corners backmatter · arabic continues, chapters unnumbered \backmatter = \if@openright\cleardoublepage\else\clearpage\fi + \@mainmatterfalse ← no \pagenumbering here appendices, bibliography, index: \chapter still enters the TOC, without a number What does NOT switch: the page style book sets \pagestyle{headings} once, in the class — \frontmatter leaves it alone, so your contents pages get running heads unless you ask otherwise: \addtocontents{toc}{\protect\thispagestyle{empty}} · \pagestyle{plain} inside front matter Number restarts are why a thesis needs care with hyperref: two pages can both be “1”. If links jump to the wrong one, hypertexnames=false makes anchor names count occurrences instead of reusing numbers.
    前付はローマ数字、本編は 1 から振り直すアラビア数字、後付が動かすのは番号のスイッチだけ——三つどれもページスタイルは触りません。

    part と章、それぞれが開くページ

    \chapter は \if@openright\cleardoublepage\else\clearpage\fi で始まり、続けて \thispagestyle{plain}、そして \global\@topnum\z@。人々が半日を費やすのは三つ目です。クラスは章開きの頁の上部にフロートを禁じているので、\chapter の直後に置いた図は次の頁へ流れて行きます。処方箋は \afterpage{\clearpage}、明示的な [ht] 指定、あるいは受け入れること——印刷本は現にそうしています。

    標題ブロックそのものが \@makechapterhead です。\vspace*{50\p@} の後に \huge\bfseries の行で \@chapapp\space\thechapter を打ち、\vskip 20\p@、章題を \Huge\bfseries、締めに \vskip 40\p@。\interlinepenalty\@M が掛かっているので長い章題は途中で裂けません。全体は \raggedright と \parindent\z@ のグループに包まれ、後ろに \@afterheading が続きます。章題の直後の段落がインデントされないのは、この呼び出しの仕業です。

    一段上の \part は専用の頁を持ち、\thispagestyle{empty} を使います。twoside かつ openright なら、クラスは \@endpart で区切りを打ち、ここに白紙の verso(左ページ)が一枚挟まります。これはバグでも、部数に算入される無駄紙でもなく、recto/verso の作法そのもの。部を任意の位置から始めさせたいならクラスオプションは openany で、これは章にも効きます。

    \appendix は区分ではなくスイッチです。\@chapapp を \appendixname へ置き、\thechapter を \Alph{chapter} に変えるので、以後の \chapter は Appendix A、B、C という番号付きの見出しを出します。置く場所が要点で、本編の中にあること。\backmatter の後では章に番号が立たなくなるので、付録のアルファベットは黙って消えます。

    \int_{\Omega} \nabla u \cdot \nabla v\,\mathrm{d}x = \int_{\partial\Omega} v\,\frac{\partial u}{\partial n}\,\mathrm{d}s
    \int_{\Omega} \nabla u \cdot \nabla v\,\mathrm{d}x = \int_{\partial\Omega} v\,\frac{\partial u}{\partial n}\,\mathrm{d}s
    The vertical anatomy of a book chapter opening page as the kernel builds it, with each skip labelled HOW \chapter BUILDES THE OPENING PAGE (\@MAKECHAPTERHEAD, BOOK CLASS) \vspace*{50\p@} — the star matters: without it TeX drops glue at the top of a page Chapter 4 ← \huge\bfseries \@chapapp\space\thechapter \vskip 20\p@ after \par\nobreak Boundary Value Problems ← \Huge\bfseries #2 \vskip 40\p@ then \noindent text follows first paragraph: \raggedright, \parindent=0pt inside the heading group, \@afterindentfalse + \@afterheading suppress the indent of the paragraph after the title \ps@plain puts the page number in the footer here \global\@topnum\z@ → no float at the top so a figure you placed first drifts to the next page 50pt 20pt 40pt THE FOUR WAYS TO RESTYLE IT, IN ORDER OF PAIN 1 · \renewcommand{\chaptername}{Part} · \renewcommand{\thechapter}{\Roman{chapter}} names and counters only — no layout touched, safe in any class 2 · titlesec: \titleformat{\chapter}[display]{\Huge}{Chapter \thechapter}{20pt}{} declares the shape instead of copying kernel code; \titlespacing sets the skips 3 · \makeatletter \def\@makechapterhead#1{…} \makeatother works, and breaks silently for a class you did not read — memoir and KOMA exist so you do not have to in memoir: \chapterstyle{header}; in scrbook: \addchap plus titlestyle options
    カーネルが組み立てる章開きの頁:三つのスキップ、二つの字号、そして「章題より上にフロートを置かない」規則。

    include と includeonly、ついてくる改頁

    \include{ch2} は名前のきれいな \input などではありません。まず改頁し、openright が有効なら recto まで進めます。メインの .aux へ \@input{ch2.aux} の行を書き、対象ファイルを読み終えると、また改頁します。二組の改頁があるから章はフロートを隣の章へ逃さず、同時に \include は想定より遅い——章のたびに保留中のフロートを全部押し出すからです。

    組版の慣行はここから決まります。ファイルは一章につき一つ、それより小さい単位は \input。入れ子の \include はカーネルが拒否するので、章ファイルが節ファイルを \include するのはエラーです。逆に \input は好きなだけ入れ子にでき、自前の改頁も連れてきません。

    \include 済みのファイルは各々が .aux を持つため、\includeonly{ch2,ch5} は文書を偽らない部分ビルドになります。飛ばした章も、前回のビルドから残るラベル・カウンター・目次行を維持できる程度には読まれているので、章番号も \ref も全文ビルドと同じ値のまま。第五章に取り組むことと、別の文書に取り組むことの差がこれで、後者を本当にくれるのは subfiles や standalone です——ただし番号は全文と合わなくなります。

    失敗の形が二つあります。一度 \include したファイルを後で改名すると、メインの .aux に古い \@input の行が残ります。すると通過のたびに存在しないファイルの確認を求められるので、.aux を消すか latexmk -C に消させます。もう一つは参考文献の位置で、\bibliography や \printbibliography は最後の \include より後、後付に置きます。部分ビルドで読み飛ばされ得る章ファイルの中へ入れてはいけません。

    How include differs from input: forced page breaks, one aux file per chapter and the includeonly subset that keeps numbering intact WHAT \include{ch2} EXPANDS TO, IN ORDER \clearpage flushes every pending float \cleardoublepage if openright: + a blank verso \write\@mainaux{\@input {ch2.aux}} ← the hook \input{ch2} your text, verbatim \clearpage again after the file SO THE PROJECT LAYOUT FOLLOWS FROM THE MECHANISM thesis.tex \includeonly{ch2,ch5} comment out for a full build \frontmatter \maketitle \tableofcontents \mainmatter \include{ch1} \include{ch2} … \include{ch9} \backmatter \include{biblio} \printindex \includeonly still reads ch1 and ch3 to the end, so \chapter numbers,\tdot labels and the TOC stay identical — only the pages stop being typeset what sits in the aux files thesis.aux → \@input{ch1.aux} … \@input{ch9.aux} ch2.aux → \newlabel{eq:bc}, \citation{...}, \chapter{...} TOC lines, \@writefile a chapter you leave out with \includeonly keeps its OLD .aux, so its labels resolve as before — that is exactly why partial builds do not scramble cross-references the way \input truncation does FOUR THINGS THAT BIT EVERYONE HERE 1 · \include inside \include is refused (the kernel nests one level only); \input for sub-parts of a chapter, and it adds no page break of its own. 2 · The forced \clearpage is why a chapter that ends with a figure never lets that figure wander into the next chapter — and why \include costs you float-cycling time on a big thesis. 3 · Deleting .aux files to “fix a reference” throws away every chapter’s stored labels at once; \includeonly with a stale .aux is the opposite failure — a number you cannot reproduce. latexmk -C is the clean restart.
    include 一つにつき改頁一組と aux ファイル一つ。部分ビルドを安全にしているのはこの機構です。

    twoside の幾何:内側・外側余白、ノド、頁眉

    基本クラスは margin という語を使いません。\oddsidemargin と \evensidemargin をセットし、用紙端からの 1 インチは TeX が別枠で足します。book の 10pt では値が .5in と 1.5in、11pt と 12pt では .25in と 1.25in——きっちり 1 インチの開きがノド分で、本の内側余白が広く取られる理由です。\textwidth は 10pt で 4.5in、それ以上で 5in、\textheight はインチではなく基準線の数で測られます。

    同じ数字が、book クラスへの定番の訴えの説明にもなります。本文幅が 5in しかないのに、article の 6in で収まる 5 列の bmatrix は収まりません。直しは、ディスプレイを分割する、数式だけ字号を落とす、本文幅を意図的に広げるのいずれか。Overfull \hbox をノドへ食い込ませるのが最後に残るのは、製本で切り落とされる側だからです。

    geometry に預ければ、これらのレジスタで考えずに済みます。twoside 文書なら inner と outer が奇数・偶数の側辺余白へ対応し、物理的なノド分は bindingoffset が別枠で足し、hcentering や marginpar が残りを引き取ります。設定を優先させるため geometry はクラスの後に読み、こちらにも twoside を渡してください。余白の左右について geometry は独自の見解を持っています。

    もう一つの定番が headheight です。基本クラスは 12pt をセットしますが、本物の走りを入れる箱より小さいので、fancyhdr は値を直すまで headheight is too small を全頁で反復します。誠実な対処は \setlength{\headheight}{14pt} に \topmargin 同量の減算を添えることで、\raggedbottom でも警告を無視することでもありません。twoside の本で傍注が既定で外側へ出るのは \@mparswitch が立っているから。内側へ返したいときは \reversemarginpar を使います。

    R_{\mathrm{ext}} = \frac{1}{4\pi\varepsilon_{0}} \sum_{k=1}^{n} \frac{q_k}{\lvert \mathbf{r} - \mathbf{r}_k \lvert} \ne \mathrm{finite\ size}
    R_{\mathrm{ext}} = \frac{1}{4\pi\varepsilon_{0}} \sum_{k=1}^{n} \frac{q_k}{\lvert \mathbf{r} - \mathbf{r}_k \lvert} \ne \mathrm{finite\ size}

    目次と各種リスト、頁眉の文言の出どころ

    目次ファイルは組版と同時に書かれます。区分コマンドは毎回 \addcontentsline{toc}{chapter}{…} を呼び、フロートは \addcontentsline{lof}{figure}{…} を呼ぶ。印刷される目次へ到達する範囲を決めるカウンターが二つあって、book では tocdepth を 1(章まで)か 2(節まで)に置き、番号をそもそも振るかどうかを secnumdepth が決めます。二つは独立なので、番号付きなのに目次に非掲載、目次に掲載なのに番号なし、が可能——まさに \chapter* に \addcontentsline を手打ちで添えた形です。

    「番号なしの章を目次に載せるには」の定石がその対です:\chapter*{Notes on notation}\addcontentsline{toc}{chapter}{Notes on notation}。KOMA なら \addchap{…} の一行で済みます。頁番号もドットリーダーも要らない項目では、保存される行の中にある \protect\numberline{} と格闘することになります。リスト全体の書式を組み替えたいだけなら、カーネルを触らなくていい titletoc か tocloft の方が速い。

    自作のリストは、拡張子を変えた同じ仕組みです。\chapter*{List of Symbols} の中へ \@starttoc{sym} を置き、項目は \addcontentsline{sym}{symbol}{…} で書けば、記号一覧も図案一覧も略語集も、目次と寸分同じ手順で \include を生き延びます——章ごとの .aux が集め、メインの .aux が束ねる形です。ヘルパーは @ を名前に入れているので、両端は \makeatletter で包んでください。

    頁眉は別の配管です。headings ページスタイルが読むのは \leftmark と \rightmark、その中身は \markboth/\markright の値で、区分コマンドが \chaptermark と \sectionmark を通じて置きます。つまり頁眉に出るのは標題そのものではなく、この二つのマクロが吐くと決めた文字列。全部大文字の頁眉への処方箋が \chaptermark の再定義であり、章の第一頁だけ頁眉が化けるのは、TeX がマークを非同期的に——一枚遅れで——扱うからです。

    % 放在 preamble。改的是 book.cls 已经定义好的东西,所以要有 \makeatletter。
    \makeatletter
    
    % --- 1. chapter name and number format: no layout touched
    \renewcommand{\chaptername}{Part chapter}
    \renewcommand{\thechapter}{\Roman{chapter}}
    \renewcommand{\@chapapp}{\chaptername}       % the word printed above the title
    
    % --- 2. a quieter chapter opening than the kernel default
    \def\@makechapterhead#1{%
      {\parindent\z@\raggedright\normalfont
       \vspace*{24\p@}%
       \Large\bfseries\@chapapp\space\thechapter\par\nobreak
       \vskip 6\p@
       \huge\bfseries #1\par\nobreak
       \vskip 30\p@
       \rule{3cm}{0.4pt}\par}%
    }
    % unnumbered chapters (\chapter*) go through \@schapter, style it too:
    \def\@schapter#1{\if@twocolumn\@topnewpage[\@makeschapterhead{#1}]%
      \else\@makeschapterhead{#1}\@afterheading\fi}
    
    % --- 3. stop \chapter from forcing a right-hand start (or keep it)
    \PassOptionsToClass{openany}{book}
    
    % --- 4. running heads come from marks set by the sectioning commands
    \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
    \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
    \makeatother
    
    % --- 5. headers need the room; 12pt default headheight triggers a warning
    \setlength{\headheight}{14pt}
    \addtolength{\topmargin}{-2pt}

    標題ページと、前付の残りの部品

    既定の titlepage オプション付きの book では、\maketitle が \@title・\@author・\@date から一枚の頁を組み、\thispagestyle{empty} を当て、\cleardoublepage で締めます。著者を区切るのが \and、ダガー付きの脚注を置くのが \thanks{}、献辞頁が \dedication{}。後から値を取り出す \thetitle と \theauthor が使えるので、半扉や頁眉に標題を二度打たずに済みます。

    クラスが用意していない頁——叢書頁、ISBN と版数行を載せた奥付、印刷所表記だけの白紙 verso——は \maketitle と争わず、titlepage 環境を自分で使います。1 頁につき 1 環境、各自に \thispagestyle{empty}。このページの二番目のリストがやっていることで、\frontmatter はすでに走っているので前付のローマ数字は崩れません。

    順序をめぐる議論のほとんどは、一つの構造的な問いに帰着します。どの頁が recto でなければならないか。章は必須、部も必須、扉はそうあるべき、という順位です。それより下——奥付を半扉の verso に置くのか扉の後ろに置くのか——は出版社ごとの慣行の領域ですが、頁数は動きます。\cleardoublepage は白紙を一枚挟み込めるからです。間違えると査読者は左ページから章を読み始め、正しければ誰も気づきません。

    最後に、クラスの外側で本の部品となっているもの。PDF アウトライン用の hyperref の設定、同じ \thetitle を食わせる \hypersetup{pdftitle=…, pdfauthor=…}、imakeidx か makeidx が組んで後付で \printindex が呼ぶ .ind の索引、そして参考文献。それぞれ当サイトに別の頁を持っていますが、「前付・本編・後付のどれに落ちるか」の決定だけは book クラスの領分です。ページ番号の見た目も目次の出方も、それで決まります。

    \documentclass[11pt,a4paper,twoside]{book}
    \usepackage{tikz}
    \usepackage{hyperref}
    
    \makeatletter
    % ---- a hand-built title page: book's \maketitle is a titlepage environment
    \renewcommand{\maketitle}{%
      \begin{titlepage}%
        \thispagestyle{empty}%
        \null\vfil\begingroup
          \raggedright\Huge\bfseries\@title\par\vskip2em
          {\Large\@author\par}
          \vfill
          {\large\@date\par}
        \endgroup\vfil\end{titlepage}%
    }
    
    % ---- a custom list: register the extension, then write to it
    \newcommand{\listofsymbols}{%
      \chapter*{List of Symbols}%
      \@starttoc{sym}%
    }
    \newcommand{\sym}[2]{%
      \addcontentsline{sym}{symbol}{\textbf{#1}\hfill #2}%
    }
    \makeatother
    
    \begin{document}
    
    \frontmatter
    
    % half title: a recto with one line on it, deliberately unnumbered-looking
    \begin{titlepage}\thispagestyle{empty}\vspace*{2cm}
      \begin{center}\huge Series in Applied Analysis \# 12\end{center}
    \end{titlepage}
    
    % verso of the half title: the copyright / impression statement
    \clearpage\thispagestyle{empty}
    \small
    Boundary Value Problems. First edition, 2026.\\
    Printed on acid-free paper. All rights reserved.
    
    \cleardoublepage
    \maketitle
    
    \dedication{For my advisers.}
    
    \tableofcontents
    \listofsymbols
    
    \mainmatter
    \chapter{Existence}\label{ch:ex}
    Let $\sym{L^{2}(\Omega)}{square-integrable functions on $\Omega$}$ and
    $\sym{\nabla u}{the weak gradient}$ be as usual.  The symbol list above was
    written by \texttt{\string\sym}, not by hand.
    
    \addcontentsline{toc}{chapter}{Notes on notation}
    \chapter*{Notes on notation}
    An unnumbered chapter that still appears in the contents: the pair of lines
    above is the whole trick.
    
    \end{document}

    このレッスンの早見表

    各セクションのキーコードを一行ずつ。見出しで該当箇所へ移動、コードはそのままコピーできます。

    セクション キーコード
    \textstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \displaystyle \lim_{N\to\infty} \sum_{n=1}^{N} \frac{1}{n^{2}}
    \int_{\Omega} \nabla u \cdot \nabla v\,\mathrm{d}x = \int_{\partial\Omega} v\,\frac{\partial u}{\partial n}\,\mathrm{d}s
    R_{\mathrm{ext}} = \frac{1}{4\pi\varepsilon_{0}} \sum_{k=1}^{n} \frac{q_k}{\lvert \mathbf{r} - \mathbf{r}_k \lvert} \ne \mathrm{finite\ size}
    \documentclass[11pt,a4paper,twoside]{book}

    よくある間違い

    • \frontmatter にページスタイルの変更を期待すること。動くのは番号付けと \if@mainmatter だけで、book は目次頁にも headings を掛け続けます。止めるのは自分で \pagestyle{plain} を当てるか、個別の頁を黙らせるかです。
    • \appendix を \backmatter の後に置くこと。後付では章に番号が立たないので、付録 A は気づかないうちに字母なしの見出しになります。
    • \include 済みのファイルの中でさらに \include すること。カーネルが認めるのは一段だけ。章より小さい単位には \input です。
    • 章ファイルを改名・削除したのに、メインの .aux に \@input{…} の行を残すこと。通過ごとに存在しないファイルへの確認を求められます。推測せず aux を消してください。
    • headheight is too small 警告を流すこと。走りに割り当てた空間は黙って縮みます。\headheight を設定し、同量を \topmargin から引きます。
    • \chapter*{Title} を使ったあと目次に載らないことを不思議がること。starred 形は目次行を一切書きません。\addcontentsline{toc}{chapter}{Title} を足すか、KOMA の \addchap を使います。
    • 図が次の章へ浮いていくこと。あなたのミスではなくクラスの仕様で、\chapter は \@topnum\z@ を立てるため章題より上へフロートを置かせません。フロートを動かすか、明示的に改頁します。
    • twoside の本で geometry の余白を \oddsidemargin 的な言葉で組み、偶数頁の見た目に裏切られること。inner と outer を渡し、geometry にも twoside を伝えるのが正解です。

    この課に関する質問

    book クラスの \frontmatter は具体的に何をしますか?
    三つです。\cleardoublepage で前付を右ページから始め、\@mainmatterfalse で章の番号付けを止め、\pagenumbering{roman} でページカウンタをローマ数字に振り直す。ページスタイルは変えないので、ここで驚くのが定番です。\mainmatter はアラビア数字になっただけの鏡合わせ、\backmatter は改頁と番号付けの停止だけで、アラビア数字の続きはそのまま流れます。
    学位論文には book と report、どちらを使うべきですか?
    両面印刷する文書なら book です。twoside と openright が既定で、走りも最初から入り、ノド分として内側余白も広がります。片面 PDF として提出するなら report が素直で、章番号は単純に済み、ページスタイルも plain 側です。\chapter も \part も両方ありますが、前付・本編・後付の三つは book 専用。report 系のテンプレートが \pagenumbering を手で打って前付を偽装するのはそのためです。
    章を必ずしも右ページから始めないようにするには?
    クラスへ openany を渡します:\documentclass[twoside,openany]{book}。クラスは \cleardoublepage の代わりに \clearpage で改頁するようになり、白紙の左ページが挟まりません。所属機関が章の recto 始まりを要求するなら openright を残し、執筆中の短縮は \includeonly でやるのが安全です。openany は文書全体の改頁を動かします。
    番号なしの章を目次に載せるには?
    行を自分で書きます。\chapter*{Bibliography} の直後に \addcontentsline{toc}{chapter}{Bibliography}。starred 形が消すのは番号だけで、目次行は消えません。二つは独立です。KOMA-Script なら \addchap{...}、memoir なら \chapterstar に \addcontentsline を添える形。項目から番号の書式ごと消えるなら、犯人は \chapter の呼び出しではなく、保存された行の中の \protect\numberline です。
    book・report・memoir の本当の違いは?
    book と report は同じカーネルコードに既定値を塗り替えた別物です。章と部を両方持つ点、book が twoside と headings、report が oneside と plain、三つの matter コマンドは book のみ。memoir は設計が別で、章スタイル・頁眉・キャプション・脚注・標題・目次系のパッケージを一つの文書化されたインターフェースへ吸収します。\chapterstyle{header} の一行が、@ コマンドの当て書き二十行に相当します。中間に位置するのが KOMA-Script の scrbook で、移行の痛みは一番軽いです。
    一つの PDF でページ番号の 1 が二回出てくるのはなぜですか?
    設計どおりです。\frontmatter が前付を i、ii、iii と数える一方、\mainmatter はアラビア数字の 1 で振り直します。印刷本も同じことをしています。PDF で困るのは印字された番号が重複する箇所で、その番号を鍵に使う仕組み——リンクやブックマークの一部を含め——が誤った頁を選ぶことがあります。hyperref の hypertexnames=false は、印字値を信じる代わりに出現回数でアンカーを名付けるスイッチです。

    ライブ playground:LaTeX を編集して即描画

    入力すると即座にプレビューが更新されます。わざと壊してエラーの見た目も確認しましょう。

    KaTeX エラー
    例を試す

    続けて読む

    同じ話題への三つの入口:記法そのもの、それを教える課、そして実際に使っている記事。