> 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/it/matematica/08-spacing-in-math-mode.md).

# Spaziatura in modalità matematica

Questo articolo spiega come inserire spazi di larghezza diversa in modalità matematica.

## Introduzione

Regolare la spaziatura predefinita della modalità matematica di (La)TeX può essere utile in alcune situazioni; vediamo un esempio:

```latex
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Supponiamo di avere i seguenti insiemi
\[
S = \{ z \in \mathbb{C}\, |\, |z| < 1 \} \quad \textrm{e} \quad S_2=\partial{S}
\]
\end{document}
```

[Apri questo esempio in 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)

Questo esempio produce il seguente output:

![Esempio che mostra le regolazioni della spaziatura matematica](/files/d718dfbce3261723704d6ab4bbf7ff1ca0516e21)

Come si vede in questo esempio, un testo matematico può essere spaziato esplicitamente tramite alcuni comandi speciali.

## Spazi

L'esempio seguente contiene un elenco completo di spazi inseriti con vari comandi e ne mostra l'effetto sulla formula impaginata.

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Spazi in modalità matematica.

\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}
```

[Apri questo esempio in 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)

Questo esempio produce il seguente output:

![Altri esempi di regolazione della spaziatura in modalità matematica](/files/ada5cc2a5710bb9b0e59b723ac3e3d4d28b0919c)

Controlla il [guida di riferimento](#reference-guide) per una descrizione dei comandi.

**Nota**: per vedere una descrizione del `align*` dell'ambiente vedi [Allineare le equazioni con amsmath](/latex/it/matematica/06-aligning-equations-with-amsmath.md)

## Spaziatura degli operatori

La spaziatura attorno agli operatori e alle relazioni in modalità matematica è regolata da specifiche larghezze di spazio:

* `\thinmuskip` (di default è pari a 3 mu)
* `\medmuskip` (di default è pari a 4 mu)
* `\thickmuskip` (di default è pari a 5 mu)

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

[Apri questo esempio in 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)

Questo esempio produce il seguente output:

![Spaziatura degli operatori in LaTeX](/files/cd4902a540f97382e5446199e8386ea019438a39)

Per gli operatori relazionali, come $$<$$, $$>$$ e $$=$$, LaTeX stabilisce `\thickmuskip` spazio. Ma per gli operatori binari come $$+$$, $$-$$ e $$\times$$, il `\medmuskip` lo spazio è impostato. La differenza è quasi impercettibile.

## Operatori binari e relazionali definiti dall'utente

Puoi forzare la spaziatura usata negli operatori binari o relazionali, così puoi [definire i tuoi](/latex/it/comandi/01-commands.md).

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

[Apri questo esempio in 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)

Questo esempio produce il seguente output:

![Definire i propri operatori binari o relazionali](/files/ea6c24307e9d14ca77851c43339692b419bd6278)

L'esempio precedente imposta una particolare spaziatura prima e dopo `#` usando `\mathrel` (relazionale) e `\mathbin` (binario) comandi.

## Guida di riferimento

**Descrizione dei comandi di spaziatura**

| Codice LaTeX                    | Descrizione                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `\quad`                         | spazio pari alla dimensione del carattere corrente (= 18 [mu](/latex/it/formattazione/01-lengths-in-latex.md)) |
| `\,`                            | 3/18 di `\quad` (= 3 mu)                                                                                       |
| `\:`                            | 4/18 di `\quad` (= 4 mu)                                                                                       |
| `\;`                            | 5/18 di `\quad` (= 5 mu)                                                                                       |
| `\!`                            | -3/18 di `\quad` (= -3 mu)                                                                                     |
| `\` (spazio dopo il backslash!) | equivalente dello spazio nel testo normale                                                                     |
| `\qquad`                        | il doppio di `\quad` (= 36 mu)                                                                                 |

## Approfondimenti

Per maggiori informazioni vedi

* [Espressioni matematiche](/latex/it/matematica/01-mathematical-expressions.md)
* [Parentesi quadre e tonde](/latex/it/matematica/03-brackets-and-parentheses.md)
* [Allineare le equazioni con amsmath](/latex/it/matematica/06-aligning-equations-with-amsmath.md)
* [Stile display in modalità matematica](/latex/it/matematica/10-display-style-in-math-mode.md)
* [Elenco delle lettere greche e dei simboli matematici](/latex/it/matematica/11-list-of-greek-letters-and-math-symbols.md)
* [Caratteri matematici](/latex/it/matematica/12-mathematical-fonts.md)
* [L'introduzione non proprio breve a 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/it/matematica/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.
