# \Rule

Used to insert a solid rectangular rule with explicit width, height, and depth in mathematical material.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Layout and breaks](https://texform.dev/latex/topics/layout) |
| Packages | base, textmacros |
| Allowed mode | math, text |
| Tags | spacing, mathjax-extension |
| Commonality | low |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:L m:L m:L`

Used to insert a solid rectangular rule with explicit width, height, and depth in mathematical material.

### textmacros

Argument specification: `m:L m:L m:L`

Used to insert a solid rectangular rule with explicit width, height, and depth in text fragments or legacy MathJax TeX input.

## Examples

```latex
\Rule{1em} 2pt {3pt}
```

[Open in Playground](https://play.texform.dev/?input=%5CRule%7B1em%7D+2pt+%7B3pt%7D)

```latex
\text{\Rule{1em}{.5em}{.25em}}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5CRule%7B1em%7D%7B.5em%7D%7B.25em%7D%7D)

```latex
\text{\Rule 1em .5em .25em}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5CRule+1em+.5em+.25em%7D)

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base | m:L m:L m:L | math | Used to insert a solid rectangular rule with explicit width, height, and depth in mathematical material. |
| textmacros | m:L m:L m:L | text | Used to insert a solid rectangular rule with explicit width, height, and depth in text fragments or legacy MathJax TeX input. |

## Renderer support

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

## In TeXForm

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

## See also

- [\\Space](https://texform.dev/latex/commands/Space)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \Rule{1pt}{1pt}{1pt} | Positive: baseline | Pass | Fail | Fail |
| \Rule 1pt{1pt}{1pt} | Positive: bare[0] | Pass | Fail | Fail |
| \Rule{1pt}1pt{1pt} | Positive: bare[1] | Pass | Fail | Fail |
| \Rule{1pt}{1pt}1pt | Positive: bare[2] | Pass | Fail | Fail |
| \Rule{a}{1pt}{1pt} | Negative: neg:L[0] | Fail | Fail | Fail |
| \Rule{1pt}{a}{1pt} | Negative: neg:L[1] | Fail | Fail | Fail |
| \Rule{1pt}{1pt}{a} | Negative: neg:L[2] | Fail | Fail | Fail |

### textmacros

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \Rule{1pt}{1pt}{1pt} | Positive: baseline | Pass | Fail | Fail |
| \Rule 1pt{1pt}{1pt} | Positive: bare[0] | Pass | Fail | Fail |
| \Rule{1pt}1pt{1pt} | Positive: bare[1] | Pass | Fail | Fail |
| \Rule{1pt}{1pt}1pt | Positive: bare[2] | Pass | Fail | Fail |
| \Rule{a}{1pt}{1pt} | Negative: neg:L[0] | Fail | Fail | Fail |
| \Rule{1pt}{a}{1pt} | Negative: neg:L[1] | Fail | Fail | Fail |
| \Rule{1pt}{1pt}{a} | Negative: neg:L[2] | Fail | Fail | Fail |
