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

# Drawing Diagrams Directly in LaTeX

## Introduction

LaTeX’s built-in `picture` environment can be used to create diagrams/figures—you don’t *need* to load any external packages to use it, but packages such as [`pict2e`](https://ctan.org/pkg/pict2e?lang=en) and [`picture`](https://ctan.org/pkg/picture) have been written to enhance or improve its features.

This article provides a concise introduction to the `picture` environment and all examples use the [`pict2e` package](https://ctan.org/pkg/pict2e?lang=en). More extensive documentation and a range of helpful examples are readily available within the following resources:

* [LaTeX2e unofficial reference manual](https://latexref.xyz/picture.html)
* [The Not So Short Introduction to LaTeX2ε](https://tobi.oetiker.ch/lshort/lshort.pdf) (see Chapter 5)
* [Wikibooks](https://en.wikibooks.org/wiki/LaTeX/Picture)
* [questions tagged `picture-mode` on tex.stackexchange](https://tex.stackexchange.com/questions/tagged/picture-mode)
* [`pict2e` package documentation](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf)

When compared to powerful and sophisticated graphics tools such as [TikZ/PGF](https://en.wikipedia.org/wiki/PGF/TikZ), [MetaPost](https://tug.org/metapost.html), [PSTricks](https://ctan.org/topic/pstricks?lang=en) or [Asymptote](https://ctan.org/pkg/asymptote?lang=en) the `picture` environment may seem quite limited but, from time-to-time, it might be sufficient for what you need to do.

## Creating a new picture

Creating a new picture usually involves the following steps:

1. define the size of the drawing units you wish to use;
2. declare a `picture` environment which defines the picture size;
3. draw the individual graphic components using the `\put`, `\multiput` or `\qbezier` commands.

### Define the size of the drawing units

To create a picture you normally start by setting the *drawing units* via the command `\unitlength`, which must be used outside a `picture` environment. For example, if you write

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

the drawing units would be interpreted as multiples of 1cm. The default unit is 1pt.

### Define the size of your picture

The general form of the `picture` environment is as follows

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

where

* `width` and `height` are values, in units of `\unitlength`, which define the size of the picture. LaTeX uses these values to create a box whose dimensions are
  * box (picture) width = `width` × `\unitlength`
  * box (picture) height = `height` × `\unitlength`
* `(Xoffset, Yoffset)` is an optional coordinate which sets the origin (bottom-left corner) of the picture, expressed as an *offset* relative to the default location. `Xoffset` and `Yoffset` are also expressed in units determined by the current value of `\unitlength`.

Note that `Xoffset` and `Yoffset` do not affect the amount of space that LaTeX reserves; i.e., the box dimensions.

#### Understanding the picture dimensions

We’ll create two pictures, both using `\setlength{\unitlength}{1cm}` and each with a `width` and `height` of 3 units.

The first picture uses the default origin of `(0,0)`:

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

the second picture offsets (shifts) the origin by `(1,1)`:

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

### Drawing graphics

Graphics are created using a sequence of `\put`, `\multiput`, or `\qbezier` commands which produce the individual “components” (or “objects”) from which the picture or illustration is constructed:

* `\put(x, y){*component*}` draws the `*component*` at location `(x, y)`.
* `\multiput(x, y)(dx, dy){n}{*component*}` draws the `*component*` `n` times: starting at location `(x, y)` and repeatedly translating by `(dx, dy)` to redraw the `*component*`.
* `\qbezier[n](x<sub>1</sub>, y<sub>1</sub>)(x, y)(x<sub>2</sub>, y<sub>2</sub>)`: draws a [quadratic Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Quadratic_B%C3%A9zier_curves) where:
  * `n` an optional integer which determines the number of points used plot/produce the curve
  * `(x<sub>1</sub>, y<sub>1</sub>)` is the curve’s start point
  * `(x<sub>2</sub>, y<sub>2</sub>)` is the curve’s end point
  * `(x, y)` denotes the (quadratic) Bézier curve control point

A `*component*` is a graphical element usually produced using graphics primitives such as `\line`, `\oval`, `\circle`, `\vector` and so forth—see the [LaTeX2e unofficial reference manual](https://latexref.xyz/picture.html) or [The Not So Short Introduction to LaTeX2ε](https://tobi.oetiker.ch/lshort/lshort.pdf) (Chapter 5) for details of the available primitives.

**Note**: The [`pict2e` package](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf) extends the original `picture` environment to provide several commands for drawing Bézier curves: `\bezier`, `\qbezier`, `\cbezier` and `\qbeziermax`.

### Understanding the offset and origin

In the following examples the `\put` command is used to draw coloured dots which indicate key coordinates (positions) in the graphic. Both examples use LaTeX’s `\fbox` command to draw a border around the box LaTeX created to contain our picture, showing the *bounding box* of the graphic.

**Example 1: Using the default origin**

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

This is my picture\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}
```

[Open this example in 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)

This example produces the following output:

![dimensions of the LaTeX picture environment](/files/WEPevKlGYPhMLThdCZia)

The `\fbox` command draws a border around the bounding box of the graphic, showing the space (area) reserved by LaTeX:

* picture width = `width` × `\unitlength` = 3 × 1cm = 3cm.
* picture height = `height` × `\unitlength` = 3 × 1cm = 3cm.

The first example shows that the origin, `(0,0)`, is at the point the `\begin{picture}` command was executed, immediately after the text “This is my picture”. In addition, the top-right corner is at position `(3,3)`, the `(width,height)` values provided to `\begin{picture}(3,3)`.

**Example 2: Shifting the origin by (1,1)**

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

This is my picture\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}
```

[Open this example in 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)

This example produces the following output:

![dimensions of the LaTeX picture environment](/files/N3Hpcy2HbhckaObQvxoJ)

The second example shows the effects of shifting the origin and highlights some key points:

* the border created by `\fbox` shows that the bounding box of the graphic, the width and height of the box created by LaTeX, is *unaffected* by shifting the origin: it is still determined by the `(width,height)` values provided to `\begin{picture}(3,3)(1,1)`
  * picture width = `width` × `\unitlength` = 3 × 1cm = 3cm
  * picture height = `height` × `\unitlength` = 3 × 1cm = 3cm
* the drawing elements are not restricted (clipped) to the area (bounding box dimensions) created by LaTeX. For example, the blue dot and `(0,0)` coordinate are drawn outside the boundary line produced by `\fbox`, which indicates the bounding box.
  * It is up to the user to ensure the drawing elements stay within the bounding box and do not overlay any surrounding text.
* the origin, `(0,0)`, is *no longer* located immediately after the text “This is my picture”, at the point the `\begin{picture}` command was executed: the origin is now shifted 1 unit to the left and 1 unit downwards
* the top-right corner is now at position `(4,4)`

## Examples of the picture environment

### Examples from the LaTeX2e unofficial reference manual

The [LaTeX2e unofficial reference manual](https://latexref.xyz/picture.html) contains a number of `picture` environment examples, some of which are reproduced here together with links which open them in Overleaf, allowing you to edit and explore the code.

#### Example 1: the \vector command

```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}
```

[Open this example in 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)

This example produces the following output:

![picture environment example](/files/eCrXTIupwkEdc45ADZYX)

#### Example 2: the \qbezier, \line, \vector, \thinlines and \thicklines commands

Note how the `\qbezier` command *is not* used within `\put{...}` whereas other primitive commands, such as `\line`, `\vector` *are* used within `\put{...}`.

```latex
\documentclass{article}
\usepackage[pdftex]{pict2e}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(8,4)
  \thinlines % Start with thin lines
  \put(0,0){\vector(1,0){8}}  % x axis
  \put(0,0){\vector(0,1){4}}  % y axis
  \put(2,0){\line(0,1){3}}    % left side
  \put(4,0){\line(0,1){3.5}}  % right side
  \thicklines % Use thicker lines for the \qbezier commands
  \qbezier(2,3)(2.5,2.9)(3,3.25)
  \qbezier(3,3.25)(3.5,3.6)(4,3.5)
  \thinlines % Back to using thin lines
  \put(2,3){\line(4,1){2}}
  \put(4.5,2.5){\framebox{Trapezoidal Rule}}
\end{picture}
\end{document}
```

[Open this example in 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)

This example produces the following output:

![Example of the LaTeX picture environment](/files/1z9eLtZbI86Qa9PqBF48)

#### Example 3: the \multiput and \linethickness commands

```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}
```

[Open this example in 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)

This example produces the following output:

![\multiput command LaTeX picture environment example](/files/MN1n7AXXlEcjGDfXPmVs)

### Other examples

#### A basic Bézier curve

The following example uses the `\qbezier` command to draw a Bézier curve:

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

Note the following:

* the `\qbezier` command is not used within a `\put` command
* the Bézier curve start point is `(1,1)`
* the Bézier curve end point is `(9,0.5)`
* the Bézier curve control point is `(5,5)`
* we do not use the optional integer which determines the number of points used plot/produce the Bézier curve

```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}
```

[Open this example in 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)

This example produces the following output:

![Drawing a Bézier curve using LaTeX](/files/D8JO0GDeR4NXXbZzI1xe)

#### Ovals, lines and circles

The following example demonstrates the `\line`, `\circle` and `\oval` commands and—note how they *are* all used within the `\put{...}` command:

```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}
```

[Open this example in 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)

This example produces the following output:

![LaTeX picture environment example](/files/nj0tTHml9W74UWCJjr3b)

Below is a description of the commands:

* `\put(2,2.2){\line(1,0){6}}`: draws a line `6` units long using the “direction vector” `(1,0)`
* `\put(6,2.2){\oval(4,2)[r]}`: draws an oval centred in the point `(4,2)`. The parameter `[r]` is optional, you can use `r`, `l`, `t` and `b` to show the right, left, top or bottom part of the oval.
* `\put(2,2.2){\circle{2}}`: draws a circle centred at the point `(2,2.2)` and whose diameter is `2`.

#### Combining lines, circles and text

Different basic elements can be combined to create more complex pictures. In this example several lines and circles are combined to create a picture, together with text to label the points:

```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}
```

[Open this example in 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)

This example produces the following output:

![LaTeX picture environment example](/files/HheJTAXUrUAdDmC0uR3p)

Here is a summary of some commands used:

* `\thicklines`: this increases the thickness of the lines. The `\thinlines` command has the opposite effect.
* `\put(8,3.3){{\footnotesize $3$-simplex}}`: the text “3-simplex” is inserted at the point `(8,3.3)`, the font size is set to `\footnotesize`. The same command is used to label each point.
* `\put(9,3){\circle*{0.1}}`: this draws a filled circle, centred at `(9,3)` with a small diameter of `0.1` (drawing unit) so it can be used as a point.
* `\put(10,1){\line(3,2){1}}`: creates a straight line starting at `(10,1)` and drawn in the direction of `(3,2)` with a length of 1 (drawing unit).

#### Using arrows

Arrows can also be used inside a `picture` environment so here is a second example:

```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){upper state}
\put(220,45){lower state 1}
\put(220,5){lower state 2}
\end{picture}
\end{document}
```

[Open this example in 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)

This example produces the following output:

![Example of arrows in LaTeX picture environment](/files/f4FlYuBHnhaGpABNiZ3p)

The `\vector` command uses the same syntax as `\line`:

* `\put(120,200){\vector(0,-1){150}}`: draws a vector whose start point is `(120,200)`, length is `150` and the drawing direction is `(0,-1)`.

## Further reading

For more information see the following resources:

* [LaTeX2e unofficial reference manual](https://latexref.xyz/picture.html)
* [The Not So Short Introduction to LaTeX2ε](https://tobi.oetiker.ch/lshort/lshort.pdf) (see Chapter 5)
* [Wikibooks](https://en.wikibooks.org/wiki/LaTeX/Picture)
* [questions tagged `picture-mode` on tex.stackexchange](https://tex.stackexchange.com/questions/tagged/picture-mode)
* [`pict2e` package documentation](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/pict2e/pict2e.pdf)
* [TikZ package](/latex/figures-and-tables/05-tikz-package.md)
* [Pgfplots package](/latex/field-specific/08-pgfplots-package.md)
* [Positioning images and tables](/latex/figures-and-tables/02-positioning-images-and-tables.md)
* [Lists of tables and figures](/latex/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/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.
