Documentation

accentElement
Question mark
Go to source

Attaches an accent to a base.

In math mode, common accents are also available as named symbols that can be directly called (like functions) to attach them to some content.

Example

$grave(a) = accent(a, `)$ \
$arrow(a) = accent(a, arrow)$ \
$tilde(a) = accent(a, \u{0303})$

Parameters

base
content
RequiredPositional
Question mark

The base to which the accent is applied. May consist of multiple letters.

ExpandView example
$arrow(A B C)$

accent
str or content
RequiredPositional
Question mark

The accent to apply to the base.

Supported accents include:

AccentNameCodepoint
Gravegrave`
Acuteacute´
Circumflexhat^
Tildetilde~
Macronmacron¯
Dashdash
Brevebreve˘
Dotdot.
Double dot, Diaeresisdot.double, diaer¨
Triple dotdot.triple\u{20db}
Quadruple dotdot.quad\u{20dc}
Circlecircle
Double acuteacute.double˝
Caroncaronˇ
Right arrowarrow, ->
Left arrowarrow.l, <-
Left/Right arrowarrow.l.r
Right harpoonharpoon
Left harpoonharpoon.lt

size
relative
Settable
Question mark
Default: 100% + 0pt

The size of the accent, relative to the width of the base.

ExpandView example: Basic usage
$dash(A, size: #150%)$

Note that the resulting accent may not have the exact desired size. For example, an arrow may be either a pre-defined short glyph, or a long glyph assembled from building blocks (arrowhead + line) provided by the font. The sizes of the two possibilities may not cover the entire span. Consequently, arrows of certain intermediate sizes cannot be constructed.

ExpandView example: Size of arrow growing discontinuously
#for i in range(6) {
  $ arrow(#box(
    width: 0.4em + 0.3em * i,
    fill: aqua,
    height: 0.4em,
  )) $
}

dotless
bool
Settable
Question mark
Default: true

Whether to remove the dot on top of lowercase i and j when adding a top accent.

This enables the dtls OpenType feature.

ExpandView example
$hat(dotless: #false, i)$