# \vec

Used to place an arrow accent over a symbol or grouped expression, especially for vectors.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Accents](https://texform.dev/latex/topics/accents) |
| Packages | base |
| Allowed mode | math |
| Tags | decoration |
| Commonality | high |
| Kind | prefix |

## Syntax

### base

Argument specification: `m`

Used to place an arrow accent over a symbol or grouped expression, especially for vectors.

## Common tasks

### How to put a vector arrow on a letter

```latex
\vec{v}
```

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

### How to write a vector from A to B

\vec is a short accent; for a long run some fonts look cramped.

```latex
\vec{AB}
```

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

### How to write a time derivative of a vector

```latex
\dot{\vec{r}}
```

[Open in Playground](https://play.texform.dev/?input=%5Cdot%7B%5Cvec%7Br%7D%7D)

## Examples

```latex
\vec{v}
```

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

## Renderer support

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

## Usage frequency

1.32% of formulas in the measured corpus contain this entry, rank 42 of 263 entries with frequency data.

## In TeXForm

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

## See also

- [\\acute](https://texform.dev/latex/commands/acute)
- [\\bar](https://texform.dev/latex/commands/bar)
- [\\breve](https://texform.dev/latex/commands/breve)
- [\\check](https://texform.dev/latex/commands/check)
- [\\ddddot](https://texform.dev/latex/commands/ddddot)
- [\\dddot](https://texform.dev/latex/commands/dddot)
- [\\ddot](https://texform.dev/latex/commands/ddot)
- [\\dot](https://texform.dev/latex/commands/dot)
- [\\grave](https://texform.dev/latex/commands/grave)
- [\\hat](https://texform.dev/latex/commands/hat)
- [\\mathring](https://texform.dev/latex/commands/mathring)
- [\\tilde](https://texform.dev/latex/commands/tilde)
- [\\widehat](https://texform.dev/latex/commands/widehat)
- [\\widetilde](https://texform.dev/latex/commands/widetilde)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \vec{a} | Positive: baseline | Pass | Pass | Pass |
| \vec a | Positive: bare[0] | Pass | Pass | Pass |
