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

LaTeXの改行と空き:バックスラッシュ二つと空行の使い分け

バックスラッシュ二つは行を止め、空行は段落を止める。別の操作で結果も別に見えますが、初心者の文書の空き問題の大半は、後者を意図した箇所で前者を使ったものです。この課では二つを分離し、強制改行が正しい道具である四か所を数え、縦の空きを所有するレジスタに名前をつけ、偽の改行なしにはみ出し行を直す摘みまで示します。

    似たように見える二つの操作:行を止める、段落を止める

    ソース中の空行は \par です。段落を閉じるので、その後の縦のグルーは \parskip に基準線距離を足した分になり、次の行は新しい段落の第一行として扱われます——つまり \parindent だけ下がるということです。\\ は現在の行を止めるだけで、段落は続くため、その後の行は下がりもせず、\parskip も入らず、二つの行は同じ段落の他のどの二行とも同じく \baselineskip だけ離れます。

    差は三か所で見えますが、どこを見るか教えてくれる人がいません。\parindent が有効な文書では、空行の後の行は下がり、\\ の後の行は下がりません。parskip パッケージを使う文書では、強制改行の後の空きは段落間の空きより小さい——しかもずっと小さいことが多く、ビジネスレターで \\ が「効かない」のはこれです。そして \\ で終えた行は両端揃えになりません。TeX は行分割アルゴリズムに選ばせず明示的に止めるため、語は右端まで伸ばされず、その箇所でハイフネーションも検討されません。

    中身では \\ は引数付きの \newline です。カーネルはさらに改行をまたいでスペースファクタを保存・復元するので、文末のピリオドの直後に \\ があっても、段落が続くなら入るはずの文間の追加スペースは入りません——手作業の TeX 行分割が長年持てなかった小さな仕上げです。

    強制改行が正しいのはまさに四か所です。tabular や array の行の間、複数行の数式環境(aligned、gathered、cases、matrix)の各行、center/flushleft/flushright ブロックと、そのための住所風の高まり、そして詩——行と段落が一致するとは限らない場所です。普通の文章の中なら、どこにあっても道具ではなく症状です。

    \begin{array}{lll}\text{source} & \text{what it does} & \text{visible effect} \\\hline \texttt{double backslash} & \text{ends the line} & \text{no indent, no parskip} \\ \texttt{blank line} & \text{ends the paragraph} & \text{indent plus a gap} \\ \texttt{\textbackslash linebreak} & \text{asks for a break} & \text{line stays justified}\end{array}
    \begin{array}{lll}\text{source} & \text{what it does} & \text{visible effect} \\\hline \texttt{double backslash} & \text{ends the line} & \text{no indent, no parskip} \\ \texttt{blank line} & \text{ends the paragraph} & \text{indent plus a gap} \\ \texttt{\textbackslash linebreak} & \text{asks for a break} & \text{line stays justified}\end{array}
    Four visible differences between a forced line break and a paragraph break in LaTeX SOURCE ON THE LEFT, WHAT THE PAGE LOOKS LIKE ON THE RIGHT SAME PARAGRAPH: \ (A DOUBLE BACKSLASH) … the line ends here\\ and the next one starts without any new paragraph. not justified no indent on either following line; no \parskip glue anywhere; the page may still break between them NEW PARAGRAPH: A BLANK LINE ( = \par ) … the paragraph ends here % blank line and this one starts afresh. \parskip + one \baselineskip of glue \parindent on the first line only TeX is free to hyphenate to fill both lines DECIDING WHICH ONE YOU MEANT prose, continuing the argument prose, new idea rows of a tabular / array rows of aligned, cases, matrix an address block inside center blank line, never the backslash pair blank line double backslash is the only option double backslash, inside one maths object with one number double backslash — the block is not a paragraph of prose blank line blank line double backslash double backslash double backslash The right-hand column is a paragraph decision: it changes indent, glue and justification. The lower three are structural: the environment needs the break to mark where a row ends.
    強制改行は行を止めるだけ、段落改行は段落を止めて次の行を字下げとパースキップの規則へ渡します。

    省略可能引数、アスタリスク、そして強制改行の代価

    \\[12pt] は止める行と次の行の間に縦の空きを足し、\\* はその位置での改ページを禁じます。住所ブロックや詩の連が途中で割れないのはこの働きです。この二つの指定があるがゆえに、どちらも取らない \\ ではなく \newline を打ちます。

    空きを指定する引数には、悪い瞬間に効いてくる弱点が文書化されています。挿入されるグルーは改行に付属するので、TeX がどうしてもそこでページを割ると判断すれば、空きはページと一緒に消えます。ページの先頭にある縦のグルーすべてに同じことが言え、だからこそアスタリスク形があります——\vspace*{20pt} は \vspace{20pt} が捨てられる場所でも生き残ります。行の空きが本当に荷重を担うなら(署名欄、引き離した連)、頑丈な道具は needspace パッケージの \needspace{5\baselineskip} で、その塊ごと次のページへ押し出してくれます。

    \linebreak[n] と \nolinebreak[n] は遠慮版です。0 から 4 の数値がその分割機会に罰則を乗せ、カーネルの低・中・高は 51、151、301、4 は依頼ではなく命令です。TeX は最適化を続けるので、\linebreak[3] の行も右端まで揃えられ、段落の別の箇所のハイフネーションが勝つことがあります。\pagebreak[n] と \nopagebreak[n] は同じことをページ単位でやり、リスト項目の最終行の直後に書く \nopagebreak が、その項目を半分に割られないようにする最も安い方法です。

    構文上避けられる失敗が二つ。\\ を \end{tabular} の直前最後の要素にすると空行が増え、省略引数を付けると空きだけの行になります。そして \\ をディスプレイ数式の直前に置くと、クラス自身のディスプレイ用のグルーと争います。\[ はそれ自体で新しい行を始めているので、強制改行は揃わない行と想定外の空きしか追加しません。

    \begin{aligned} f(x) & = x^{2} + 2x && \text{row one} \\ & = (x+1)^{2} - 1 && \text{row two} \end{aligned}
    \begin{aligned} f(x) & = x^{2} + 2x && \text{row one} \\ & = (x+1)^{2} - 1 && \text{row two} \end{aligned}
    aligned の中でのバックスラッシュ二つは段落開始の近道ではなく、一つの数式対象の行を区切る記号です。環境全体は番号を一つしか持たない単一の数式のまま。

    TeX は打った空白をどう読むか

    ソースの一行の中では、空白・タブ・単独行区切りの連なりは語間のグルー一つに縮みます。つまり word + 改行 + word は word word と同一で、出力は 1 ポイントも動きません。専門的なソースが文ごとに改行をを入れられるのはこのためです。空行だけが例外で、あれは空白ではなく \par だからです。

    行末の % は、空きを足すのではなく消すための道具です。その行の残りを全部コメントに変え、行区切りそのものも含めるので、次のソース行はグルーなしで続きます。コマンドで終わる tabular のセル、\item のラベルの後、余分な空白が目に見える隙間になる場所、段落変更が致命的な \parbox の途中——どこでも必要になります。

    TeX が飲み込むはずの空きを入れるなら、制御スペース \ を打ちます。コマンド名は後続の空白を定義上食べてしまうので、その直後、「50cc」ではなく「50 cc」にしたい箇所などです。チルダ ~ は逆の道具で、行分割が決して使えない空き、item~\ref{itm:psu}、Figure~3、2.4~GHz で正しく効くものです。明示的なスキップは次、\hspace{1em}(plus と minus を書かない限り剛)、\hfill(無限の伸び、材料を左右へ押し分けるのに使う)、\kern(剛で、\hskip と違い行が切れる位置ではない)、そして名前の付いた幅 \enspace、\quad、\qquad。em は現在のフォントサイズそのものなので、これらはすべて前の課のサイズ梯階に比例して動きます。

    数式の空きはより細い単位を持つ別の体系です。\,、\:、\; が mu 基準の三つの隙間、\! は一つ引き消し、\mathsf{abc} と abc の差は TeX が演算子と関係記号の回りに自動で入れる属性間のグルーです。数式の中で \hspace に手を伸ばさないでください。\mathop、\mathbin および空き分類があるのは、数式が下付きへ縮められたときにも空きが保たれるように、という仕組みです。

    How whitespace in a LaTeX source file maps onto the page: newline, blank line, percent sign and runs of spaces THE SOURCE FILE, WITH EVERY WHITESPACE DECISION MARKED 1 words on one line, then a 2 newline in the file. 3 (an empty line here) 4 A second paragraph. 5 It ends with a percent: and 6 this line is glued on tight. 7 Many spaces in a row 8 are one space to TeX. one newline = one space a blank line = \par a % hides the rest of the line, including its break runs of spaces collapse THE RESULT ON THE PAGE \parskip + \baselineskip of glue, then an indent lines 5 and 6 became one line of text: line 7 is set as it would be with single spaces — TeX never sees the rest THE THREE THAT ARE WORTH MEMORISING newline one space so break a paragraph anywhere you like blank line \par indent + paragraph glue, so never two in a row percent at the end nothing the space is gone; this is how you join lines One newline is a space and ten are also one space; only the empty line changes the paragraph, and % changes it back.
    ソースの空白と出力の対応:単独行区切りは空き、空行は段落、パーセント記号は行に穴。

    縦の空き:指ではなくレジスタで決める

    LaTeX のページのあらゆる隙間は名前付きレジスタが所有していて、所有者を知っておくことが一行ずつではなく全体を直す方法です。段落の行と行の間は \baselineskip、背の高い材料が続くと \lineskip が取って代わります。段落と段落の間は \parskip。リストの上下が \topsep と \partopsep、内側が \itemsep と \parsep。本文とディスプレイ数式の間が \abovedisplayskip と \belowdisplayskip、直前の行が短ければその短い版。フロートの回りが \floatsep、\textfloatsep、\intextsep。キャプションの下が \abovecaptionskip。

    既成の三つの大きさ——\smallskip、\medskip、\bigskip(および縦モード対応の \…skip)——は固定長ではなく、伸び縮みを持つクラス定義のグルーです。だから改ページの位置でも振る舞いが破綻しない。剛な \vspace{1cm} はそこで失敗します。\vfill は残りのページを全部埋めるので、表題ブロックや署名欄が本当に欲しがっているのはこちらです。

    行の途中で打った \vspace はその行の残りを下へ押しません。縦のグルーに行間以外の意味が無いので、空きは次に到達する行分割で入るか、捨てられます。その前に \par(または空行)を書くか、\\[space] を使ってください。ページの先頭では素の \vspace は丸ごと捨てられ、サイズを保つのは \vspace* だけです。

    正当な構造的な用途は三つです。\enlargethispage{\baselineskip}(アスタリスク付きも含む)で悪い一ページに一行を掠め取る、\needspace{n\baselineskip} で塊をまとめる、上のレジスタのどれかをクラス水準で変える。それ以外——\\ \\ の組、空の ~\par、サブセクション毎の \vspace——は全部、全体問題への場当たりであり、本文が流れ直した瞬間に再発します。

    \begin{array}{ll}\text{line to line} & \texttt{baselineskip} \\ \text{paragraph to paragraph} & \texttt{parskip} \\ \text{list above and below} & \texttt{topsep} \\ \text{text to equation} & \texttt{abovedisplayskip}\end{array}
    \begin{array}{ll}\text{line to line} & \texttt{baselineskip} \\ \text{paragraph to paragraph} & \texttt{parskip} \\ \text{list above and below} & \texttt{topsep} \\ \text{text to equation} & \texttt{abovedisplayskip}\end{array}
    Horizontal and vertical space commands in LaTeX compared: what each one is, whether it stretches, and which mode it is legal in HORIZONTAL SPACE — INSIDE A LINE COMMAND WHAT IT ADDS STRETCHES? CAN A LINE BREAK THERE? a space or one newline one inter-word glue yes yes backslash + space a space TeX cannot swallow yes yes ~ (the tie) a space that must stay yes no — that is the point \hspace{1em} rigid unless you write plus= only if you add it yes \hfill infinite stretch always yes \kern 6pt rigid shift, TeX primitive no no — use \hskip for that \quad \qquad \enspace 1 em, 2 em, half an em a little yes VERTICAL SPACE — BETWEEN LINES AND PAGES COMMAND / REGISTER WHAT IT SEPARATES SURVIVES A PAGE BREAK? MODE IT NEEDS \baselineskip two lines of one paragraph it is the page grid automatic \parskip two paragraphs yes, it is glue automatic at \par \vspace{12pt} anything you ask it to no — discarded at the top vertical mode \vspace*{12pt} the same, forced yes vertical mode \[12pt] after a break the next line, in one line pair no — it rides on the break horizontal
    左に水平の道具、右に縦の道具、それぞれが使えるモード付き。

    はみ出しと引き伸ばし、それを直す摘み

    TeX は費用関数を最小化して行を分割します。badness はグルーがどれだけ伸び縮みしたかを測り、demerits は悪い並びを罰し、ハイフネーションにも固有の値段があります。ログの Overfull \hbox は、見つかった最安の解でも段幅を \hfuzz より越えていたという意味、つまりその行は余白へ食い込みます。Underfull \hbox は引き伸ばして埋めた行で、すかしっく見えます。どちらもコンパイラではなくあなたの本文についての通知です。

    直す順番は次の通り。文を書き換える、TeX に許された箇所でハイフネーションさせる(\hyphenpenalty と \exhyphenpenalty が値段を動かし、\doublehyphendemerits と \finalhyphendemerits は連続ハイフンと最終行のハイフンを止めます)、最適化の最後に逃路を渡す——\setlength{\emergencystretch}{1em} は通常の伸びが失敗した後でだけ効くので、文書全体を緩めはしません、はみ出す材料こちら側で広げるか割る、その最後の最後に \sloppy か sloppypar 環境で、\tolerance たちを緩めて警告のために醜い行を作ることも厭わなくなります。

    割れない長い語は別の問題で、直しも別です。URL、ファイルパス、キャメルケースの識別子はハイフネーションできません。\url{...} や \path{...}(hyperref か url のどちらか)は妥当な文字で割ってくれ(xurl はどこでも割る)、\allowbreak や任意の区切り \- は頑固な一語に効きます。TeX が選んだ区切りを見るにはログへ尋ねます、\showhyphens{supernumerary} が印字し、\hyphenation{pe-diat-ric} は個別の語を \- で修正するより、文書全体の例外として追加します。

    これらの摘み全部より多くの症状を直すパッケージが一つあります。\usepackage{microtype} はプロトルージョン(丸文字と句読点を余白の外へはみ出させるので、行の余裕が増える)を加え、pdfLaTeX か LuaLaTeX ではフォントの伸縮(99.5% 幅のグリフ集合)も加えます。最後に読んでページを見て、それでも特定の行を書き換える価値があるかを判断してください。

    \documentclass[10pt]{article}
    \usepackage[T1]{fontenc}
    \usepackage{array}
    \usepackage{amsmath}
    
    \begin{document}
    
    % ---- the three legitimate uses of an explicit line break ----
    \begin{tabular}{@{}ll@{}}
      Row one, cell one & Row one, cell two \\
      Row two           & still the same environment \\[4pt]
      A gap paid for by the row, not by an empty row
    \end{tabular}
    
    \begin{equation}
      \begin{aligned}
        (a+b)^{2} &= a^{2} + 2ab + b^{2} \\
                  &= (a-b)^{2} + 4ab
      \end{aligned}
    \end{equation}
    
    % ---- hyphenation you control instead of space you fake ----
    The word supernumerary is long, and a discretionary hyphen can be placed by
    hand: super\-nu\-mer\-ary. To see what TeX would have chosen anyway, ask it
    in the log with \verb|\showhyphens{supernumerary}|.
    
    % ---- two spaces in the source are exactly one space on the page ----
    Two   spaces      and          a   newline
    all collapse into one inter-word glue, and a blank line here ends the
    paragraph.
    
    % ---- the comment character eats the line break, so it eats the space ----
    This line ends with a percent sign and therefore joins the next one with
    no space at all:%
    this word follows immediately.
    
    \end{document}

    段落の形は一度だけ決める選択

    段落の分け方は二通りしかなく、すべての文書がどちらかを選びます。第一行を下げて段落自体に空きを足さない(\parindent 有効、\parskip ゼロ——標準クラスの既定)か、下げずに段落間へ実質的な空きを入れる(その逆)か。混ぜると「何も揃わない」最初の LaTeX 文書らしい見た目になります。クラスの見出しもリストもキャプションも、同梱されている方の値で調整されているからです。

    後者の形なら、長さを手で設定せず parskip パッケージをロードしてください。\parskip に伸び成分を与え、\parindent をゼロにし、項目間の空きが二重にならないようリストのパラメータを作り直します。KOMA-script クラスは同じ選択をオプションにしています——parskip=full、parskip=half、parskip=parindent——で、組版的に丁寧なのは half です。行ぶん丸々ではなく基準線距離の半分を使うため、両端揃えの本文がダイヤのような空きになりません。

    クラスは見出しの後の第一段落の下げも自分の \@afterheading の仕組みで消します。\noindent の直下に \section を書いても効かないように見える理由であり、すべての段落を下げたい文書が indentfirst を読む理由です。\indent を行頭に置くのは、クラスが下げなかった一語ぶんを強制的に戻す方法です。

    一度決める習慣から、二つの禁止が導けます。\hspace{1cm} や打ち込んだ空白の連なりで段落を始めないこと——字下げはクラスが所有する長さです。そして余分の \parskip ぶん空行を足して段落間の空きを大きくも見せないこと——その隙間が構造的なら見出しかリスト、組版的ならレジスタに入れるべきものです。

    \documentclass[12pt]{article}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage{parskip}       % blank-line paragraphs: no indent, real gap
    \usepackage{enumitem}
    \usepackage{needspace}
    
    \setlength{\emergencystretch}{2em}  % last-resort stretching, not first resort
    \hyphenpenalty=150                % make hyphenation a bit more attractive
    \tolerance=1500                   % before emergency stretch is tried
    
    \begin{document}
    
    \section{Space that is not yours to add}
    
    % Wrong, and silent: vertical glue placed in the middle of a line.
    This paragraph tries \vspace{20pt} to push its own second half down the page
    and achieves nothing, because the glue is only obeyed between lines.
    
    \medskip
    \needspace{6\baselineskip}
    A short block that must not be split by a page break: \verb|needspace| asks
    for six lines of room right here and starts a new page if they are not
    available. It is the honest version of the six backslash-backslash pairs
    people type instead.
    
    \section*{And space that the class already owns}
    
    \begin{itemize}[noitemsep,topsep=6pt]
      \item \texttt{parskip} turned the vertical gap between paragraphs on and
            took the indentation off; that is one decision, made once.
      \item It also re-tuned the list parameters, which is why these two items
            sit closer together than the two paragraphs above.
    \end{itemize}
    
    \end{document}

    ページを読み返す:空きがおかしいとき見る順

    外から内へ調べます。まず、文書全体がおかしいのか一行だけなのか。全体のおかしいはレジスタの問題、\parskip、\baselineskip(つまり \linespread{factor}\selectfont か \setstretch)、リストのパラメータ、ディスプレイ用のグルー——いずれも導言部かパッケージで設定し、手では打ちません。一行だけのおかしいは内容の問題、長い語、ハイフネーション地点の欠落、URL、\linebreak では割れず \\ を要する数式のかたまり。

    第二に、ログの Overfull と Underfull を出た順に読みます。手前の強制改行がそのページ下方すべての行分割を変えてしまうからです。ログは問題の材料を | の間に印字するので探せ、最速の診断は draft クラスオプションでの一度のビルドです。はみ出した行全部に黒い帯が走り、画像は仮の箱に替わるので、ページそのものが問題の場所を指します。

    第三に、標準クラスの縦モードの既定を思い出してください。article はページを拉げて終えますが、report と book は短いページの本文を引き伸ばし、最終の基準線がどのページでも同じ高さへ着地します。章の最終ページが不自然に空気を含んでいるなら \flushbottom の仕業で、切り替えは \raggedbottom——空きバグではなく版面の決定であり、次の課の主題です。

    このページの三つのリストは道具一式をソースにしたものです。一つ目は段落改行と強制改行を行ごとに比べ、二つ目はパッケージに任せた段落スタイルを needspace と緊急ストレッチと共に示し、三つ目は正当な用途の短い目録——表の行、揃えた導出、手で置いた区切り、縮んだ空白の連なり、改行を消すパーセント記号。

    a\,b \quad a\:b \quad a\;b \quad a\quad b \quad a\qquad b \quad a\!b
    a\,b \quad a\:b \quad a\;b \quad a\quad b \quad a\qquad b \quad a\!b
    \documentclass[11pt]{article}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage{amsmath}
    \usepackage{microtype}
    
    \begin{document}
    
    % ---- 1. Two paragraphs: what a blank line buys you -----------------
    This is the first paragraph. It continues across source lines because a
    single newline in the file is just another space to TeX.
    
    And this is the second: the blank line above became \par, so this line is
    indented by \parindent and separated from the paragraph above by \parskip.
    
    % ---- 2. Forced breaks: same paragraph, two lines -------------------
    \begin{center}
      A. Student\\
      Room 214, Faculty of Mathematics\\[6pt]
      a.tudent@example.edu
    \end{center}
    
    % ---- 3. Where \\ is a bug ------------------------------------------
    Never write a double backslash to split a paragraph like this, because
    the line ends ragged, no indentation or paragraph glue appears, and the
    sentence after the break is still the same paragraph.
    
    % ---- 4. A \\ next to display maths is never needed -----------------
    The wave equation is written as
    \[
      \frac{\partial^{2} u}{\partial t^{2}} = c^{2}\nabla^{2} u
    \]
    and the display already starts and ends on its own line, so putting a
    forced break before the \verb|\[| only fights the class's display skips.
    
    % ---- 5. Asking instead of forcing ----------------------------------
    This sentence is long enough that TeX would happily hyphenate something in
    it, but here \linebreak I ask for a break at this exact place and the line is
    still stretched to the right margin, which is what a forced break would have
    cost me.
    
    \end{document}

    このレッスンの早見表

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

    セクション キーコード
    \begin{array}{lll}\text{source} & \text{what it does} & \text{visible effect} \\\hline \texttt{double backslash} & \text{ends the line} & \text{no indent, no parskip} \\ \texttt{blank line} & \text{ends the paragraph} & \text{indent plus a gap} \\ \texttt{\textbackslash linebreak} & \text{asks for a break} & \text{line stays justified}\end{array}
    \begin{aligned} f(x) & = x^{2} + 2x && \text{row one} \\ & = (x+1)^{2} - 1 && \text{row two} \end{aligned}
    \begin{array}{ll}\text{line to line} & \texttt{baselineskip} \\ \text{paragraph to paragraph} & \texttt{parskip} \\ \text{list above and below} & \texttt{topsep} \\ \text{text to equation} & \texttt{abovedisplayskip}\end{array}
    \documentclass[10pt]{article}
    \documentclass[12pt]{article}
    \documentclass[11pt]{article}

    よくある間違い

    • 段落を \\ で分けること。字下げも段落のグルーも無く、揃わない行が残るだけです。段落の区切りは空行か \par です。
    • \\[20pt] で数式や表を下へ押すこと。空きは改行に付くので、そこでページが割れると黙って消えます——実際の問題は大抵、\needspace を欲しがる塊かフロートです。
    • \\ を tabular の最終行にすること。空行が増え、省略引数を付ければ空きだけの行になります。
    • % が改行も消すことを忘れること。セルや \parbox の中で行末に打ったパーセントは多くの場合修正ですが、行の途中で打てば残りのコードを全部コメントにします。
    • 行の途中で \vspace を足そうとすること。縦のグルーは行間以外に意味が無いので、先に段落を閉じる(\par)か \\[space] を使ってください。
    • \sloppy をはみ出しへの全土対策にすること。警告は任意に伸びる行で消えるだけで、\setlength{\emergencystretch}{1em} は同じ問題を他の段落に触らず扱います。
    • \linebreak と \\ を同義語として使うこと。前者は行を両端揃えに保ち他の箇所でハイフネーションも許す罰則、後者は拉げた行で終えるコマンドです。

    この課に関する質問

    空行とバックスラッシュ二つの違いは?
    空行は \par です。段落を閉じるので次の行に字下げが入り、\parskip が入れる空きも付きます。\ は現在の行だけを終え、段落は続く——下げも段落のグルーも無く、止まった行は両端揃えになりません。\ は表、揃えた数式、center ブロック、詩の中で、空行は本文の段落間に使います。
    新しい段落を作らずに改行するには?
    行を止めたい位置に \ を打てばいい。空きやアスタリスクの指定が要らないなら \newline でも構いません。両端揃えの本文で自然に見せたいなら \linebreak[4] のほうがマシで、TeX にそこでの分割を要求しつつ行は右端まで伸びます。
    段落間の空きを増やすには?
    段落ごとに足さないでください。スタイルを一度決める(parskip パッケージ、KOMA-script クラスなら parskip=half)か、クラス既定を受け入れて、目に見える区切りが本当に要る箇所で挿し見出しやリストを使う。二つの段落の間に打った \vspace は、本文が流れ直して別ページで変になるまで動きます。
    TeX は打った空白をなぜ無視するのですか?
    ソース中の空白・タブ・単独行区切りの連なりは語間スペース一つに縮み、コマンド名は直後の空白を食べるからです。空きを一つ強制するなら \ (制御スペース)、二語を同じ行に保つなら ~ で繋ぎ、改行が残す空きを消すなら行末に % を置きます。
    Overfull hbox 警告の直し方は?
    順に、文を書き換える、ハイフネーションを許す(\hyphenpenalty、または入れたい箇所で任意の \-)、TeX に最後の逃げとして \setlength{\emergencystretch}{1em} をやる、長い材料を手で割る、その最後に \sloppy か sloppypar 環境。URL とファイル名は hyperref の \url{} が直しで、グルーを足すのではありません。
    見しの後に空きが無い/ページが引き伸ばされるのは?
    別の二つの既定です。標準クラスは \parskip ぶんの空きを見出しの回には入れません——見出しは自分の上と下のグルーを持っており、バグではなく版面の決定です。行間が異常に広いページは、report か book が \flushbottom で章の最終ページを全高へ引き伸ばしている状態、\raggedbottom で切れなくなります。

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

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

    KaTeX エラー
    例を試す

    続けて読む

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