段階 2 · テキストと文書構造 11 / 48 ≈ 19 分で読める

LaTeXの文字サイズと書体:tinyからHuge・太字・イタリック

LaTeX で大きさを変えるとは、クラスファイルが定義した十段の梯階を一段動き、その有効範囲を中括弧で決めることです。書体の側はファミリ・シリーズ・シェイプの三属性を別々に触ります。この課では各段が何ポイントになり、なぜ行送りや数式の空きまで一緒に動くのか、太字斜体が无声で太字直立に化ける罠、そして数式が本文と無関係な四段を持つことを扱います。

    十段のサイズスイッチが実際に設定しているもの

    LaTeX は入力中にポイント数を尋ねてきません。\tiny、\scriptsize、\footnotesize、\small、\normalsize、\large、\Large、\LARGE、\huge、\Huge と名前の付いた梯階を一段動くだけで、その段が何ポイントを意味するかはクラスファイルが決めます。間接参照にしてあるのは意図的で、基準サイズを一度変えれば全段・行送り・数式の空きまでまとめて動き、90 ページの報告書を組み直すはめにならないからです。

    標準 article クラスの 10pt 基準では、各段は 5、7、8、9、10、12、14、17、20、24pt、対応する行送りは 6、8、9.5、10、12、14、18、22、24、28pt です。刻みは等比ですらなく、\small から \normalsize は 1.11 倍、\normalsize から \large は 1.2 倍、\LARGE から \huge は 1.18 倍。これらの数字を暗記で引用するのは危険で、この節の最後に示した方法で自分のビルドから読み取ってください。クラスもクラスオプションも列ごとに変えてしまいます。

    サイズスイッチは同時に四つの仕事をします。新しいサイズのフォントを選ぶこと。\baselineskip、つまり基準線から基準線への名目距離を設定すること。\lineskip と \lineskiplimit を更新すること——分数やディスプレイ数式など背の高い行が続くとこちらが優先されます。そして \abovedisplayskip や \belowdisplayshortskip をはじめ周囲のグルーを作り直すこと。\small の直後に置いたディスプレイ数式が \normalsize の直後より詰まって見えるのはそのためです。ここに「字の大きさだけを変える」項目は一つも無く、だからこそ Manual はこれを書体コマンドではなくサイズ変更コマンドと呼んでいます。

    自分の文書で実際に解決された値が欲しいなら、ページではなくログへ書き出します。試したいグループの中で \makeatletter \typeout{large = \f@size pt on \f@baselineskip pt}\makeatother と書けばいい。\f@size と \f@baselineskip はすべてのサイズスイッチが定義する内部マクロ、\typeout はテキストを .log へ送る命令、\makeatletter があの @ 入りの名前を打てるようにする仕掛けです。TeX に一旦止まって答えを返してほしいときは \showthe\baselineskip が対話版になります。

    The ten LaTeX size commands as a ladder of point sizes and leading at a 10pt base COMMAND GLYPH SIZE LEADING WHAT \normalsize LOOKS LIKE NEXT TO IT \tiny 5 pt 6 pt Ag 123 \scriptsize 7 pt 8 pt Ag 123 \footnotesize 8 pt 9.5 pt Ag 123 \small 9 pt 10 pt Ag 123 \normalsize 10 pt 12 pt Ag 123 \large 12 pt 14 pt Ag 123 \Large 14 pt 18 pt Ag 123 \LARGE 17 pt 22 pt Ag 123 \huge 20 pt 24 pt Ag 123 \Huge 24 pt 28 pt Ag 123 capitalisation is the only difference between these three Values are the standard article class at its 10pt base — they come from size10.clo, so a different base or class changes every row. A size switch sets both columns, not just the point size.
    10pt 基準における十段のサイズ梯階と、それぞれが付いてくる行送り。

    宣言とグループ、そして段落終端を中括弧の内側に書く理由

    十の命令はすべて宣言です。現在のグループが終わるまで設定を変え、引数は取りません。ベースシステムに \textlarge{...} のような形は存在せず、\text… 系が用意されているのはファミリ・シリーズ・シェイプだけ、つまりサイズ変更の有効範囲は中括弧が覆った範囲そのものの {\large … } です。括弧を忘れた一行の \large が、そこから四ページ分を大きくしてしまいます。

    段落終端の位置が問題になるのは機械的な理由からです。TeX は行間のグルーを、その行が縦リストへ渡された瞬間に有効だった \baselineskip から決めます。段落の最終行がリストへ渡るのは \par が処理されるときなので、{\large text text\par} では最後の行まで大きな行送りで組まれ、{\large text text}\par では閉じ括弧が先に \normalsize を戻してしまうため、ちょうど一行だけとなりの行との距離が狂います。\par(またはその代わりとなる空行)はグループの内側に置いてください。

    環境はグループ化を代行してくれます。\begin{quote}\small …\end{quote} は \par を書かなくても安全で、\end{quote} が環境のスコープ内で段落を閉じるからです。\begin{center}、\begin{tabular} のセル、脚注、キャプションも同じ仕組みで、脚注が本文より小さく見えるのも、クラスが脚注の中身を \footnotesize で包んでくれるからです。

    そのすべてを抜けて残る罠が一つあります。サイズ変更を「元に戻す」ために呼ばれる \normalfont は、サイズにまったく触りません。ファミリ・シリーズ・シェイプを現在のサイズのまま文書の既定へ戻すだけです。本文の大きさへ戻るには \normalsize を明示的に書き、本文全体の見た目へ戻るには両方が要ります。

    Why the paragraph break has to sit inside the braces when a size declaration is in force RIGHT — \par INSIDE THE GROUP {\large line one … line two … line three …\par} every gap = the large leading, because \baselineskip is still the one \large installed when \par runs WRONG — THE BRACE CLOSES FIRST {\large line one … line two … line three …} % blank line / \par comes here the last two lines sit 8pt apart instead of 14pt: one short line, and the paragraph looks mis-set. A size switch is a declaration, so its scope is the enclosing group — and there is no \textlarge{…} command form to fall back on. Environments (quote, center, a footnote) group and end the paragraph for you, which is why they are the safer habit.
    閉じ括弧と段落終端のどちらが先かに応じて、最終行が内側のサイズの行送りを維持できるかどうかが決まります。

    太字・斜体・傾体・スモールキャップ:属性は二本別々

    LaTeX のフォント選択機構は任意の書体を五つの属性、すなわちエンコーディング・ファミリ・シリーズ・シェイプ・サイズで表します。太さはシリーズ——\mdseries(通常)に対する \bfseries(太字拡張)——で、姿态はシェイプ、\upshape、\itshape、\slshape(直立を傾けただけの傾体)、\scshape(スモールキャップ)です。それぞれに宣言形と引数を取るコマンド形があり、\bfseries/\textbf、\itshape/\textit、\slshape/\textsl、\scshape/\textsc、\upshape/\textup、\mdseries/\textmd に対応します。本文の途中では \text… のほうを勧めます。有効範囲がソースから見て取れ、外へ漏れないからです。

    フォントは属性名から名前を引いて求められるので、実在するものしか出てきません。\textbf{\textit{...}} はシリーズ bx とシェイプ it を同時に要求しますが、Computer Modern にも、それをベクターで描き直した後継 Latin Modern にも太字斜体のテキストフォントはありません。LaTeX は最も近いもので代替し、ログに Font shape `T1/cmr/bx/it' undefined, using `T1/cmr/bx/n' instead と正直に書きます。ページに出るのは太字の直立なので、ログを読まない限り差異は見えません。対策は四つの面を揃えたファミリを選ぶこと(Times 系なら newtxtext か mathptmx、Palatino 系なら newpxtext か mathpazo)、あるいは fontspec ですべての面を持つシステムフォントを使うことです。

    \emph は \textit の同義語ではありません。要求しているのは強調で、実装は姿态を見て動くため入れ子にできます。直立の本文の中では斜体を出し、斜体の中からは直立へ戻して周囲をもう一度斜体にしてくれる——組版的に正しい動作であり、スタイルガイドが \emph を書き、\textit は「文字どおり斜体で出す」ために温存せよと言う理由です。

    数式には数式の対応物があり、本文のフォントには追随しません。\mathrm、\mathbf、\mathit、\mathsf、\mathtt は数式ファミリのスイッチで、\mathbf が届くのは英数字だけなので \mathbf{\pi} はただの π のままです。必要なのは amsfonts バンドの \boldsymbol{\pi}、または \bm{\pi} パッケージの bm、こちらは演算子や区切り文字も太くなります。\pmb は少しずらした複製を重ねて太さを偽造するので、どんな文字でも太れますが輪郭はわずかに甘くなります。

    \mathrm{d}x \quad \mathbf{A}\mathbf{b} \quad \mathit{u} \quad \mathtt{code} \quad \mathsf{H} \quad \boldsymbol{\Omega} \quad \mathbb{R} \quad \mathcal{O}
    \mathrm{d}x \quad \mathbf{A}\mathbf{b} \quad \mathit{u} \quad \mathtt{code} \quad \mathsf{H} \quad \boldsymbol{\Omega} \quad \mathbb{R} \quad \mathcal{O}
    左は数式側のフォント属性を並べたもの。右は \mathbf では π が変わらず、\boldsymbol と \pmb は変わるという比較。
    \mathbf{\pi} \quad \boldsymbol{\pi} \quad \pmb{\pi} \quad \pi
    \mathbf{\pi} \quad \boldsymbol{\pi} \quad \pmb{\pi} \quad \pi
    The five font attributes LaTeX resolves, and the bold-italic cell that Computer Modern does not have A FONT REQUEST HAS FIVE PARTS T1 / cmr / bx / it / 10pt encoding · family · series · shape · size — each one is set by its own command, and the request is resolved as a whole family \rmfamily \sffamily \ttfamily series \mdseries \bfseries shape \upshape \itshape \slshape \scshape size \tiny … \Huge (the ladder of the other diagram) command forms that take an argument: \textbf \textit \textsc \texttt \emph declarations leak to the end of the group, commands cannot — that is the whole difference. THE SHAPE TABLE OF THE DEFAULT TEXT FONT (cmr) SERIES m (medium) SERIES bx (bold) shape n (upright) shape it (italic) shape sl (slanted) shape sc (small caps) Normal Bold Normal Bold — upright! Normal substituted Normal substituted No T1/cmr/bx/it file exists, so \textbf{\textit{x}} is answered with bx/n. The log line is the only symptom: Font shape `T1/cmr/bx/it' undefined Fix: a family with all four faces (newtxtext, mathpazo, any fontspec font).

    ファミリの選び方:エンコーディング、Latin Modern、読む価値のあるパッケージ

    たいていの文書の先頭二行は、後から打つどのフォントコマンドよりも効きます。\usepackage[T1]{fontenc} は旧い OT1 に代わって 8bit の西欧式フォントエンコーディングを要求し、\usepackage{lmodern} はそれをベクターで描き直した Latin Modern(字形数とヒントが改善された版)へ差し替えます。OT1 では \'e のようなアクセント付き文字は印字時に別のアクセント記号と e から合成されるため、ハイフネータは語の途中で切れず、PDF からコピーした人は「é」の代わりに「´e」を受け取り、アクセント付きの \textsc はそもそも存在しません。T1 には合成済みのスロットがあるのでこれらの問題は消えます。代償はフォント形状名が変わること(T1/cmr/m/n ではなく OT1/cmr/m/n)と、いくつかの句読点の回りが少し緩むことです。

    本文のフォントそのものを変えるときも、\rmdefault を手で書き換えずパッケージをロードします。Times 風なら newtxtext に newtxmath を組で合わせ、古い等価物が mathptmx、すでに廃止扱いが times です。あれはテキスト側のファミリしか変えないので数式は Computer Modern のまま、衝突ははっきり見えます。Palatino なら newpxtext plus newpxmath、あるいは mathpazo。書籍向きの Palatino 系なら tgpagella、Charter なら XCharter。文書を正気に保つ規則は一つだけ、本文と数式は一緒に変えるか、どちらも変えない。

    随伴する二つの書体は、本文フォントに触れず一か所ずつ切り替えられます。サンセリフが \textsf{...}/\sffamily、等幅が \texttt{...}/\ttfamily で、裏には helvet、tgheros、courier、tgtt があります。Helvetica はたいていの本文書体より視覚的に広いので、helvet は scaled=0.92、couriers は scaled=0.8 を既定にしています。サンセリフを既定にするなら導言部で \renewcommand{\familydefault}{\sfdefault} を宣言します。効くのはクラスが \normalfont で \begin{document} を選ぶ瞬間です。

    XeLaTeX か LuaLaTeX ではこの 8bit 層がまるごと消え、fontspec がそれを置き換えます。\setmainfont、\setsansfont、\setmonofont はシステムフォントの名前を取り、Unicode 文字はそのまま打て、\setmainfont{...}[BoldFont=..., SmallCapsFont=...] で個々の面まで指定できます。数式は unicode-math を欲しがるでしょう。二つの世界を混ぜないこと。fontspec を fontenc と inputenc と一緒に読むのは、pdfTeX 用テンプレートを XeLaTeX へ寄せるときの典型的な衝突です。

    \documentclass[11pt]{article}
    
    % Text encoding first, then the fonts. With XeLaTeX or LuaLaTeX you delete
    % these two lines and load fontspec instead.
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    
    % Times-like text with matching maths (instead of the obsolete "times").
    \usepackage{newtxtext}
    \usepackage{newtxmath}
    
    % Sans and typewriter companions, both optically scaled down a little.
    \usepackage[scaled=0.92]{helvet}
    \usepackage[scaled=0.8]{couriers}
    
    \usepackage{bm}       % \bm{...} bolds symbols that \mathbf cannot reach
    
    \begin{document}
    
    \textnormal{Roman (the default family).} \quad
    \sffamily{Sans serif.} \quad
    \ttfamily{Typewriter.} \normalfont
    
    \textbf{Bold.} \textit{Italic.} \textsl{Slanted.} \textsc{Small caps.}
    \emph{Emphasis, which inside \emph{italic} turns upright instead of doubling
    the italic shape.} \textup{Upright again.}
    
    \textbf{\textit{Bold italic}} -- with Computer Modern or Latin Modern this
    prints \emph{bold upright}, because no bx/it shape exists in those families;
    the log says so: \texttt{Font shape `T1/cmr/bx/it' undefined}.
    
    Maths keeps its own font switches, independent of the text family above:
    \[
      \mathrm{rank}(A) \quad \mathbf{A}\mathbf{x} = \mathbf{b} \quad
      \bm{\omega} \times \mathbf{r} \quad \mathcal{L}(\theta) \quad \mathbb{E}[X]
    \]
    
    \end{document}

    数式には数式の四段梯階がある

    数式の中は十段ではなく四つの様式で動きます。\displaystyle、\textstyle、\scriptstyle、\scriptscriptstyle。選び方は TeX の側で、ディスプレイ数式はディスプレイ様式、文中の数式はテキスト様式、下付きは一段下、そのさらに下付きは最低の段まで落ちます。差は大きさだけではありません。ディスプレイ様式なら \sum や \int の上下限が演算子の真上・真下へ来ますが、テキスト様式では横へ回り、分数も同じ規則で中身を縮みます。

    相対的な比はおよそ 0.7 と 0.5、そして「現在」が指すのは数式を囲んでいる本文の大きさです。だからこそ {\small …} で段落を包むと文中の分数も縮み、\displaystyle の途中で \small を強制すると隣の行へ食い込む行ができます。大きさは上書きできても、まわりの段落の行送りはそのままだからです。

    様式を手で指定する方法は二つ。分数には amsmath の \tfrac、\dfrac、\cfrac、それ以外にはグループの先頭へ置く \displaystyle。一番出番が多いのは array、matrix、cases の中で、あれらは既定でテキスト様式に組むため、各セルに \dfrac を置くか先頭へ \displaystyle を置かない限り、入れ子の分数は小さく出てしまいます。

    区切り文字の大きさはまた別の仕組みです。\left/\right はグループ内で最も背の高い要素に合わせて伸ばしますが、\bigl、\Bigl、\biggl、\Biggl(対応する r 付き)は四つの固定高さを順に選びます。自動サイズ調整は背の高い分数のまわりではたいてい過剰になり、& で区切られたセルをまたげません。揃えた数式が手動版を好むのはこれが理由です。

    \displaystyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptscriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}}
    \displaystyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptscriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}}

    クラスが用意していない基準サイズが要るとき

    標準クラスが受け付ける基準サイズは 10pt、11pt、12pt の三つだけで、クラスオプションとして渡します。中身は別ファイルを読むだけ。size10.clo、size11.clo、size12.clo に十段とその行送りが書いてあります。\documentclass[14pt]{article} と書いても 14pt にはなりません。未知のオプションなのでクラスは 10pt を続け、ログに忘れがたい一行、Unused global option(s): "14pt" が出ます。これが診断の全部であり、「オプションが効かなかった」はバグ報告ではなくログ読解の演習です。

    それ以外の基準サイズへの通路は四つ、どれも正規のものです。extsizes バンドは標準クラスと同じインターフェースの extarticle、extreport、extbook を同梱し、8、9、10、11、12、14、17、20pt を選べます。KOMA-script は自前のクラスに fontsize=13pt を持ち、scrextend を使えば KOMA 以外のクラスにも同じ鍵が入ります、\usepackage[fontsize=13pt]{scrextend}。fontsize パッケージは \changefontsize{13pt} と \SelectThisToChangeTheDocumentBaseSize を提供します。XeLaTeX か LuaLaTeX なら縮尺の側で解決、\setmainfont{...}[Scale=1.05] です。

    得られた値の確認は第一節と同じログの手順で。\makeatletter \typeout{base \@ptsize}\makeatother は標準の三つなら 0、1、2 を印字し、\typeout{leading \f@baselineskip} は {\normalsize … } の中で書けばクラスが選んだ段落の行送りとして読めます。

    どれに手を伸ばす前にも、文句の相手がサイズなのか空きなのかを問い直してください。詰まって見えるページはたいていポイント不足ではなく行送り不足で、導言部の \linespread{1.05}\selectfont は全行を緩めます。\selectfont は飾りではなく、\linespread が倍率を保存するだけで、次にサイズが選ばれる瞬間まで適用されないからです。setspace はこの一対を \setstretch{1.05} に包み、列表とキャプションの空きも揃えてくれます。あれは版面の課のテーマで、縦のリズムの残りもそこで扱います。

    \begin{array}{ll} \text{encoding} & \texttt{T1 / OT1 / TU} \\ \text{family} & \texttt{rmfamily / sffamily / ttfamily} \\ \text{series} & \texttt{mdseries / bfseries} \\ \text{shape} & \texttt{upshape / itshape / slshape / scshape} \\ \text{size} & \texttt{tiny \ldots Huge} \end{array}
    \begin{array}{ll} \text{encoding} & \texttt{T1 / OT1 / TU} \\ \text{family} & \texttt{rmfamily / sffamily / ttfamily} \\ \text{series} & \texttt{mdseries / bfseries} \\ \text{shape} & \texttt{upshape / itshape / slshape / scshape} \\ \text{size} & \texttt{tiny \ldots Huge} \end{array}
    % A base size the standard classes do not offer. Pick ONE of the four routes
    % below; the rest are commented out so the file still compiles.
    
    % Route 1 -- the extsizes bundle: 8, 9, 10, 11, 12, 14, 17, 20 pt, and it
    % ships extarticle/extreport/extbook with the same interfaces as the standard
    % classes.
    \documentclass[14pt,a4paper]{extarticle}
    
    % Route 2 -- KOMA-script's standalone shim, works with any class:
    % \documentclass[a4paper]{article}
    % \usepackage[fontsize=13pt]{scrextend}
    
    % Route 3 -- KOMA-script classes carry it natively:
    % \documentclass[fontsize=13.5pt,paper=a4]{scrartcl}
    
    % Route 4 -- XeLaTeX/LuaLaTeX: scale the loaded font instead of the ladder.
    % \documentclass[a4paper]{article}
    % \usepackage{fontspec}
    % \setmainfont{TeX Gyre Pagella}[Scale=1.05]
    
    \usepackage[T1]{fontenc}
    \usepackage{caption}
    
    \begin{document}
    
    % What the class actually resolved the rungs to -- look in the .log file.
    \makeatletter
    \typeout{base \@ptsize\space pt; normalsize on \f@baselineskip\space pt leading}
    \makeatother
    
    \section{Captions and tables take their size from the class, not from you}
    
    \begin{table}[ht]
      \centering
      \small                       % shrinks the tabular ...
      \captionsetup{font=normalsize}  % ... but not this caption
      \begin{tabular}{lrr}
        \hline
        Sample & $n$ & Mean \\
        \hline
        A      & 120 & 4.18 \\
        B      & 145 & 3.90 \\
        \hline
      \end{tabular}
      \caption{\texttt{\textbackslash small} applies to everything inside the
               environment, so the caption has to be opted out explicitly.}
    \end{table}
    
    {\Huge\bfseries A display line in the middle of the page\par}
    \noindent and the body text resumes at \normalsize immediately afterwards,
    because the braces ended the declaration's scope.
    
    \end{document}

    実務の依頼をほぼ覆う四つのレシピ

    表だけ小さく、キャプションは既定サイズに。\small の直後に置く \begin{table} はキャプションまで含めて縮みます。\caption が走る時点で宣言がまだ有効範囲内にいるからです。caption をロードして同じ塊に \captionsetup{font=normalsize} を足すか、サイズ変更を tabular だけを含むグループへ移してください。

    小さな活字の短い塊。グループ化と段落終端を代行してくれる環境に包みます、\begin{quote}\small … \end{quote}。\vspace とサイズの宣言と手動 \par の組合せでやると、有効範囲が漏れるか行送りが狂うかのどちらかです。環境なら字下げまでおまけで付いてきます。

    ページ中の一行だけ大きくしたい。{\Huge\bfseries …\par} のあと、次の段落を下げたくなければ \noindent。その行が実質見出しなら、行ではなく見出しのスタイルを組み直します。titlesec なら \titleformat{\section}{\LARGE\bfseries}{}{0em}{}、KOMA-script なら \addtokomafont{section}{\LARGE}。手で詰込んだ大きさはクラスを乗り換えると消え、目次の書式にも乗ってきません。

    脚注をもっと小さく、あるいは大きく。クラスはすべての脚注の内側で \footnotesize を適用します。同じ段はキャプションや表の注にも使われているので、\renewcommand{\footnotesize}{\scriptsize} は静かにキャプションまで縮めます。KOMA-script は \addtokomafont{footnote}{\scriptsize} で場合を隔離し、それ以外ならサイズ名ではなく内部の \@makefntext の塊を書き換えるべきです。

    \documentclass[10pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage{amsmath}
    
    \begin{document}
    
    \section*{The ten rungs, in one paragraph each}
    
    {\tiny tiny -- the smallest rung the class defines.\par}
    {\scriptsize scriptsize -- footnote-of-a-footnote territory.\par}
    {\footnotesize footnotesize -- what captions and \texttt{footnote} bodies use.\par}
    {\small small -- tables, and anything you want to fit without shrinking the page.\par}
    {\normalsize normalsize -- the base size, set by the class option, not by you.\par}
    {\large large -- subheadings in many classes.\par}
    {\Large Large -- capital L, one rung above \texttt{\textbackslash large}.\par}
    {\LARGE LARGE -- two capital Ls.\par}
    {\huge huge -- lower-case h.\par}
    {\Huge Huge -- the top rung, 24pt on a 10pt base.\par}
    
    \section*{Where a size change belongs}
    
    % Right: the paragraph break is inside the group, so the final line keeps
    % the leading that \large selected.
    {\large This sentence is long enough to wrap, and the \par inside the braces
    is what stops the last line from being spaced on the outer baselineskip.\par}
    
    % Wrong: the group closes first, so exactly one line comes out tight.
    {\large This sentence is long enough to wrap, and the paragraph break falls
    outside the braces, which is how the last line ends up with the wrong
    distance to the line above it.}\par
    
    % Right again: the quote environment groups the text and ends the paragraph
    % inside that group, so no \par of your own is needed.
    \begin{quote}
    \small
    A quote environment already scopes the declaration for you, and
    \verb|\end{quote}| closes the paragraph while still inside that scope.
    \end{quote}
    
    \end{document}

    このレッスンの早見表

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

    セクション キーコード
    \mathrm{d}x \quad \mathbf{A}\mathbf{b} \quad \mathit{u} \quad \mathtt{code} \quad \mathsf{H} \quad \boldsymbol{\Omega} \quad \mathbb{R} \quad \mathcal{O}
    \displaystyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6} \qquad \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \scriptscriptstyle \sum_{n=1}^{\infty} \frac{1}{n^{2}}
    \documentclass[14pt,a4paper]{extarticle}
    \documentclass[10pt,a4paper]{article}

    よくある間違い

    • {\large text} の閉じ括弧を段落終端より前に置くこと。最終行は外側の \baselineskip で組まれ、症状は揃っていない一行として現れるだけです。\par または空行は括弧の内側に書いてください。
    • グループなしで \large を打ち、文末まで走らせること。サイズのスイッチはすべて宣言で、有効範囲を取り囲むグループ、トップレベルならファイルの残りすべてです。
    • Computer Modern や Latin Modern で \textbf{\textit{…}} が太字斜体で出ると期待すること。どちらにも bx/it の形は無く、LaTeX は bx/n で代替し、証拠はログの Font shape … undefined 一行しか残りません。
    • サイズ変更を戻すのに \normalfont を使うこと。現在のサイズのままファミリ・シリーズ・シェイプを戻すだけなので、\normalsize が別途要ります。
    • \documentclass[14pt]{article} ——標準クラスに無いオプションです。ビルドは 10pt で成功し、ログに Unused global option(s) と出るだけ。extsizes、scrextend、KOMA クラスの fontsize=… を使ってください。
    • 旧式の \rm、\bf、\it を \rmfamily、\bfseries、\itshape の代わりに使うこと。廃止された形は固定サイズのフォントを選ぶので、\large\bf text は large の太字ではなく 10pt の太字になります。
    • times を読んで、本文は Times なのに数式だけが Computer Modern な理由を尋ねること。あれはテキスト側のファミリを変えるだけのパッケージです。newtxtext に newtxmath、あるいは mathptmx をどうぞ。

    この課に関する質問

    LaTeX で文字を大きくするには?
    グループで囲み、その先頭にサイズの宣言を置きます:{\large … \par}。ベースシステムに \textlarge{...} は無く、変更を止めているのは閉じ括弧なので、括弧を省くと以降すべて大きくなります。単語や句だけ大きくしたい場合も同じで、\Large は引数を取らず梯階の段を選ぶスイッチにすぎません。
    \large、\Large、\LARGE の違いは?
    同じ梯階の隣り合う三段です。10pt 基準ならそれぞれ 12、14、17pt で、行送りもそれぞれ別の値を持ってきます。名前の違いは大文字の位置だけですが、\Llarge や \HUGE は存在しないので、大文字小文字を誤ると黙って代替されるのではなく Undefined control sequence になります。
    太字斜体にならないのはなぜ?
    使っているフォントに太字斜体の面が無いためです。Computer Modern と Latin Modern は持たないため、\textbf{\textit{text}} は太字直立に代替され、ログに Font shape `T1/cmr/bx/it' undefined と記録されます。四つの面を揃えた本文書体(Times 系なら newtxtext、Palatino 系なら mathpazo)を選ぶか、XeLaTeX か LuaLaTeX で fontspec とシステムフォントを使ってください。
    文書の既定サイズを変えるには?
    クラスオプションを使います。\documentclass[12pt]{article} が受け付けるのは 10pt、11pt、12pt のみ。それ以外は extsizes へ乗り換える(extarticle は 20pt まで)、任意のクラスで \usepackage[fontsize=13pt]{scrextend} を足す、KOMA-script なら fontsize=13pt を指定します。\documentclass[14pt]{article} はログに Unused global option(s) を出すだけで何も変えません。
    \footnotesize はなぜ字だけでなく行送りも変えるのですか?
    サイズのスイッチはフォントを選ぶのと同時に \baselineskip と周辺のディスプレイ数のグルーも設定します。小さな塊の行間だけが過大になるのを防ぐためです。字だけ縮めて行送りは据え置きたいなら、それはサイズではなく行送りの問題で、\linespread{係数}\selectfont か setspace の領域です。
    一覧に無いサイズ、たとえば 13pt は使えますか?
    スイッチとして名付けようとしないでください。基準サイズそのものを動かして(extsizes、scrextend、KOMA の fontsize)十段のどれかを狙いの位置へ来させるか、fontspec で縮尺を指定します(\setmainfont{...}[Scale=1.08]、XeLaTeX か LuaLaTeX)。一時的に大きく見せたいだけなら、\Huge に見出しスタイルを組み合わせるほうが正直な解です。

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

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

    KaTeX エラー
    例を試す

    続けて読む

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