> 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/12-latex-error-verb-ended-by-end-of-line.md).

# LaTeX 오류: \verb가 줄 끝에서 끝남

이 오류는 다음을 사용했을 때 나타납니다 **`verbatim`** 명령을 잘못 사용한 경우입니다. 이렇게 하면 아래 오류가 발생합니다:

main.tex, 5행

LaTeX 오류: \verb가 줄 끝에서 종료되었습니다.

LaTeX 매뉴얼이나 LaTeX Companion에서 설명을 참조하세요. 즉시 도움말을 보려면 H를 입력하세요. ... l.7 \unbrace{\verb+\error+} 계속하려면 입력해 보세요. 그래도 안 되면, 종료하려면 X를 입력하세요.

이 오류를 해결하려면 다음을 사용하는 것이 가장 좋습니다: **`verbatim`** 대신 아래와 같이 환경을 사용하세요:

```latex
\begin{verbatim}
원문 그대로의 텍스트를 여기에 넣어야 합니다.
\end{verbatim}
```

## 일반적인 원인

**\verb 명령 안에 줄바꿈을 포함하는 경우:**

이 오류가 발생하는 흔한 원인 중 하나는 다음을 사용했기 때문입니다: **`\verb`** 명령을 사용했지만 아래와 같이 줄바꿈을 넣었기 때문입니다:

```latex
\LaTeX에서는 다양한 글꼴을 다음과 같이 쓸 수 있습니다
\verb{
\textbf{굵게}
\textit{이탤릭체}
\textsf{산세리프}
}
```

이렇게 하면 오류가 발생합니다. 줄바꿈은 다음 안에 허용되지 않기 때문입니다: **`\verb`** 명령입니다. 이를 올바르게 작성하려면 다음을 사용해야 합니다: **`verbatim`** 아래와 같이 환경을 사용하세요:

```latex
% 프리앰블에

\usepackage{verbatim}

% 문서의 본문에서

\LaTeX에서는 다양한 글꼴을 다음과 같이 쓸 수 있습니다
\begin{verbatim}
\textbf{굵게}
\textit{이탤릭체}
\textsf{산세리프}
\end{verbatim}
```

![Verbatim.PNG](/files/4d770b9d7bcee90d7f7849b4cc6bdb513bab322c)

**\verb 명령에서 끝 문자를 생략하는 경우:**

verb 명령은 아래와 같이 사용해야 합니다:

```latex
\verb!\frac{1}{2}!
```

여기서 구분 문자는 고유하지 않으며, 어떤 문자든 사용할 수 있습니다. 우리가 여기서 **`!`** 를 구분 문자로 사용한 이유는 다음이 없기 때문입니다 **`!`** 다음과 같이 적힌 **`\frac{1}{2}`**. 만약 우리가 다음과 같이 쓰기로 했다면 **`\verb{\frac{1}{2}}`**, 아래와 같은 출력을 생성하게 되며, 이는 올바르지 않습니다.

```latex
\verb{\frac{1}{2}}
```

![Delimiters.PNG](/files/0a18715a847cfed1cc3a815cfa096f2fe5e513f2)

이것은 문제를 일으킬 수 있습니다. 왜냐하면 다음의 시작과 끝이 **`\verb`** 같은 문자가 아니면 오류가 발생하기 때문입니다. 따라서 아래의 모든 명령은 오류를 발생시킵니다:

```latex
\verb \frac{1}{2}
```

```latex
{\verb \frac{1}{2}}
```

```latex
\verb!\frac{1}{2}
```

다시 말하지만, 단순히 다음을 사용하는 것이 권장됩니다: **`verbatim`** 아래와 같이 이를 작성하기 위해 환경을 사용하세요

```latex
\begin{verbatim}
\frac{1}{2}
\end{verbatim}
```

**다른 명령 안에서 \verb 명령을 사용하는 경우:**

이 오류가 나타나는 또 다른 경우는 다음을 사용했을 때입니다: **`\verb`** 명령을 다른 명령 안에서 아래와 같이 사용하는 경우입니다

```latex
\section{\verb!\frac{1}{2}!}
```

이는 LaTeX에서 허용되지 않으며, 다음이 도움이 되지 않는 몇 안 되는 경우 중 하나입니다: **`verbatim`** 환경이 도움이 되지 않습니다. 이 오류를 해결하려면 다음을 불러와야 합니다: **`cprotect`** 아래와 같이 패키지를:

```latex
% 프리앰블에

\usepackage{cprotect}

% 문서의 본문에서

\cprotect\section{원문 그대로의 \verb!\frac{1}{2}!가 포함된 섹션 제목입니다}
이것은 일부 텍스트입니다
```

![Cprotect.PNG](/files/250b0d3fa8f2c183e89d200f232b8566cfd7f501)


---

# 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/12-latex-error-verb-ended-by-end-of-line.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.
