# \fbox

Used to draw a rectangular border (box) around mathematical or text content.

https://texform.dev/latex/commands/fbox

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Boxes and text](https://texform.dev/latex/topics/boxes-text) |
| Packages | base |
| Allowed mode | both |
| Tags | presentation |
| Commonality | high |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:T`

Used to draw a rectangular border (box) around mathematical or text content.

## Examples

```latex
\fbox{a}
```

[Open in Playground](https://play.texform.dev/?input=%5Cfbox%7Ba%7D)

```latex
\fbox{x $y$}
```

[Open in Playground](https://play.texform.dev/?input=%5Cfbox%7Bx+%24y%24%7D)

```latex
\raisebox{1ex}{\fbox{$x^2$}}
```

[Open in Playground](https://play.texform.dev/?input=%5Craisebox%7B1ex%7D%7B%5Cfbox%7B%24x%5E2%24%7D%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | full | full |

## Usage frequency

<0.01% of formulas in the measured corpus contain this entry, rank 184 of 263 entries with frequency data.

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

## Equivalent forms

```latex
\boxed{...}
```

approximate. \boxed provides a similar framed box specifically intended for math-mode contents, but typically ensures contents remain in display/text style as appropriate, and is part of amsmath rather than standard LaTeX.

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \fbox{a} | Positive: baseline | Pass | Pass | Pass |
| \fbox a | Positive: bare[0] | Pass | Pass | Pass |
| \fbox{a^2} | Negative: neg:T[0] | Pass | Fail | Fail |
