# .box command (Output processor)

The .box command draws a box at the
column positions specified in the command and overwrites anything
that occupies those positions.

## Syntax

```
.box {(pos1,pos2{(,pos3,pos4)})}
```

## Parameter(s)

| pos1 | Specifies the number of characters to offset from the left margin. |
| --- | --- |
| pos2 | Specifies the number of characters to offset from the right margin. |
| pos3 | Specifies the number of characters to offset from the left margin. |
| pos4 | Specifies the number of characters to offset from the right margin. |

## Description

The starting column position
is calculated using the current left margin as the starting point.
If position 3 and position 4 are specified, a second box is drawn
from column position 3 to column position 4 (position 3 must be greater
than position 1, and position 4 must be greater than position 2).

If no parameters are specified, the width of the box is determined
by the left and right margins. The box is drawn on the margin and
the text margins are reduced to fit inside the box.

If position
1 is entered, but position 2 is not, the right-side of the box defaults
to the right margin. If position 3 is entered but position 4 is not,
the right-side of the box defaults to the right margin.

All
text is *boxed* until an .xbox command is
encountered.

If two .box commands are specified
without an .xbox command in between, the second .box command terminates the first box and begins a new
box.

## Example(s)

The words `Example A` are enclosed in a box.

```
.nofill
.box 6,16
Note: Example A is shown on page n1.
.xbox
```
The words `Example A` and `Example B` are enclosed in boxes.

```
.box 6,16,43,53
Note: Example A is shown on page n2 and Example B is shown on page n3.
.xbox
```

## See also

- [.box command (Runoff)](https://d3codex.com/runoff/dot-box-command-runoff/)
- [.tcl box command](https://d3codex.com/output-processor/dot-tcl-box-command/)
- [.xbox command](https://d3codex.com/output-processor/dot-xbox-command/)
- [Output processor commands](https://d3codex.com/output-processor/output-processor-commands/)
- [Output processor overview](https://d3codex.com/output-processor/output-processor-overview/)

---
Source: https://d3codex.com/output-processor/dot-box-command-output-processor/ - part of the D3Codex reference.
