> 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/figures-and-tables/04-picture-environment.md).

# LaTeX에서 직접 다이어그램 그리기

## 소개

LaTeX의 내장 `picture` 환경은 다이어그램/그림을 만드는 데 사용할 수 있습니다— *필요하지* 이를 사용하기 위해 외부 패키지를 로드할 필요는 없지만, [`pict2e`](https://ctan.org/pkg/pict2e?lang=en) 및 [`picture`](https://ctan.org/pkg/picture) 와 같은 패키지는 그 기능을 확장하거나 개선하기 위해 작성되었습니다.

이 글은 `picture` 환경에 대한 간단한 소개를 제공하며, 모든 예제는 [`pict2e` 패키지](https://ctan.org/pkg/pict2e?lang=en)를 사용합니다. 더 자세한 문서와 다양한 유용한 예제는 다음 자료에서 쉽게 찾아볼 수 있습니다:

* [LaTeX2e 비공식 참고 매뉴얼](https://latexref.xyz/picture.html)
* [LaTeX2ε에 대한 그리 짧지 않은 소개](https://tobi.oetiker.ch/lshort/lshort.pdf) (5장 참조)
* [Wikibooks](https://en.wikibooks.org/wiki/LaTeX/Picture)
* [태그가 달린 질문 `picture-mode` tex.stackexchange에서](https://tex.stackexchange.com/questions/tagged/picture-mode)
* [`pict2e` 패키지 문서](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf)

TikZ/PGF [처럼 강력하고 정교한 그래픽 도구와 비교하면,](https://en.wikipedia.org/wiki/PGF/TikZ), [MetaPost](https://tug.org/metapost.html), [PSTricks](https://ctan.org/topic/pstricks?lang=en) 또는 [Asymptote](https://ctan.org/pkg/asymptote?lang=en) 그 `picture` 환경은 상당히 제한적으로 보일 수 있지만, 때때로 여러분이 하려는 일에 충분할 수도 있습니다.

## 새 그림 만들기

새 그림을 만드는 일은 보통 다음 단계로 이루어집니다:

1. 사용하려는 그리기 단위의 크기를 정의합니다;
2. 를 선언합니다. `picture` 환경은 그림의 크기를 정의합니다;
3. 을 사용하여 개별 그래픽 구성 요소를 그립니다: `\put`, `\multiput` 또는 `\qbezier` 명령.

### 그리기 단위의 크기 정의

그림을 만들려면 보통 먼저 *그리기 단위* 를 다음 명령으로 설정하는 것부터 시작합니다 `\unitlength`은(는) `picture` 환경 밖에서 사용해야 합니다. 예를 들어,

```latex
\setlength{\unitlength}{1cm}
```

라고 쓰면 그리기 단위는 1cm의 배수로 해석됩니다. 기본 단위는 1pt입니다.

### 그림의 크기 정의

다음은 `picture` 환경의 일반적인 형식입니다

```latex
\begin{picture}(width, height)(Xoffset, Yoffset)
 ...
\end{picture}
```

여기서

* `너비` 및 `높이` 는 `\unitlength`의 단위로 된 값이며, 그림의 크기를 정의합니다. LaTeX는 이러한 값을 사용하여 다음 크기의 상자를 만듭니다.
  * 상자(그림) 너비 = `너비` × `\unitlength`
  * 상자(그림) 높이 = `높이` × `\unitlength`
* `(Xoffset, Yoffset)` 는 그림의 원점(왼쪽 아래 모서리)을 설정하는 선택적 좌표이며, *오프셋* 으로 기본 위치에 대해 상대적으로 표현됩니다. `Xoffset` 및 `Yoffset` 도 현재 값의 단위로 표현됩니다. `\unitlength`.

참고로 `Xoffset` 및 `Yoffset` 는 LaTeX가 확보하는 공간, 즉 상자 크기에는 영향을 주지 않습니다.

#### 그림 치수 이해하기

두 개의 그림을 만들 텐데, 둘 다 `\setlength{\unitlength}{1cm}` 를 사용하며 각각 `너비` 및 `높이` 가 3단위입니다.

첫 번째 그림은 기본 원점 `(0,0)`:

```latex
\begin{picture}(3,3)
...
\end{picture}
```

을 사용합니다. 두 번째 그림은 원점을 `(1,1)`:

```latex
\begin{picture}(3,3)(1,1)
...
\end{picture}
```

### 그래픽 그리기

그래픽은 다음 일련의 `\put`, `\multiput`, 또는 `\qbezier` 명령을 사용해 만들어지며, 그림이나 일러스트를 구성하는 개별 “구성 요소”(또는 “객체”)를 생성합니다:

* `\put(x, y){*component*}` 는 `*component*` 를 `(x, y)`.
* `\multiput(x, y)(dx, dy){n}{*component*}` 는 `*component*` `n` 번 그립니다: 위치 `(x, y)` 에서 시작하여 `(dx, dy)` 만큼 반복 이동하며 `*component*`.
* `\qbezier[n](x<sub>1</sub>, y<sub>1</sub>)(x, y)(x<sub>2</sub>, y<sub>2</sub>)`: [2차 베지어 곡선](https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Quadratic_B%C3%A9zier_curves) 여기서:
  * `n` 을 그리기/생성하는 데 사용되는 점의 수를 결정하는 선택적 정수
  * `(x<sub>1</sub>, y<sub>1</sub>)` 는 곡선의 시작점입니다
  * `(x<sub>2</sub>, y<sub>2</sub>)` 는 곡선의 끝점입니다
  * `(x, y)` 는 (2차) 베지어 곡선 제어점임을 나타냅니다

복사된 `*component*` 는 보통 다음과 같은 그래픽 기본 요소로 만들어지는 그래픽 요소입니다 `\line`, `\oval`, `\circle`, `\vector` 등—사용 가능한 기본 요소의 자세한 내용은 [LaTeX2e 비공식 참고 매뉴얼](https://latexref.xyz/picture.html) 또는 [LaTeX2ε에 대한 그리 짧지 않은 소개](https://tobi.oetiker.ch/lshort/lshort.pdf) (5장)를 참조하세요.

**참고**: 이 [`pict2e` 패키지](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf) 은 원래의 `picture` 환경을 확장하여 베지어 곡선을 그리기 위한 여러 명령을 제공합니다: `\bezier`, `\qbezier`, `\cbezier` 및 `\qbeziermax`.

### 오프셋과 원점 이해하기

다음 예제에서는 `\put` 명령을 사용하여 그래픽의 핵심 좌표(위치)를 나타내는 색 점을 그립니다. 두 예제 모두 LaTeX의 `\fbox` 명령을 사용해 그림을 담기 위해 LaTeX가 만든 상자 주위에 테두리를 그려 *바운딩 박스* 를 보여 줍니다.

**예제 1: 기본 원점 사용**

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\setlength{\unitlength}{1cm}
\setlength{\fboxsep}{0pt}

이것이 제 그림입니다\fbox{%
\begin{picture}(3,3)
\put(0,0){{\color{blue}\circle*{0.25}}\hbox{\kern3pt \texttt{(0,0)}}}
\put(3,3){{\color{red}\circle*{0.25}}\hbox{\kern3pt \texttt{(3,3)}}}
\end{picture}}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=understanding+picture+dimensions+example+1\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cusepackage%5Bdvipsnames%5D%7Bxcolor%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Csetlength%7B%5Cfboxsep%7D%7B0pt%7D%0A%0AThis+is+my+picture%5Cfbox%7B%25%0A%5Cbegin%7Bpicture%7D%283%2C3%29%0A%5Cput%280%2C0%29%7B%7B%5Ccolor%7Bblue%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt+%5Ctexttt%7B%280%2C0%29%7D%7D%7D%0A%5Cput%283%2C3%29%7B%7B%5Ccolor%7Bred%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt+%5Ctexttt%7B%283%2C3%29%7D%7D%7D%0A%5Cend%7Bpicture%7D%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경의 치수](/files/ac1b8394ea4a1c28b91e7d1c58d91972a82952b5)

이 `\fbox` 명령은 그래픽의 바운딩 박스 주위에 테두리를 그려, LaTeX가 확보한 공간(영역)을 보여 줍니다:

* 그림 너비 = `너비` × `\unitlength` = 3 × 1cm = 3cm.
* 그림 높이 = `높이` × `\unitlength` = 3 × 1cm = 3cm.

첫 번째 예제는 원점 `(0,0)`이 `\begin{picture}` 명령이 실행된 지점, 즉 “이것이 제 그림입니다”라는 텍스트 바로 뒤에 있음을 보여 줍니다. 또한 오른쪽 위 모서리는 위치 `(3,3)`, 그리고 `(width,height)` 에 있습니다. `\begin{picture}(3,3)`.

**예제 2: 원점을 (1,1)만큼 이동하기**

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\setlength{\unitlength}{1cm}
\setlength{\fboxsep}{0pt}

이것이 제 그림입니다\fbox{%
\begin{picture}(3,3)(1,1)
\put(0,0){{\color{blue}\circle*{0.25}}\hbox{\kern3pt\texttt{(0,0)}}}
\put(1,1){{\color{orange}\circle*{0.25}}\hbox{\kern3pt\texttt{(1,1)}}}
\put(3,3){{\color{red}\circle*{0.25}}\hbox{\kern3pt\texttt{(3,3)}}}
\put(4,4){{\color{black}\circle*{0.25}}\hbox{\kern3pt\texttt{(4,4)}}}
\end{picture}}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=understanding+picture+dimensions+example+2\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cusepackage%5Bdvipsnames%5D%7Bxcolor%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Csetlength%7B%5Cfboxsep%7D%7B0pt%7D%0A%0AThis+is+my+picture%5Cfbox%7B%25%0A%5Cbegin%7Bpicture%7D%283%2C3%29%281%2C1%29%0A%5Cput%280%2C0%29%7B%7B%5Ccolor%7Bblue%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt%5Ctexttt%7B%280%2C0%29%7D%7D%7D%0A%5Cput%281%2C1%29%7B%7B%5Ccolor%7Borange%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt%5Ctexttt%7B%281%2C1%29%7D%7D%7D%0A%5Cput%283%2C3%29%7B%7B%5Ccolor%7Bred%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt%5Ctexttt%7B%283%2C3%29%7D%7D%7D%0A%5Cput%284%2C4%29%7B%7B%5Ccolor%7Bblack%7D%5Ccircle%2A%7B0.25%7D%7D%5Chbox%7B%5Ckern3pt%5Ctexttt%7B%284%2C4%29%7D%7D%7D%0A%5Cend%7Bpicture%7D%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경의 치수](/files/73a5dfd336551340179e022ab88bc8b6eaef8631)

두 번째 예제는 원점을 이동했을 때의 효과를 보여 주며 몇 가지 핵심 사항을 강조합니다:

* 에 의해 만들어진 테두리는 `\fbox` 그래픽의 바운딩 박스, 즉 LaTeX가 만든 상자의 너비와 높이가 *변하지 않음* 을 보여 줍니다. 즉, 여전히 `(width,height)` 에 있습니다. `\begin{picture}(3,3)(1,1)`
  * 그림 너비 = `너비` × `\unitlength` = 3 × 1cm = 3cm
  * 그림 높이 = `높이` × `\unitlength` = 3 × 1cm = 3cm
* 에 의해 만들어진 영역(바운딩 박스 크기)으로 그리기 요소가 제한(클리핑)되지 않습니다. 예를 들어, 파란 점과 `(0,0)` 좌표는 `\fbox`에서 만들어진 경계선 바깥에 그려집니다.
  * 그리기 요소가 바운딩 박스 안에 머물고 주변 텍스트를 덮지 않도록 하는 것은 사용자의 책임입니다.
* 원점 `(0,0)`은 *더 이상* “이것이 제 그림입니다”라는 텍스트 바로 뒤에 위치하지 않습니다. 즉, `\begin{picture}` 명령이 실행된 지점의 원점은 이제 왼쪽으로 1단위, 아래로 1단위 이동되었습니다
* 이제 오른쪽 위 모서리는 위치 `(4,4)`

## picture 환경의 예제

### LaTeX2e 비공식 참고 매뉴얼의 예제

이 [LaTeX2e 비공식 참고 매뉴얼](https://latexref.xyz/picture.html) 에는 여러 개의 `picture` 환경 예제가 포함되어 있으며, 그중 일부를 여기에 재현했고 Overleaf에서 열 수 있는 링크도 함께 제공하여 코드를 수정하고 살펴볼 수 있습니다.

#### 예제 1: \vector 명령

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(6,6)      % 그림 상자는 가로 6cm, 세로 6cm가 됩니다
  \put(0,0){\vector(2,1){4}}  % 이 벡터에서는 2만큼 갈 때마다 1만큼 올라갑니다
    \put(2,1){\makebox(0,0)[l]{\ first leg}}
  \put(4,2){\vector(1,2){2}}
    \put(5,4){\makebox(0,0)[l]{\ second leg}}
  \put(0,0){\vector(1,1){6}}
    \put(3,3){\makebox(0,0)[r]{sum\ }}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=picture+environment+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Cbegin%7Bpicture%7D%286%2C6%29++++++%25+picture+box+will+be+6cm+wide+by+6cm+tall%0A++%5Cput%280%2C0%29%7B%5Cvector%282%2C1%29%7B4%7D%7D++%25+for+every+2+over+this+vector+goes+1+up%0A++++%5Cput%282%2C1%29%7B%5Cmakebox%280%2C0%29%5Bl%5D%7B%5C+first+leg%7D%7D%0A++%5Cput%284%2C2%29%7B%5Cvector%281%2C2%29%7B2%7D%7D%0A++++%5Cput%285%2C4%29%7B%5Cmakebox%280%2C0%29%5Bl%5D%7B%5C+second+leg%7D%7D++%0A++%5Cput%280%2C0%29%7B%5Cvector%281%2C1%29%7B6%7D%7D%0A++++%5Cput%283%2C3%29%7B%5Cmakebox%280%2C0%29%5Br%5D%7Bsum%5C+%7D%7D++%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![picture 환경 예제](/files/264b1f934669c6d191d4223454ad8e689ba314b9)

#### 예제 2: \qbezier, \line, \vector, \thinlines 및 \thicklines 명령

다음에 주목하세요. `\qbezier` 명령을 *는* 내에서 사용되지 않습니다 `\put{...}` 반면 다음과 같은 다른 기본 명령들은 `\line`, `\vector` *당신이* 내에서 사용되지 않습니다 `\put{...}`.

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(8,4)
  \thinlines % 가는 선으로 시작
  \put(0,0){\vector(1,0){8}}  % x축
  \put(0,0){\vector(0,1){4}}  % y축
  \put(2,0){\line(0,1){3}}    % 왼쪽 변
  \put(4,0){\line(0,1){3.5}}  % 오른쪽 변
  \thicklines % \qbezier 명령에는 더 두꺼운 선을 사용
  \qbezier(2,3)(2.5,2.9)(3,3.25)
  \qbezier(3,3.25)(3.5,3.6)(4,3.5)
  \thinlines % 다시 가는 선 사용
  \put(2,3){\line(4,1){2}}
  \put(4.5,2.5){\framebox{Trapezoidal Rule}}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=qbezier+picture+environment+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Cbegin%7Bpicture%7D%288%2C4%29%0A++%5Cthinlines+%25+Start+with+thin+lines%0A++%5Cput%280%2C0%29%7B%5Cvector%281%2C0%29%7B8%7D%7D++%25+x+axis%0A++%5Cput%280%2C0%29%7B%5Cvector%280%2C1%29%7B4%7D%7D++%25+y+axis%0A++%5Cput%282%2C0%29%7B%5Cline%280%2C1%29%7B3%7D%7D++++%25+left+side%0A++%5Cput%284%2C0%29%7B%5Cline%280%2C1%29%7B3.5%7D%7D++%25+right+side%0A++%5Cthicklines+%25+Use+thicker+lines+for+the+%5Cqbezier+commands%0A++%5Cqbezier%282%2C3%29%282.5%2C2.9%29%283%2C3.25%29%0A++%5Cqbezier%283%2C3.25%29%283.5%2C3.6%29%284%2C3.5%29%0A++%5Cthinlines+%25+Back+to+using+thin+lines%0A++%5Cput%282%2C3%29%7B%5Cline%284%2C1%29%7B2%7D%7D%0A++%5Cput%284.5%2C2.5%29%7B%5Cframebox%7BTrapezoidal+Rule%7D%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경 예제](/files/1e9b55afc2cac699d394e96e7bcc084a99568f62)

#### 예제 3: \multiput 및 \linethickness 명령

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{1cm}
\thicklines
\begin{picture}(10,10)
  \linethickness{0.05mm}
  \multiput(0,0)(1,0){10}{\line(0,1){10}}
  \multiput(0,0)(0,1){10}{\line(1,0){10}}
  \linethickness{0.5mm}
  \multiput(0,0)(5,0){3}{\line(0,1){10}}
  \multiput(0,0)(0,5){3}{\line(1,0){10}}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multiput+command+picture+environment+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Cthicklines%0A%5Cbegin%7Bpicture%7D%2810%2C10%29%0A++%5Clinethickness%7B0.05mm%7D%0A++%5Cmultiput%280%2C0%29%281%2C0%29%7B10%7D%7B%5Cline%280%2C1%29%7B10%7D%7D+%0A++%5Cmultiput%280%2C0%29%280%2C1%29%7B10%7D%7B%5Cline%281%2C0%29%7B10%7D%7D%0A++%5Clinethickness%7B0.5mm%7D%0A++%5Cmultiput%280%2C0%29%285%2C0%29%7B3%7D%7B%5Cline%280%2C1%29%7B10%7D%7D%0A++%5Cmultiput%280%2C0%29%280%2C5%29%7B3%7D%7B%5Cline%281%2C0%29%7B10%7D%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![\multiput 명령 LaTeX picture 환경 예제](/files/1452499c23b291a5489a9c0dcfb5ec0029d7451a)

### 다른 예제들

#### 기본 베지어 곡선

다음 예시는 `\qbezier` 명령을 사용해 베지어 곡선을 그립니다:

```latex
\qbezier(1,1)(5,5)(9,0.5)
```

다음 사항에 유의하세요:

* 그 `\qbezier` 명령은 `\put` 명령을
* 베지어 곡선의 시작점은 `(1,1)`
* 베지어 곡선의 끝점은 `(9,0.5)`
* 베지어 곡선의 제어점은 `(5,5)`
* 베지어 곡선을 그리거나 생성하는 데 사용되는 점의 수를 결정하는 선택적 정수는 사용하지 않습니다

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{0.8cm}
\begin{picture}(10,5)
\thicklines
\qbezier(1,1)(5,5)(9,0.5)
\put(2,1){{Bézier curve}}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multiput+command+picture+environment+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B0.8cm%7D%0A%5Cbegin%7Bpicture%7D%2810%2C5%29%0A%5Cthicklines%0A%5Cqbezier%281%2C1%29%285%2C5%29%289%2C0.5%29%0A%5Cput%282%2C1%29%7B%7BB%C3%A9zier+curve%7D%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX를 사용한 베지어 곡선 그리기](/files/b089944b2c04bb688c1678f01be87180501cd938)

#### 타원, 선 및 원

다음 예제는 `\line`, `\circle` 및 `\oval` 명령을 보여 주며—이들이 어떻게 *당신이* 모두 `\put{...}` 명령:

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{1cm}
\thicklines
\begin{picture}(10,6)
\put(2,2.2){\line(1,0){6}}
\put(2,2.2){\circle{2}}
\put(6,2.2){\oval(4,2)[r]}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=picture+environment+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B1cm%7D%0A%5Cthicklines%0A%5Cbegin%7Bpicture%7D%2810%2C6%29%0A%5Cput%282%2C2.2%29%7B%5Cline%281%2C0%29%7B6%7D%7D%0A%5Cput%282%2C2.2%29%7B%5Ccircle%7B2%7D%7D%0A%5Cput%286%2C2.2%29%7B%5Coval%284%2C2%29%5Br%5D%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경 예제](/files/609dd10cdb66ec076306dde21b05e9a69bf772a6)

아래는 명령에 대한 설명입니다:

* `\put(2,2.2){\line(1,0){6}}`: 선을 그립니다 `6` 길이의 단위로 `(1,0)`
* `\put(6,2.2){\oval(4,2)[r]}`: 점을 중심으로 하는 타원을 그립니다 `(4,2)`. 매개변수 `[r]` 는 선택 사항이며, `r`, `l`, `t` 및 `b` 을 사용하여 타원의 오른쪽, 왼쪽, 위쪽 또는 아래쪽 부분을 보여 줄 수 있습니다.
* `\put(2,2.2){\circle{2}}`: 점을 중심으로 하는 원을 그립니다 `(2,2.2)` 이며 지름은 `2`.

#### 선, 원 및 텍스트 결합하기

더 복잡한 그림을 만들기 위해 서로 다른 기본 요소를 결합할 수 있습니다. 이 예제에서는 여러 선과 원을 결합해 그림을 만들고, 점에 레이블을 붙이기 위한 텍스트도 함께 사용합니다:

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{0.8cm}
\begin{picture}(12,4)
\thicklines
\put(8,3.3){{\footnotesize $3$-simplex}}
\put(9,3){\circle*{0.1}}
\put(8.3,2.9){$a_2$}
\put(8,1){\circle*{0.1}}
\put(7.7,0.5){$a_0$}
\put(10,1){\circle*{0.1}}
\put(9.7,0.5){$a_1$}
\put(11,1.66){\circle*{0.1}}
\put(11.1,1.5){$a_3$}
\put(9,3){\line(3,-2){2}}
\put(10,1){\line(3,2){1}}
\put(8,1){\line(1,0){2}}
\put(8,1){\line(1,2){1}}
\put(10,1){\line(-1,2){1}}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=understanding+picture+dimensions+example+1\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B0.8cm%7D%0A%5Cbegin%7Bpicture%7D%2812%2C4%29%0A%5Cthicklines%0A%5Cput%288%2C3.3%29%7B%7B%5Cfootnotesize+%243%24-simplex%7D%7D%0A%5Cput%289%2C3%29%7B%5Ccircle%2A%7B0.1%7D%7D%0A%5Cput%288.3%2C2.9%29%7B%24a_2%24%7D%0A%5Cput%288%2C1%29%7B%5Ccircle%2A%7B0.1%7D%7D%0A%5Cput%287.7%2C0.5%29%7B%24a_0%24%7D%0A%5Cput%2810%2C1%29%7B%5Ccircle%2A%7B0.1%7D%7D%0A%5Cput%289.7%2C0.5%29%7B%24a_1%24%7D%0A%5Cput%2811%2C1.66%29%7B%5Ccircle%2A%7B0.1%7D%7D%0A%5Cput%2811.1%2C1.5%29%7B%24a_3%24%7D%0A%5Cput%289%2C3%29%7B%5Cline%283%2C-2%29%7B2%7D%7D%0A%5Cput%2810%2C1%29%7B%5Cline%283%2C2%29%7B1%7D%7D%0A%5Cput%288%2C1%29%7B%5Cline%281%2C0%29%7B2%7D%7D%0A%5Cput%288%2C1%29%7B%5Cline%281%2C2%29%7B1%7D%7D%0A%5Cput%2810%2C1%29%7B%5Cline%28-1%2C2%29%7B1%7D%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경 예제](/files/2a552e04a6598aa322f3aa46147b82a53c4fe8ca)

사용된 일부 명령의 요약은 다음과 같습니다:

* `\thicklines`: 이것은 선의 두께를 증가시킵니다.  `\thinlines` 명령은 반대 효과를 냅니다.
* `\put(8,3.3){{\footnotesize $3$-simplex}}`: 텍스트 “3-simplex”는 점 `(8,3.3)`에 삽입되며, 글꼴 크기는 `\footnotesize`로 설정됩니다. 같은 명령이 각 점의 레이블을 지정하는 데 사용됩니다.
* `\put(9,3){\circle*{0.1}}`: 이것은 `(9,3)` 의 작은 지름을 가진 채워진 원을 그리며 `0.1` (그리기 단위)이므로 점으로 사용할 수 있습니다.
* `\put(10,1){\line(3,2){1}}`: 에서 시작하는 직선을 만듭니다 `(10,1)` 그리고 `(3,2)` 의 방향으로 길이 1(그리기 단위)만큼 그려집니다.

#### 화살표 사용하기

화살표도 `picture` 환경 안에서 사용할 수 있으므로, 두 번째 예제를 보겠습니다:

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{0.20mm}
\begin{picture}(400,250)
\put(75,10){\line(1,0){130}}
\put(75,50){\line(1,0){130}}
\put(75,200){\line(1,0){130}}
\put(120,200){\vector(0,-1){150}}
\put(190,200){\vector(0,-1){190}}
\put(97,120){$\alpha$}
\put(170,120){$\beta$}
\put(220,195){상태 상단}
\put(220,45){하위 상태 1}
\put(220,5){하위 상태 2}
\end{picture}
\end{document}
```

[이 예제를 Overleaf에서 열기](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+arrows+in+LaTeX+picture+environment\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bpdftex%5D%7Bpict2e%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Cunitlength%7D%7B0.20mm%7D%0A%5Cbegin%7Bpicture%7D%28400%2C250%29%0A%5Cput%2875%2C10%29%7B%5Cline%281%2C0%29%7B130%7D%7D%0A%5Cput%2875%2C50%29%7B%5Cline%281%2C0%29%7B130%7D%7D%0A%5Cput%2875%2C200%29%7B%5Cline%281%2C0%29%7B130%7D%7D%0A%5Cput%28120%2C200%29%7B%5Cvector%280%2C-1%29%7B150%7D%7D%0A%5Cput%28190%2C200%29%7B%5Cvector%280%2C-1%29%7B190%7D%7D%0A%5Cput%2897%2C120%29%7B%24%5Calpha%24%7D%0A%5Cput%28170%2C120%29%7B%24%5Cbeta%24%7D%0A%5Cput%28220%2C195%29%7Bupper+state%7D%0A%5Cput%28220%2C45%29%7Blower+state+1%7D%0A%5Cput%28220%2C5%29%7Blower+state+2%7D%0A%5Cend%7Bpicture%7D%0A%5Cend%7Bdocument%7D)

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

![LaTeX picture 환경에서의 화살표 예제](/files/4c2390cd217bb0879cfebab045349b7a9031f4f9)

이 `\vector` 명령은 `\line`:

* `\put(120,200){\vector(0,-1){150}}`과 동일한 문법을 사용합니다: 시작점은 `(120,200)`이고, 길이는 `150` 이며 그리는 방향은 `(0,-1)`.

## 추가 읽을거리

자세한 정보는 다음 자료를 참조하세요:

* [LaTeX2e 비공식 참고 매뉴얼](https://latexref.xyz/picture.html)
* [LaTeX2ε에 대한 그리 짧지 않은 소개](https://tobi.oetiker.ch/lshort/lshort.pdf) (5장 참조)
* [Wikibooks](https://en.wikibooks.org/wiki/LaTeX/Picture)
* [태그가 달린 질문 `picture-mode` tex.stackexchange에서](https://tex.stackexchange.com/questions/tagged/picture-mode)
* [`pict2e` 패키지 문서](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf)
* [TikZ 패키지](/latex/ko/figures-and-tables/05-tikz-package.md)
* [Pgfplots 패키지](/latex/ko/field-specific/08-pgfplots-package.md)
* [이미지와 표 배치](/latex/ko/figures-and-tables/02-positioning-images-and-tables.md)
* [표와 그림 목록](/latex/ko/figures-and-tables/03-lists-of-tables-and-figures.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/figures-and-tables/04-picture-environment.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.
