> 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/ko/mathematics/05-fractions-and-binomials.md).

# 분수와 이항계수

## 소개

이 문서는 분수와 이항 계수를 조판하는 방법을 설명하며, 다음 예제로 시작하는데, 이는 다음을 사용합니다. [`amsmath` 패키지](https://ctan.org/pkg/amsmath?lang=en):

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
이항 계수, \(\binom{n}{k}\)는 다음 식으로 정의됩니다:
\[
    \binom{n}{k} = \frac{n!}{k!(n-k)!}
\]
\end{document}
```

[Overleaf에서 이 예제를 엽니다.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Fractions+and+Binomials\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0AThe+binomial+coefficient%2C+%5C%28%5Cbinom%7Bn%7D%7Bk%7D%5C%29%2C+is+defined+by+the+expression%3A%0A%5C%5B%0A++++%5Cbinom%7Bn%7D%7Bk%7D+%3D+%5Cfrac%7Bn%21%7D%7Bk%21%28n-k%29%21%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

다음 [`amsmath` 패키지](https://ctan.org/pkg/amsmath?lang=en) 는 문서 프리앰블에 다음 줄을 추가하여 불러옵니다:

```latex
\usepackage{amsmath}
```

다음과 같은 출력이 생성됩니다:

![이항 계수의 LaTeX 조판을 보여주는 이미지](/files/6cbb888bb59ef6e1fe6158d793fb5c4d7472d1e6)

## 분수 표시

분수의 시각적 모양은 문장 내에 나타나는지, 문단의 일부로 나타나는지, 아니면 자체 줄에 독립적으로 표시되는 조판인지에 따라 달라집니다. 다음 예제는 이러한 시각적 변화들을 보여줍니다:

```latex
\documentclass{article}
% geometry 패키지를 사용하여
% 도움말 문서 그래픽의 너비를 줄임
\usepackage[textwidth=8cm]{geometry}
\begin{document}
분수는 문단 텍스트 안에 인라인으로 사용할 수 있습니다. 예를
들어 \(\frac{1}{2}\)처럼 하거나, 자체 줄에 표시할 수도 있습니다,
이런 식입니다:
\[\frac{1}{2}\]
\end{document}
```

[Overleaf에서 이 예제를 엽니다.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Inline+and+display+of+fractions+and+binomials\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+to+reduce%0A%25+the+width+of+help+article+graphics%0A%5Cusepackage%5Btextwidth%3D8cm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AFractions+can+be+used+inline+within+the+paragraph+text%2C+for+%0Aexample+%5C%28%5Cfrac%7B1%7D%7B2%7D%5C%29%2C+or+displayed+on+their+own+line%2C+%0Asuch+as+this%3A%0A%5C%5B%5Cfrac%7B1%7D%7B2%7D%5C%5D%0A%5Cend%7Bdocument%7D)

이 예제는 다음 출력을 생성합니다:

![LaTeX에서 인라인 및 디스플레이 수학 모드를 보여주는 예시](/files/63aff6b0a536d1fecee9cd62c0c86bc32b4a0fdd)

* **참고**: 수학의 인라인 및 디스플레이 버전에 대한 자세한 정보는 Overleaf 문서에서 찾을 수 있습니다 [수학 모드의 표시 스타일](/latex/ko/mathematics/10-display-style-in-math-mode.md).

우리의 예제 분수는 다음을 사용하여 조판됩니다 `\frac` 명령어(`\frac{1}{2}`)이며, 일반적인 형식은 다음과 같습니다 `\frac{*분자*}{*분모*}`.

## 텍스트 스타일 분수

다음 예제는 다음을 사용하여 텍스트만으로 이루어진 분수를 조판하는 것을 보여줍니다 `\text{...}` 명령어를 `amsmath` 패키지를 불러오세요.  `\text{...}` 명령어는 LaTeX가 텍스트를 일반 수학 내용으로 조판하지 않도록 방지하는 데 사용됩니다.

```latex
\documentclass{article}
% geometry 패키지를 사용하여
% 도움말 문서 그래픽의 너비를 줄임
\usepackage[textwidth=8cm]{geometry}
\usepackage{amsmath}% \text{...} 명령어용
\begin{document}
우리는 \texttt{amsmath} 패키지의 명령어
\verb|\text{...}|를 사용하여 텍스트만으로 이루어진 분수를 만듭니다
처럼:

\[\frac{\text{분자}}{\text{분모}}\]

\verb|\text{...}| 명령어가 없으면 결과는
다음과 같이 보입니다:

\[\frac{분자}{분모}\]
\end{document}
```

[Overleaf에서 이 예제를 엽니다.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Text+fractions\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+to+reduce%0A%25+the+width+of+help+article+graphics%0A%5Cusepackage%5Btextwidth%3D8cm%5D%7Bgeometry%7D%0A%5Cusepackage%7Bamsmath%7D%25+For+the+%5Ctext%7B...%7D+command%0A%5Cbegin%7Bdocument%7D%0AWe+use+the+%5Ctexttt%7Bamsmath%7D+package+command%0A%5Cverb%7C%5Ctext%7B...%7D%7C+to+create+text-only+fractions%0Alike+this%3A%0A%0A%5C%5B%5Cfrac%7B%5Ctext%7Bnumerator%7D%7D%7B%5Ctext%7Bdenominator%7D%7D%5C%5D%0A%0AWithout+the+%5Cverb%7C%5Ctext%7B...%7D%7C+command+the+result+%0Alooks+like+this%3A%0A%0A%5C%5B%5Cfrac%7Bnumerator%7D%7Bdenominator%7D%5C%5D%0A%5Cend%7Bdocument%7D)

이 예제는 다음 출력을 생성합니다:

![텍스트형 분수](/files/d8641b3788d979bb0cb140fa14fd0ded786489e8)

## 조판된 수학에서의 크기와 간격

LaTeX가 조판하는 수학 자료의 크기와 간격은 [알고리즘에 의해 결정됩니다](https://tug.org/TUGboat/tb27-1/tb86jackowski.pdf) 이 알고리즘은 수학을 조판하는 데 사용되는 글꼴 안에 들어 있는 크기 및 위치 데이터에 적용됩니다.

때때로 LaTeX가 선택한 기본 수학 스타일—수학 요소의 크기와 간격—을 재정의해야 하거나 그렇게 하는 것이 바람직할 수 있으며, 이에 대해서는 Overleaf 도움말 문서 [수학 모드의 표시 스타일](/latex/ko/mathematics/10-display-style-in-math-mode.md#overriding-default-mathematical-styles).

요약하면, 수학을 조판할 때 사용되는 기본 스타일은 다음 명령어로 변경할 수 있습니다:

* `\textstyle`: 문단 안에 조판된 수학에 사용되는 스타일을 적용합니다;
* `\displaystyle`: 자체 줄에 조판된 수학에 사용되는 스타일을 적용합니다;
* `\scriptstyle`: 아래첨자나 위첨자에 사용되는 스타일을 적용합니다;
* `\scriptscriptstyle`: 2차 아래첨자나 위첨자에 사용되는 스타일을 적용합니다;

이는 다음 예제에서 보여줍니다.

```latex
\documentclass{article}
% geometry 패키지를 사용하여
% 도움말 문서 그래픽의 너비를 줄임
\usepackage[textwidth=9.5cm]{geometry}
\begin{document}

문단 안에서 조판된 분수는 일반적으로 다음과 같이 보입니다: \(\frac{3x}{2}\). \LaTeX{}가 더 큰 디스플레이 스타일, 예를 들어 \( \displaystyle \frac{3x}{2} \),을 사용하도록 강제할 수 있으며, 이는 줄 간격에도 영향을 미칩니다. 문단 안 수학의 크기도 줄일 수 있습니다: \(\scriptstyle \frac{3x}{2}\) 또는 \(\scriptscriptstyle \frac{3x}{2}\). \verb|\scriptscriptstyle| 예제에서는 간격의 감소에 주목하세요: 문자들이 \textit{vinculum}(분자와 분모를 구분하는 선)에 더 가까이 배치됩니다.

마찬가지로, 일반적으로 디스플레이 스타일로 조판되는 수학의 스타일도 변경할 수 있습니다:

\[f(x)=\frac{P(x)}{Q(x)}\quad \textrm{and}\quad \textstyle f(x)=\frac{P(x)}{Q(x)}\quad \textrm{and}\quad \scriptstyle f(x)=\frac{P(x)}{Q(x)}\]
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Changing+default+math+styles\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+to+reduce%0A%25+the+width+of+help+article+graphics%0A%5Cusepackage%5Btextwidth%3D9.5cm%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0A%0AFractions+typeset+within+a+paragraph+typically+look+like+this%3A+%5C%28%5Cfrac%7B3x%7D%7B2%7D%5C%29.+You+can+force+%5CLaTeX%7B%7D+to+use+the+larger+display+style%2C+such+as+%5C%28+%5Cdisplaystyle+%5Cfrac%7B3x%7D%7B2%7D+%5C%29%2C+which+also+has+an+effect+on+line+spacing.+The+size+of+maths+in+a+paragraph+can+also+be+reduced%3A+%5C%28%5Cscriptstyle+%5Cfrac%7B3x%7D%7B2%7D%5C%29+or+%5C%28%5Cscriptscriptstyle+%5Cfrac%7B3x%7D%7B2%7D%5C%29.+For+the+%5Cverb%7C%5Cscriptscriptstyle%7C+example+note+the+reduction+in+spacing%3A+characters+are+moved+closer+to+the+%5Ctextit%7Bvinculum%7D+%28the+line+separating+numerator+and+denominator%29.%0A%0AEqually%2C+you+can+change+the+style+of+mathematics+normally+typeset+in+display+style%3A%0A%0A%5C%5Bf%28x%29%3D%5Cfrac%7BP%28x%29%7D%7BQ%28x%29%7D%5Cquad+%5Ctextrm%7Band%7D%5Cquad+%5Ctextstyle+f%28x%29%3D%5Cfrac%7BP%28x%29%7D%7BQ%28x%29%7D%5Cquad+%5Ctextrm%7Band%7D%5Cquad+%5Cscriptstyle+f%28x%29%3D%5Cfrac%7BP%28x%29%7D%7BQ%28x%29%7D%5C%5D%0A%5Cend%7Bdocument%7D)

