# \hsize

Used in TeX-style box constructions to set the horizontal size/line width that subsequent \vbox, \vtop, or \vcenter content should use for wrapping.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Spacing](https://texform.dev/latex/topics/spacing) |
| Packages | base |
| Allowed mode | math |
| Tags | invisible |
| Commonality | low |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:L`

Used in TeX-style box constructions to set the horizontal size/line width that subsequent \vbox, \vtop, or \vcenter content should use for wrapping.

## Examples

```latex
\hsize{1em}
```

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

```latex
\hsize 1em
```

[Open in Playground](https://play.texform.dev/?input=%5Chsize+1em)

## Renderer support

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

## In TeXForm

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

## Equivalent forms

```latex
\hsize=#1
```

exact. MathJax also accepts an optional literal = before the dimension, but that prefix is not representable in the current ArgSpec model.

```latex
\hsize #1
```

exact. Unbraced raw dimensions are accepted as long as they form a valid TeX dimension with units.

## Test cases

### base

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