> 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/ja/to/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 [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}
```

ここで

* `width` や `高さ` は、 `\unitlength`の単位で表された値で、図の大きさを定義します。LaTeX はこれらの値を使って、次の寸法の箱を作成します。
  * 箱（図）の幅 = `width` × `\unitlength`
  * 箱（図）の高さ = `高さ` × `\unitlength`
* `(Xoffset, Yoffset)` は、図の原点（左下隅）を設定する任意の座標で、 *オフセット* として既定の位置からの相対値で表されます。 `Xoffset` や `Yoffset` も、現在の `\unitlength`.

次の点に注意してください `Xoffset` や `Yoffset` の値で決まる単位で表されます。これらは LaTeX が確保する空きスペース、つまり箱の寸法には影響しません。

#### 図の寸法を理解する

2 つの図を作成します。どちらも `\setlength{\unitlength}{1cm}` を使い、それぞれ `width` や `高さ` を 3 単位にします。

1 つ目の図では、既定の原点 `(0,0)`:

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

を使います。2 つ目の図では、原点を `(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/9e315c365b0ee1010435eed7a2a9495f7e6322e2)

この `\fbox` コマンドは、図の境界ボックスの周囲に枠を描き、LaTeX によって確保された空間（領域）を示します。

* 図の幅 = `width` × `\unitlength` = 3 × 1cm = 3cm。
* 図の高さ = `高さ` × `\unitlength` = 3 × 1cm = 3cm。

1 つ目の例は、原点 `(0,0)`が、 `\begin{picture}` コマンドが実行された位置、つまり “This is my 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/0a47f866f50437a6a3f78ff07216f61e8aa4edab)

2 つ目の例は、原点を移動した効果を示し、いくつかの重要な点を強調しています。

* によって作成された枠は `\fbox` 、図の境界ボックス、つまり LaTeX によって作成された箱の幅と高さが *変わらない* ことを示しています。これは、依然として `(width,height)` に指定した値 `\begin{picture}(3,3)(1,1)`
  * 図の幅 = `width` × `\unitlength` = 3 × 1cm = 3cm
  * 図の高さ = `高さ` × `\unitlength` = 3 × 1cm = 3cm
* で決まっています。描画要素は、LaTeX によって作成された領域（境界ボックスの寸法）に制限（クリップ）されません。たとえば、青い点と `(0,0)` の座標は、 `\fbox`によって作られる境界線の外側に描かれており、これは境界ボックスを示しています。
  * 描画要素が境界ボックス内に収まり、周囲のテキストに重ならないようにするのは、利用者の責任です。
* 原点 `(0,0)`は *もはや* “This is my picture” というテキストの直後、つまり `\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)      % picture box will be 6cm wide by 6cm tall
  \put(0,0){\vector(2,1){4}}  % for every 2 over this vector goes 1 up
    \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/7b98b9c2ff44a3ef037ae06d5f95c4aef259b722)

#### 例 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{台形則}}
\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/cfa7c749443c41b4d1f2d219da9bd942f48f1c9f)

#### 例 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/1125f25b187a006c5cc15623bdf77a6518cf828b)

### その他の例

#### 基本的なベジェ曲線

次の例では `\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/6edec3d80d1220eee2b5e6d7edb8a7d2fadb7744)

#### 楕円、線、円

次の例では `\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/01ae88a10e30860dc6f2c53c6a66ba11f7119d06)

以下はコマンドの説明です。

* `\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/89bc731296195c798095c2578f6c57146e968a15)

使用したいくつかのコマンドの要約を以下に示します。

* `\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` 環境内で使えます。そこで、2 つ目の例を示します。

```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/454fa4694ef8d24306f1c480efa39d3fe5d0ea80)

この `\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/ja/to/05-tikz-package.md)
* [Pgfplots パッケージ](/latex/ja/fen-ye-bie/08-pgfplots-package.md)
* [画像と表の配置](/latex/ja/to/02-positioning-images-and-tables.md)
* [表と図の一覧](/latex/ja/to/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/ja/to/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.
