How to create aliases of functions with let?

Hi.

#let bar = overline

$overline(x)$

$bar(x)$

Why doesn’t bar act identically to overline?

Hi. This is because in math mode a lot of functions become available directly, without importing anything through #import math: * (this is for convenience). The let assignment is actually using the text overline element instead of the math overline element. To fix this, simply prepend math.:

#let bar = math.overline

$overline(x)$

$bar(x)$

Note that there is a bar symbol, which is defined here:

The first symbol is the default one, so you can write either bar or bar.v. The let assignment overrides the bar symbol, which is no longer accessible, unless you access it directly ($#sym.bar (x)$ / $std.sym.bar(x)$) or override your own override.

3 Likes