단계 2 · 텍스트와 문서 구조 11 / 48 ≈ 18 분 분량

LaTeX 글자크기 10단계와 글자체: 볼드·이탤릭

LaTeX에서 글자 크기는 클래스 파일이 정의한 사다리의 이름 붙은 열 단계이고, 글자체 변경은 패밀리·시리즈·셰이프라는 서로 다른 세 속성입니다. 이 강의는 각 단계 뒤에 숨은 정확한 숫자, 변경이 어디까지 미치는지 결정하는 선언과 명령의 구분, Computer Modern에서 볼드 이탤릭이 소리 없이 볼드 직립이 되는 이유, 그리고 수식을 망가뜨리지 않고 인상을 바꾸려면 어떤 폰트 패키지를 올려야 하는지를 다룹니다.

    열 개의 크기 스위치, 그리고 스위치가 실제로 정하는 것

    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 뒤에 놓았을 때보다 더 바싹 붙습니다. 이 목록에 “글리프 크기만 바꾼다”는 항목은 하나도 없으며, 매뉴얼이 이를 폰트 명령이 아니라 크기 변경 명령이라 부르는 이유가 여기 있습니다.

    내 문서가 실제로 해석한 숫자를 확인하려면 화면이 아니라 로그에 쓰십시오. 조사하려는 그룹 안에서 \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}는 \end{quote}가 환경 범위 안에 남아 있는 상태에서 단락을 끝내므로 따로 \par를 쓰지 않아도 안전합니다. \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(m) 대 \bfseries(bx, bold extended) — 그리고 기울기는 셰이프: \upshape(n), \itshape(it), \slshape(sl, 슬랜트 — 직립 디자인을 기울인 것), \scshape(sc, 스몰캡스). 각각 선언형과 인자를 받는 명령형이 있습니다: \bfseries/\textbf, \itshape/\textit, \slshape/\textsl, \scshape/\textsc, \upshape/\textup, \mdseries/\textmd. 본문 글자 안에서는 \text… 형태를 권장합니다. 소스에서 중괄호 범위가 눈에 보이니 범위가 새 나갈 일이 없습니다.

    폰트를 저 다섯 속성의 이름으로 요청하기 때문에, LaTeX는 존재하는 것만 줄 수 있습니다. \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 패키지의 \bm{\pi}를 써야 합니다. 후자는 연산자와 구분자까지 굵게 만듭니다. \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 대신 8비트 서유럽 폰트 인코딩을 요구하고, \usepackage{lmodern}이 뒤이어 글리프가 더 많고 힌팅이 좋은 Computer Modern의 벡터 재판본인 Latin Modern을 올립니다. OT1에서는 \'e 같은 악센트 문자를 인쇄 시점에 별도의 악센트와 e를 합쳐서 만들기 때문에, 하이픈 규칙이 그 단어 안에서 줄을 나눌 수 없고, PDF에서 글을 골라 옮기는 독자는 “é” 대신 “´e”를 얻으며, 악센트가 붙은 \textsc는 아예 존재하지 않을 수 있습니다. T1에는 미리 합쳐진 슬롯이 있어 이런 문제가 사라집니다 — 대가로 폰트 셰이프 이름이 달라지고(OT1/cmr/m/n 대신 T1/cmr/m/n) 일부 구두점 주변 여백이 조금 느슨해집니다.

    \rmdefault를 손으로 재정의하는 대신 패키지를 올려 본문 폰트 자체를 바꾸십시오. Times 느낌이라면 newtxtext를 newtxmath와 함께 씁니다. mathptmx는 더 오래된 동등품이고 times는 폐기된 것입니다 — 텍스트 패밀리만 바꾸므로 수식은 Computer Modern으로 남아 두 인상이 티 나게 부딪힙니다. Palatino는 newpxtext와 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}를 선언하면 되고, 이 선언은 클래스가 \begin{document}에서 \normalfont를 선택할 때 적용됩니다.

    XeLaTeX나 LuaLaTeX에서는 8비트 계층 전체가 사라지고 그 자리를 fontspec이 대체합니다. \setmainfont, \setsansfont, \setmonofont는 시스템 폰트 이름을 받고, 어떤 유니코드 문자든 직접 타이핑할 수 있으며, \setmainfont{...}[BoldFont=..., SmallCapsFont=...]로 개별 면에 접근할 수 있습니다. 수학은 그때 unicode-math를 요구합니다. 두 세계를 섞지는 마십시오. pdfTeX 템플릿에서 XeLaTeX 템플릿으로 옮겨가는 길에 fontspec을 fontenc, inputenc과 함께 올리는 것이 흔한 충돌 지점입니다.

    \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이 대신 골라 줍니다. 디스플레이 수식은 디스플레이 스타일, 인라인 수식은 텍스트 스타일, 아래 첨자는 한 단계 내려가고 아래 첨자의 아래 첨자는 scriptscript까지 내려갑니다. 눈에 보이는 차이가 크기만은 아닙니다. 디스플레이 스타일은 \sum과 \int의 극한을 연산자 위와 아래에 두고, 텍스트 스타일은 그것들을 옆으로 옮기고, 분수는 같은 규칙으로 자기 내용을 축소합니다.

    상대 단계는 대략 현재 크기의 0.7과 0.5이고, 여기서 “현재”는 수식을 둘러싼 본문 크기를 말합니다. 그래서 단락을 {\small …}로 감싸면 인라인 분수도 함께 작아지고, \small 구절 안에서 \displaystyle을 강제하면 이웃보다 위로 튀어나온 줄이 생깁니다 — 크기는 덮어썼지만 주변 단락의 줄간격은 그대로이기 때문입니다.

    스타일을 강제하는 방법은 둘입니다: 분수는 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를 출력하고, {\normalsize … } 안에서 \typeout{leading \f@baselineskip}을 쓰면 클래스가 고른 단락 거리가 출력됩니다.

    이것들에 손대기 전에 진짜 불만이 크기인지 여백인지 먼저 물어보십시오. 답답해 보이는 페이지는 대개 포인트가 부족한 것이 아니라 줄간격이 부족한 것입니다. 프리앰블에서 \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}

    실제 요청 대부분을 덮는 네 가지 레시피

    표 글씨는 작게, 캡션은 보통 크기로. \begin{table} 바로 뒤에 둔 \small은 캡션까지 블록 전체를 축소합니다. \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=…를 쓰세요.
    • \rmfamily, \bfseries, \itshape 대신 구식 선언 \rm, \bf, \it를 쓰는 것. 폐기된 형태는 고정 크기로 폰트를 고르기 때문에 \large\bf text는 큰 글씨 볼드가 아니라 10pt 볼드를 만들어 냅니다.
    • times를 올려 놓고 본문은 Times 같은데 수식은 왜 여전히 Computer Modern인지 의아해하는 것. 그 패키지는 텍스트 패밀리만 바꿉니다. newtxtext를 newtxmath와 함께 쓰거나 mathptmx를 쓰세요.

    이 강의에 대한 질문

    LaTeX에서 글자를 더 크게 하려면?
    본문을 그룹으로 감싸고 그 시작에 크기 선언을 두세요: {\large ... \par}. 기본 시스템에는 \textlarge{...} 명령이 없고, 변경을 멈추는 것은 닫는 중괄호라서 그것을 빼면 이후 모든 것이 커집니다. 단어 하나나 구절 하나를 위해서라면 크기가 아니라 폰트를 확대하는 방법을 생각하세요. \Large는 단계일 뿐 인자를 받는 명령이 아닙니다.
    \large, \Large, \LARGE의 차이는?
    같은 사다리의 연속 세 단계입니다. 10pt 기본에서 각자 줄간격까지 따로 갖춘 12pt, 14pt, 17pt이고, 이름의 차이는 대문자 표기뿐입니다. \Llarge나 \HUGE는 없으므로 대소문자를 틀리면 조용한 대체가 아니라 "Undefined control sequence"를 받습니다.
    LaTeX에서 볼드 이탤릭이 왜 안 되나요?
    사용 중인 폰트에 볼드 이탤릭 면이 없어서입니다. Computer Modern과 Latin Modern에는 없으므로 \textbf{\textit{text}}는 볼드 직립으로 대체되고 로그에 Font shape `T1/cmr/bx/it undefined가 남습니다. 네 면을 모두 갖춘 텍스트 패밀리를 로드하거나(Times와 Palatino 느낌으로 newtxtext, mathpazo), XeLaTeX나 LuaLaTeX의 fontspec로 시스템 폰트를 쓰세요.
    문서의 기본 글자크기는 어떻게 바꾸나요?
    클래스 옵션을 쓰세요. \documentclass[12pt]{article}은 10pt, 11pt, 12pt만 받습니다. 그 외에는 extsizes로 옮겨 20pt까지 지원하는 extarticle을 쓰거나, 어떤 클래스에든 \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) 열 단계 가운데 하나가 원하는 자리에 오게 하거나, 폰트를 확대하세요: XeLaTeX·LuaLaTeX에서 \usepackage{fontspec}와 \setmainfont{...}[Scale=1.08]. 한 번뿐인 큰 재료라면 \Huge에 클래스가 정의한 제목 스타일이 보통 정직한 답입니다.

    실시간 놀이터: LaTeX를 편집하고 바로 렌더링

    입력하면 미리보기가 즉시 갱신됩니다. 일부러 깨뜨려서 오류가 어떻게 보이는지도 확인해 보세요.

    KaTeX 오류
    예제 사용해 보기

    이어서 읽기

    같은 주제로 들어가는 세 갈래: 표기 자체, 그것을 가르치는 강의, 그리고 실제로 쓰는 글.