Skip to content

Commit

Permalink
Add option to make i and j dotless in vectorarrow and vectorunit
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-hude committed Feb 20, 2024
1 parent 844b942 commit 655e822
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions physica.typ
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,21 @@
// the habitual "A^TT".
#let TT = $sans(upright(T))$

#let __vector(a, accent, be_bold) = {
#let __vector(a, accent, be_bold, dotless: false) = {
let maybe_bold(e) = if be_bold {
math.bold(math.italic(e))
} else {
math.italic(e)
}
let maybe_dotless(e) = if dotless {
show "i": sym.dotless.i
show "j": sym.dotless.j
e
} else { e }
let maybe_accent(e) = if accent != none {
show "i": $dotless.i$
show "j": $dotless.j$
math.accent(maybe_bold(e), accent)
math.accent(maybe_bold(maybe_dotless(e)), accent)
} else {
maybe_bold(e)
maybe_bold(maybe_dotless(e))
}
if type(a) == content and a.func() == math.attach {
math.attach(
Expand All @@ -217,13 +220,13 @@
#let vectorbold(a) = __vector(a, none, true)
#let vb = vectorbold

#let vectorunit(a) = __vector(a, math.hat, true)
#let vectorunit(a, dotless: false) = __vector(a, math.hat, true, dotless: dotless)
#let vu = vectorunit

// According to "ISO 80000-2:2019 Quantities and units — Part 2: Mathematics"
// the vector notation should be either bold italic or non-bold italic accented
// by a right arrow
#let vectorarrow(a) = __vector(a, math.arrow, false)
#let vectorarrow(a, dotless: false) = __vector(a, math.arrow, false, dotless: dotless)
#let va = vectorarrow

#let grad = $bold(nabla)$
Expand Down

0 comments on commit 655e822

Please sign in to comment.