> 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/uk/matematika/10-display-style-in-math-mode.md).

# Стиль відображення в математичному режимі

## Вступ

Ця стаття пояснює, як вручну налаштувати стиль набраної математичної формули — але спершу нагадаємо про видимі відмінності між вбудованою та дисплейною математикою.

Набрана математика, розміщена вбудовано (усередині) тексту абзацу, має займати менше місця, ніж та сама математика, набрана поза текстом абзацу як окремий матеріал у дисплейному стилі. Щоб побачити це на практиці, пояснімо, що рівняння $$f(x) = \sum\_{i=0}^{n} \frac{a\_i}{1+x}$$ може розходитись або збігатися залежно від значення $$x$$. $$f(x)$$ поза абзацом у дисплейному стилі:

$$f(x) = \sum\_{i=0}^{n} \frac{a\_i}{1+x}$$

Навіть побіжний погляд на попередній приклад виявляє зміни в розмірі та форматуванні математичних символів, таких як $$\sum$$ та розміщення його меж, а також варіації розміру/позиціонування верхніх і нижніх індексів та дробів.

Ці питання математичної типографіки є результатом взаємодії алгоритмів верстки, вбудованих у рушії TeX, разом із певними параметрами інтервалів, що містяться в математичних шрифтах. Ці параметри шрифтів допомагають тонко налаштовувати набір формул відповідно до особливостей дизайну використовуваних математичних шрифтів.

## Перевизначення стандартних математичних стилів

Іноді вам може знадобитися змінити стиль за замовчуванням, який використовується для набору певного математичного виразу. Наприклад, ви можете захотіти змінити вбудовану математику, таку як $$f(x) = \frac{1}{1+x}$$, і включити її в абзац, але набрати в дисплейному стилі: $$\displaystyle f(x) = \frac{1}{1+x}$$, хоча це й суттєво впливає на міжрядковий інтервал.

Рушії TeX надають кілька команд, які можна використовувати для перевизначення стилю за замовчуванням, у якому набирається певна формула:

* `\textstyle`: застосувати стиль, що використовується для математики, набраної в абзацах
* `\displaystyle`: застосувати стиль, що використовується для математики, набраної окремими рядками
* `\scriptstyle`: застосувати стиль, що використовується для нижніх або верхніх індексів
* `\scriptscriptstyle`: застосувати стиль, що використовується для індексів другого порядку, нижніх або верхніх

Канонічний приклад узято зі сторінки 142 TeXBook, хоча ми замінили `$$` на улюблене в LaTeX `\[` та `\]`:

```latex
\[
a_0+{1\over a_1+
      {1\over a_2+
        {1 \over a_3 +
           {1 \over a_4}}}}
\]
```

За замовчуванням це набирається так:

$$a\_0+{1\over a\_1+{1\over a\_2 +{1 \over a\_3 + {1 \over a\_4}}}}$$

Стандартний стиль набору можна змінити за допомогою `\displaystyle` команди:

```latex
\[
a_0+{1\over\displaystyle a_1+
      {1\over\displaystyle a_2+
        {1 \over\displaystyle a_3 +
           {1 \over\displaystyle a_4}}}}
\]
```

виходить

$$a\_0+{1\over\displaystyle a\_1+{1\over\displaystyle a\_2+{1 \over\displaystyle a\_3 +{1 \over\displaystyle a\_4}}}}$$

Ось ще один приклад, який демонструє вплив `\textstyle`, `\scriptstyle` та `\scriptscriptstyle`:

```latex
\[
\begin{align*}
f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\textstyle f(x) = \textstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptstyle f(x) = \scriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptscriptstyle f(x) = \scriptscriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x}
\end{align*}
\]
```

що відображається як $$\begin{align\*} f(x) = \sum\_{i=0}^{n} \frac{a\_i}{1+x} \ \textstyle f(x) = \textstyle \sum\_{i=0}^{n} \frac{a\_i}{1+x} \ \scriptstyle f(x) = \scriptstyle \sum\_{i=0}^{n} \frac{a\_i}{1+x} \ \scriptscriptstyle f(x) = \scriptscriptstyle \sum\_{i=0}^{n} \frac{a\_i}{1+x} \end{align\*}$$

Ось приклад, який ви можете відкрити в Overleaf:

```latex
\documentclass{article}
\usepackage{amsmath}
\title{Дослідження стилів відображення математики}
\author{Команда Overleaf}
\begin{document}
\maketitle
Залежно від значення \(x\) рівняння \( f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \) може розходитись або збігатися.

\[ f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \]

\vspace{1cm}

Елементи вбудованої математики можна набрати в іншому стилі: \(f(x) = \displaystyle \frac{1}{1+x}\). Те саме стосується матеріалу, набраного у дисплейному стилі:

\begin{align*}
f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\textstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptscriptstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x}
\end{align*}
\end{document}
```

[Відкрити цей приклад в Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Exploring+math+display+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Ctitle%7BExploring+math+display+styles%7D%0A%5Cauthor%7BOverleaf+team%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0ADepending+on+the+value+of+%5C%28x%5C%29+the+equation+%5C%28+f%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D+%5C%29+may+diverge+or+converge.%0A%0A%5C%5B+f%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D+%5C%5D%0A%0A%5Cvspace%7B1cm%7D%0A%0AInline+maths+elements+can+be+set+with+a+different+style%3A+%5C%28f%28x%29+%3D+%5Cdisplaystyle+%5Cfrac%7B1%7D%7B1%2Bx%7D%5C%29.+The+same+is+true+for+display+math+material%3A%0A%0A%5Cbegin%7Balign%2A%7D%0Af%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D+%5C%5C%0A%5Ctextstyle+f%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D+%5C%5C%0A%5Cscriptstyle+f%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D+%5C%5C%0A%5Cscriptscriptstyle+f%28x%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7Bn%7D+%5Cfrac%7Ba_i%7D%7B1%2Bx%7D%0A%5Cend%7Balign%2A%7D%0A%5Cend%7Bdocument%7D)

## Додаткове читання

Для отримання додаткової інформації див.

* [Математичні вирази](/latex/uk/matematika/01-mathematical-expressions.md)
* [Нижні та верхні індекси](/latex/uk/matematika/02-subscripts-and-superscripts.md)
* [Вирівнювання рівнянь за допомогою amsmath](/latex/uk/matematika/06-aligning-equations-with-amsmath.md)
* [Інтервали в математичному режимі](/latex/uk/matematika/08-spacing-in-math-mode.md)
* [Інтеграли, суми та межі](/latex/uk/matematika/09-integrals-sums-and-limits.md)
* [Математичні шрифти](/latex/uk/matematika/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/uk/matematika/10-display-style-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.