이 예제는 다음 출력을 생성합니다:

![LaTeX 기본 수학 스타일의 변화를 보여주는 이미지](/files/d4b217c8070bb8a7b4f683a003b5ad1939f27653)

## 연분수

더 복잡한 식을 얻기 위해 분수는 중첩될 수 있습니다. 다음 예제에 표시된 두 번째 분수쌍은 둘 다 다음을 사용합니다 `\cfrac` 연분수를 생성하도록 특별히 설계된 명령어입니다. 이를 사용하려면 `\cfrac` 다음을 불러와야 합니다 [`amsmath` 패키지](https://ctan.org/pkg/amsmath?lang=en) 문서 프리앰블에서.

```latex
\documentclass{article}
% geometry 패키지를 사용하여
% 도움말 문서 그래픽의 너비를 줄임
\usepackage[textwidth=9.5cm]{geometry}
% \cfrac{...}{...} 명령어에 접근하려면 amsmath를 불러오기
\usepackage{amsmath}
\begin{document}
분수는 중첩될 수 있지만, 이 예제에서는 분모에 사용된 기본 수학 스타일이 이상적인 결과를 만들지 못한다는 점에 주목하세요...

\[ \frac{1+\frac{a}{b}}{1+\frac{1}{1+\frac{1}{a}}} \]

\noindent ...그래서 우리는 조판을 개선하기 위해 \verb|\displaystyle|을 사용합니다:

\[ \frac{1+\frac{a}{b}} {\displaystyle 1+\frac{1}{1+\frac{1}{a}}} \]

다음은 \texttt{amsmath}의 \verb|\cfrac| 명령어를 사용하는 예제입니다:

\[
  a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cdots}}}
\]

다음은 \texttt{amsmath} 문서에서 가져온 또 다른 예제로, 분자의 왼쪽
및 오른쪽 배치를 각각 \verb|\cfrac[l]|과 \verb|\cfrac[r]|을 사용하여 보여줍니다:
\[
\cfrac[l]{1}{\sqrt{2}+
\cfrac[r]{1}{\sqrt{2}+
\cfrac{1}{\sqrt{2}+\dotsb}}}
\]
\end{document}
```

[Overleaf에서 이 예제를 엽니다.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+continued+fractions\&snip=%5Cdocumentclass%7Barticle%7D%0A%25+Using+the+geometry+package+to+reduce%0A%25+the+width+of+help+article+graphics%0A%5Cusepackage%5Btextwidth%3D9.5cm%5D%7Bgeometry%7D%0A%25+Load+amsmath+to+access+the+%5Ccfrac%7B...%7D%7B...%7D+command%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0AFractions+can+be+nested+but%2C+in+this+example%2C+note+how+the+default+math+styles%2C+as+used+in+the+denominator%2C+don%27t+produce+ideal+results...%0A%0A%5C%5B+%5Cfrac%7B1%2B%5Cfrac%7Ba%7D%7Bb%7D%7D%7B1%2B%5Cfrac%7B1%7D%7B1%2B%5Cfrac%7B1%7D%7Ba%7D%7D%7D+%5C%5D%0A%0A%5Cnoindent+...so+we+use+%5Cverb%7C%5Cdisplaystyle%7C+to+improve+typesetting%3A%0A%0A%5C%5B+%5Cfrac%7B1%2B%5Cfrac%7Ba%7D%7Bb%7D%7D+%7B%5Cdisplaystyle+1%2B%5Cfrac%7B1%7D%7B1%2B%5Cfrac%7B1%7D%7Ba%7D%7D%7D+%5C%5D%0A%0AHere+is+an+example+which+uses+the+%5Ctexttt%7Bamsmath%7D+%5Cverb%7C%5Ccfrac%7C+command%3A%0A%0A%5C%5B%0A++a_0%2B%5Ccfrac%7B1%7D%7Ba_1%2B%5Ccfrac%7B1%7D%7Ba_2%2B%5Ccfrac%7B1%7D%7Ba_3%2B%5Ccdots%7D%7D%7D%0A%5C%5D%0A%0AHere+is+another+example%2C+derived+from+the+%5Ctexttt%7Bamsmath%7D+documentation%2C+which+demonstrates+left%0Aand+right+placement+of+the+numerator+using+%5Cverb%7C%5Ccfrac%5Bl%5D%7C+and+%5Cverb%7C%5Ccfrac%5Br%5D%7C+respectively%3A%0A%5C%5B%0A%5Ccfrac%5Bl%5D%7B1%7D%7B%5Csqrt%7B2%7D%2B%0A%5Ccfrac%5Br%5D%7B1%7D%7B%5Csqrt%7B2%7D%2B%0A%5Ccfrac%7B1%7D%7B%5Csqrt%7B2%7D%2B%5Cdotsb%7D%7D%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

이 예제는 다음 출력을 생성합니다:

![LaTeX로 조판된 포함된 분수를 보여주는 그래픽](/files/35748d26c9b27f691e4fef89c0f5b6c3e2096c52)

## 마지막 예제

이 예제는 더 복잡한 연분수를 보여줍니다:

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand*{\contfrac}[2]{%
{
  \rlap{$\dfrac{1}{\phantom{#1}}$}%
  \genfrac{}{}{0pt}{0}{}{#1+#2}%
}
}
\[
  a_0 +
  \contfrac{a_1}{
  \contfrac{a_2}{
  \contfrac{a_3}{
  \genfrac{}{}{0pt}{0}{}{\ddots}
  }}}
\]

\end{document}
```

[Overleaf에서 이 예제를 엽니다.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=A+more+complex+continued+fraction\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cnewcommand%2A%7B%5Ccontfrac%7D%5B2%5D%7B%25%0A%7B%0A++%5Crlap%7B%24%5Cdfrac%7B1%7D%7B%5Cphantom%7B%231%7D%7D%24%7D%25%0A++%5Cgenfrac%7B%7D%7B%7D%7B0pt%7D%7B0%7D%7B%7D%7B%231%2B%232%7D%25%0A%7D%0A%7D%0A%5C%5B%0A++a_0+%2B%0A++%5Ccontfrac%7Ba_1%7D%7B%0A++%5Ccontfrac%7Ba_2%7D%7B%0A++%5Ccontfrac%7Ba_3%7D%7B%0A++%5Cgenfrac%7B%7D%7B%7D%7B0pt%7D%7B0%7D%7B%7D%7B%5Cddots%7D%0A++%7D%7D%7D%0A%5C%5D%0A%0A%5Cend%7Bdocument%7D)

이 예제는 다음 출력을 생성합니다:

![LaTeX로 조판된 고급 연분수 이미지](/files/0c5cfe5c761b0262feacd3559879eba6710e0352)

## 추가 읽을거리

자세한 내용은 다음을 참조하세요:

* [수학 표현식](/latex/ko/mathematics/01-mathematical-expressions.md)
* [아래첨자와 위첨자](/latex/ko/mathematics/02-subscripts-and-superscripts.md)
* [대괄호와 소괄호](/latex/ko/mathematics/03-brackets-and-parentheses.md)
* [amsmath를 사용한 방정식 정렬](/latex/ko/mathematics/06-aligning-equations-with-amsmath.md)
* [연산자](/latex/ko/mathematics/07-operators.md)
* [수학 글꼴](/latex/ko/mathematics/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/ko/mathematics/05-fractions-and-binomials.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.
