> 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/latex-1/05-double-superscript.md).

# 이중 위첨자

## 소개

관례적으로 LaTeX는 캐럿 문자(`^`)를 사용해 위첨자를 조판합니다. 예를 들어 `$a^b$` 는 다음과 같이 출력됩니다 $$a^b$$. 만약 다음과 같이 쓰면 `$a^bcde$`, 첫 번째 문자만 `b`가 위첨자로 처리됩니다. 예를 들어 $$a^bcde$$, LaTeX는 *가정하지* 않기 때문입니다. 전체 문자 집합을 위첨자로 처리하고 싶다고 `bcde`. 여러 항목(토큰)을 위첨자로 조판하려면, 이를 그룹으로 묶어 LaTeX에 알려야 합니다 `{...}`, 다음과 같이 말입니다: `$a^{bcde}$`, 는 다음과 같이 출력됩니다 $$a^{bcde}$$.

## 이중 위첨자 오류

이중 위첨자 오류는 LaTeX에 수학식의 어떤 부분에 위첨자를 추가하라고 했는데 그 부분에 이미 *이미* 위첨자가 붙어 있을 때 발생합니다. 이 오류는 보통 중괄호를 사용해 해결할 수 있습니다 `{...}`, 수학 모드에서는 이 중괄호가 이른바 *부분 수식*—즉, 조판하려는 수학 표현식의 일부를 가리키는 용어입니다.

예를 들어 다음과 같이 쓰면 `$a^b^c$` 다음과 같은 이중 위첨자 오류가 발생합니다:

![Overleaf에 표시된 이중 위첨자 오류](/files/db7e2b4ebcd779b041ef6bf31c43f7c0b7429018)

이 특정 오류는 중괄호를 사용하여 여러 가지 방법으로 고칠 수 있습니다 `{...}`—중괄호의 위치에 따라 결과가 달라집니다:

* `$a^{b^c}$` 조판됩니다 $$a^{b^c}$$
* `${a^b}^c$` 조판됩니다 $${a^b}^c$$
* `$a^{bc}$` 조판됩니다 $$a^{bc}$$

### 이중 위첨자 오류: 특수한 경우

#### 위첨자와 악센트

에 관한 질문 `tex.stackexchange` 에는 [이중의 놀라운 예가 *아래첨자* 오류](https://tex.stackexchange.com/questions/253080/why-am-i-getting-a-double-subscript-error) 그 근본 원인과 해결책은 이중 위첨자에도 적용됩니다. 다음 예시는 중괄호를 사용했음에도 컴파일에 실패합니다:

```latex
\documentclass{article}
\begin{document}
\({\vec a^b}^c\)
\end{document}
```

[이 예제를 ***오류를 발생시키는*** Overleaf의 예](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%28%7B%5Cvec+a%5Eb%7D%5Ec%5C%29%0A%5Cend%7Bdocument%7D)

다음과 마찬가지로 [이중 아래첨자 오류](/latex/ko/latex-1/04-double-subscript.md), 이 문제를 해결하는 한 가지 방법은 [`accents` 패키지](https://ctan.org/pkg/accents?lang=en) 를 문서 서문에 추가합니다(다음과 같이 제안된 [여기](https://tex.stackexchange.com/a/253094)):

```latex
\documentclass{article}
\usepackage{accents}
\begin{document}
\({\vec a^b}^c\)
\end{document}
```

[이 예제를 ***수정됨*** Overleaf의 예](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Baccents%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%28%7B%5Cvec+a%5Eb%7D%5Ec%5C%29%0A%5Cend%7Bdocument%7D)

#### 위첨자와 프라임 기호 사용하기

이 오류의 또 다른 흔한 원인은 위첨자와 함께 프라임 기호를 사용하는 것입니다. 이는 아래에 보이듯이 텐서 표기법에서 특히 문제를 일으킵니다:

```latex
\documentclass{article}
\begin{document}
\[T'_{\nu_{1}\nu_{2}\ldots\nu_{p}}^{\mu_{1}\mu_{2}\ldots\mu_{q}}\]
\end{document}
```

[이 예제를 ***오류를 발생시키는*** Overleaf의 예](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5BT%27_%7B%5Cnu_%7B1%7D%5Cnu_%7B2%7D%5Cldots%5Cnu_%7Bp%7D%7D%5E%7B%5Cmu_%7B1%7D%5Cmu_%7B2%7D%5Cldots%5Cmu_%7Bq%7D%7D%5C%5D%0A%5Cend%7Bdocument%7D)

이 예시는 다음 오류를 발생시킵니다:

![수학 모드에서 프라임 기호로 인해 발생한 이중 위첨자 오류](/files/444bd3918d5db6e992b453e3cfc38d123c60a077)

수학 모드에서 LaTeX는 프라임이 붙은 기호를 `T'` 를 `T^{\prime}`—즉, `T`. 이후 LaTeX가 캐럿 문자를 읽으면 `^`, 다음을 읽는 과정에서 `^{\mu_{1}\mu_{2}\ldots\mu_{q}}`, *두 번째 위첨자를 추가하려는 시도로 인식하고* 를 `T`, 이로 인해 오류가 발생합니다.

위 표현을 올바르게 쓰는 방법은 다음 예시에 나와 있습니다:

```latex
\documentclass{article}
\begin{document}
\[T_{\nu_{1}\nu_{2}\ldots\nu_{p}}^{\prime\mu_{1}\mu_{2}\ldots\mu_{q}}\]
\end{document}
```

[이 예제를 ***수정됨*** Overleaf의 예](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5BT_%7B%5Cnu_%7B1%7D%5Cnu_%7B2%7D%5Cldots%5Cnu_%7Bp%7D%7D%5E%7B%5Cprime%5Cmu_%7B1%7D%5Cmu_%7B2%7D%5Cldots%5Cmu_%7Bq%7D%7D%5C%5D%0A%5Cend%7Bdocument%7D)

이 예시는 다음 출력을 생성합니다(가독성을 위해 확대됨):

![Overleaf에서 위첨자와 프라임 기호를 조판하는 예](/files/4653f6d550fc3fa6ece375b6855dc705d9ca3549)

## 위첨자에 대한 추가 설명

더 높은 단계의 위첨자는 다음과 같은 LaTeX를 작성하여 조판할 수 있습니다 `a^{b^{c^{d^e}}}` 는 다음과 같이 조판됩니다 $$a^{b^{c^{d^e}}}$$. 두 번째 단계 이상의 모든 위첨자는 같은 글꼴 크기(포인트 단위)로 조판되는 반면, 첫 번째 단계 위첨자는 약간 더 큰 글꼴 크기(포인트 크기)를 사용합니다. 위첨자에 대해 더 알아보려면 Overleaf의 [해당 주제 전용 도움말 페이지를 방문하세요](/latex/ko/mathematics/02-subscripts-and-superscripts.md).


---

# 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/latex-1/05-double-superscript.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.
