> 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/knowledge-base/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md).

# LaTeX 명령을 포함하지 않는 단어 수 계산을 할 수 있는 방법이 있나요?

## 소개

예, 다음을 선택하면 LaTeX 명령을 자동으로 제외하는 단어 수를 얻을 수 있습니다 `메뉴` 그리고 그런 다음 `단어 수` 이 짧은 스크린캐스트에서 보여주듯이:

![Wordcount.gif](/files/28eb5073e500c8263875a23638fae5aea8bfa962)

그러면 다음을 실행합니다 [texcount 유틸리티](http://app.uio.no/ifi/texcount) 프로젝트의 मुख्य 파일과 다음을 통해 프로젝트의 메인 파일로 가져온 모든 파일의 단어 수를 셉니다 `\include` 및 `\input`. texcount가 Overleaf에서 작동하려면 프로젝트의 मुख्य 문서가 프로젝트 최상위 수준(즉, 폴더 안이 아님)에 있어야 합니다.

## 단어 수에 참고문헌 포함

기본적으로 참고문헌, 머리글, 캡션, 부동 객체, 표시 수식 등은 개수에 포함되지 않습니다. 인용과 참고문헌을 포함하려면:

1. 추가하기 `%TC:incbib` .tex 파일의 서두에 넣고, 그런 다음
2. 프로젝트에 latexmkrc라는 이름의 파일(확장자 없음)을 추가하고, 그 안에 다음 줄을 넣으세요(“main”을 메인 문서 .tex 파일의 이름으로 바꾸세요)

   ```perl
   END { system('cp', 'output.bbl', 'main.bbl'); }
   ```

**이 우회 방법은 수동 `thebibliography` 목록 또는 BibTeX를 사용하는 경우에만 적용됩니다.** [**texcount는 현재 biblatex를 지원하지 않습니다**](https://tex.stackexchange.com/q/102882/226)**.**

참고 [#사용자 지정 매개변수로 texcount 실행](#run-texcount-with-custom-parameters) 머리글, 캡션, 부동 객체, 표시 수식 등의 단어 수를 표시하기 위해

## 일부 섹션 무시하기

때때로 단어 수에서 특정 섹션이나 영역을 제외하고 싶을 수 있습니다. 다음을 넣을 수 있습니다 `%TC:ignore` 및 `%TC:endignore` 이러한 영역 주위에. 예를 들면:

```latex
%TC:ignore
\maketitle

\begin{abstract}
...그러면 제목 페이지와 초록은 단어 수에 포함되지 않습니다...
\end{abstract}
%TC:endignore
```

## 사용자 지정 매개변수로 texcount 실행

자신만의 [texcount 매개변수](http://app.uio.no/ifi/texcount/documentation.html) 를 사용하여 출력을 사용자 지정하거나, 문자 수를 계산하거나, 캡션 등을 포함하고 싶다면 프로젝트에서 몇 가지 명령을 정의하면 됩니다(다만 이 경우 LaTeX 명령을 사용해야 합니다...). 예를 들면:

```latex
\usepackage{verbatim}

\newcommand{\detailtexcount}[1]{%
  \immediate\write18{texcount -merge -sum -q #1.tex output.bbl > #1.wcdetail }%
  \verbatiminput{#1.wcdetail}%
}

\newcommand{\quickwordcount}[1]{%
  \immediate\write18{texcount -1 -sum -merge -q #1.tex output.bbl > #1-words.sum }%
  \input{#1-words.sum} 단어
}

\newcommand{\quickcharcount}[1]{%
  \immediate\write18{texcount -1 -sum -merge -char -q #1.tex output.bbl > #1-chars.sum }%
  \input{#1-chars.sum} 문자(공백 제외)%
}
```

파일 이름이 `main.tex`라고 가정하면, 프로젝트에서 이러한 명령을 실행했을 때 PDF에는 다음과 같은 출력이 나타납니다. 출력에는 각 하위(섹션)의 세부 내역과 캡션, 부동 객체, 표시 수식 등의 내역이 포함됩니다. Overleaf 빌드 프로세스의 설정 방식 때문에, BibTeX로 생성된 참고문헌 목록도 함께 계산하려면 texcount 명령에 \`output.bbl\`을 포함해야 합니다.

```latex
% 이건 세지 마세요!
%TC:ignore
\quickwordcount{main}
\quickcharcount{main}
\detailtexcount{main}
%TC:endignore
```

![Custom-texcount.png](/files/8b08f9839c5751734032e630f7640066dc87eea7)

다음을 참조하세요 [texcount 문서](http://app.uio.no/ifi/texcount/documentation.html#options) 각 실행 플래그가 무엇을 하는지에 대해서는. 이러한 예제의 실제 동작은 [여기](https://www.overleaf.com/read/dqvrqghbtmbc).

섹션별 세부 내역에서의 "머리글의 단어"와 "머리글"은 `\\section`, `\subsection` 등은 포함하되 1, 1.1 등의 번호는 제외하기 위한 것입니다.

섹션별 세부 내역에서의 "본문 밖의 단어"와 "캡션"은 `\caption`를 포함하되 "표 1" 등의 접두사는 제외하기 위한 것입니다.

기본적으로 인라인 인용은 계산되지 않습니다. 이를 계산하려면, 서두에 다음 줄을 추가하세요:

```latex
%TC:macro \cite [option:text,text]
%TC:macro \citep [option:text,text]
%TC:macro \citet [option:text,text]
% ... 그리고 사용하는 다른 모든 \cite 명령에도 대해
```

하지만 각 `\citep{ddd}` 는 texcount에서 단어 하나로만 계산됩니다(그럴 만도 합니다. 그렇지 않으면 여러 저자를 가진 참고문헌을 인용하여 단어 수를 엄청나게 인위적으로 늘릴 수 있으니까요). 따라서 `\cite{faye1996}`는 (Fay, 1996)로 렌더링되더라도 texcount에서는 단어 1개로, 다른 워드 프로세서에서는 단어 2개로 계산됩니다.

"본문의 단어" 계산에 표와 표 형식 안의 단어를 포함하려면, [이 texcount 지시문들을 추가할 수 있습니다](https://tex.stackexchange.com/a/37777/226) 도 마찬가지입니다:

```latex
%TC:group table 0 1
%TC:group tabular 1 1
```

## texcount와 함께 \import 명령 사용하기

기본적으로 texcount는 다음과 같은 일반적인 명령을 인식합니다 `\input`, `\include` 포함된 하위 파일의 단어 수를 세기 위해. 그러나 명령 `\import` 에서 `import` 패키지는 기본적으로 지원되지 않습니다.

따라서 문서에서 `\import` 를 사용하고 있다면, 더 일반적인 `\input` 및 `\include` 명령으로 바꾸는 것이 좋으며, 그러면 추가 변경 없이 texcount가 작동합니다.

계속해서 `\import`를 사용하고 싶다면, 서두에 texcount 지시문을 추가하여 `\import{foo}{bar}` 가 다음처럼 보이도록 `\include{foo/bar}` texcount에 인식시키면 하위 파일의 단어 수를 셀 수 있습니다:

```latex
%TC:fileinclude \import dir,file
```

이 줄을 추가한 후에는 "단어 수"를 클릭하기 전에 먼저 다시 컴파일해야 한다는 점에 유의하세요.

## 추가 읽을거리

* [전체 texcount 문서](http://app.uio.no/ifi/texcount/documentation.html)


---

# 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/knowledge-base/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.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.
