> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/shu-xue/08-spacing-in-math-mode.md).

# 数式モードでの空き

この記事では、数式モードでさまざまな幅の空白を挿入する方法を説明します。

## はじめに

(La)TeX の既定の数式モードの間隔を調整すると、特定の状況で役立つことがあります。例を見てみましょう:

```latex
\documentclass{article}
\usepackage{amssymb}
\begin{document}
次の集合があるとします
\[
S = \{ z \in \mathbb{C}\, |\, |z| < 1 \} \quad \textrm{and} \quad S_2=\partial{S}
\]
\end{document}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Math+mode+spacing+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamssymb%7D%0A%5Cbegin%7Bdocument%7D%0AAssume+we+have+the+next+sets%0A%5C%5B%0AS+%3D+%5C%7B+z+%5Cin+%5Cmathbb%7BC%7D%5C%2C+%7C%5C%2C+%7Cz%7C+%3C+1+%5C%7D+%5Cquad+%5Ctextrm%7Band%7D+%5Cquad+S_2%3D%5Cpartial%7BS%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![数式の間隔調整の例](/files/d4aa5804ef9c5430e1c124d7864978a8d87b5d40)

この例でわかるように、数式中のテキストは、いくつかの特別なコマンドを使って明示的に間隔を調整できます。

## 空白

以下の例には、さまざまなコマンドで挿入できる空白の完全な一覧が含まれており、組版された数式への影響を示します。

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
数式モードでの空白。

\begin{align*}
f(x) &= x^2\! +3x\! +2 \\
f(x) &= x^2+3x+2 \\
f(x) &= x^2\, +3x\, +2 \\
f(x) &= x^2\: +3x\: +2 \\
f(x) &= x^2\; +3x\; +2 \\
f(x) &= x^2\ +3x\ +2 \\
f(x) &= x^2\quad +3x\quad +2 \\
f(x) &= x^2\qquad +3x\qquad +2
\end{align*}
\end{document}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Math+mode+spacing+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0ASpaces+in+mathematical+mode.%0A%0A%5Cbegin%7Balign%2A%7D%0Af%28x%29+%26%3D+x%5E2%5C%21+%2B3x%5C%21+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%2B3x%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5C%2C+%2B3x%5C%2C+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5C%3A+%2B3x%5C%3A+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5C%3B+%2B3x%5C%3B+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5C+%2B3x%5C+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5Cquad+%2B3x%5Cquad+%2B2+%5C%5C%0Af%28x%29+%26%3D+x%5E2%5Cqquad+%2B3x%5Cqquad+%2B2%0A%5Cend%7Balign%2A%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![数式モードで間隔を調整するさらなる例](/files/fe1ae4c104fef8eaeb312a3fc3947da35cd83936)

を確認してください [リファレンスガイド](#reference-guide) コマンドの説明について。

**注**：〜の説明を見るには `align*` 環境については [amsmath を使った方程式の整列](/latex/ja/shu-xue/06-aligning-equations-with-amsmath.md)

## 演算子の間隔

数式モードにおける演算子や関係記号の前後の間隔は、特定のスキップ幅によって決まります:

* `\thinmuskip` （既定では 3 mu に相当）
* `\medmuskip` （既定では 4 mu に相当）
* `\thickmuskip` （既定では 5 mu に相当）

```latex
\begin{align*}
3ax+4by=5cz\\
3ax<4by+5cz
\end{align*}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Math+mode+operator+spacing+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Balign%2A%7D%0A3ax%2B4by%3D5cz%5C%5C%0A3ax%3C4by%2B5cz%0A%5Cend%7Balign%2A%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![LaTeX における演算子の間隔](/files/2d577b4a9bc0130045673677cfd8a2baddfd9fda)

たとえば、関係演算子では $$<$$, $$>$$ や $$=$$、LaTeX は設定します `\thickmuskip` 空白を設定します。しかし、たとえば二項演算子では $$+$$, $$-$$ や $$\times$$、 `\medmuskip` の空白が設定されます。その違いはほとんど気になりません。

## ユーザー定義の二項演算子と関係演算子

二項演算子や関係演算子で使われる間隔を強制指定できるので、 [独自の](/latex/ja/komando/01-commands.md).

```latex
\begin{align*}
34x^2a \mathbin{\#} 13bc \\
34x^2a \mathrel{\#} 13bc
\end{align*}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Defining+your+own+math+operators\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Balign%2A%7D%0A34x%5E2a+%5Cmathbin%7B%5C%23%7D+13bc+%5C%5C%0A34x%5E2a+%5Cmathrel%7B%5C%23%7D+13bc%0A%5Cend%7Balign%2A%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![独自の二項演算子または関係演算子の定義](/files/2abcdc373a4524c28edfa458625c0921f60c26ea)

前の例では、 `#` を用いて前後の特定の間隔を設定しています `\mathrel` （関係）および `\mathbin` （二項）コマンド。

## リファレンスガイド

**間隔コマンドの説明**

| LaTeXコード             | 説明                                                                             |
| -------------------- | ------------------------------------------------------------------------------ |
| `\quad`              | 現在のフォントサイズに等しい空白（= 18 [mu](/latex/ja/shu-shi-she-ding/01-lengths-in-latex.md)) |
| `\,`                 | の3/18 `\quad` （= 3 mu）                                                         |
| `\:`                 | の4/18 `\quad` （= 4 mu）                                                         |
| `\;`                 | の5/18 `\quad` （= 5 mu）                                                         |
| `\!`                 | の-3/18 `\quad` （= -3 mu）                                                       |
| `\` （バックスラッシュの後の空白！） | 通常の本文における空白に相当                                                                 |
| `\qquad`             | の2倍 `\quad` （= 36 mu）                                                          |

## さらに読む

詳細については

* [数式](/latex/ja/shu-xue/01-mathematical-expressions.md)
* [角括弧と丸括弧](/latex/ja/shu-xue/03-brackets-and-parentheses.md)
* [amsmath を使った方程式の整列](/latex/ja/shu-xue/06-aligning-equations-with-amsmath.md)
* [数式モードでの表示スタイル](/latex/ja/shu-xue/10-display-style-in-math-mode.md)
* [ギリシャ文字と数式記号の一覧](/latex/ja/shu-xue/11-list-of-greek-letters-and-math-symbols.md)
* [数学フォント](/latex/ja/shu-xue/12-mathematical-fonts.md)
* [LaTeX2εへのそれほど短くない入門](http://www.ctan.org/tex-archive/info/lshort/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ja/shu-xue/08-spacing-in-math-mode.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
