Skip to content

Commit

Permalink
Update the tensor function
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeGirlMurph authored Oct 22, 2024
1 parent 1cd65e1 commit 953fb24
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions physica.typ
Original file line number Diff line number Diff line change
Expand Up @@ -821,19 +821,20 @@

for i in range(args.len()) {
let arg = args.at(i)
let tuple = if arg.has("children") {
arg.at("children")
let tuple = if type(arg) == content and arg.has("children") {
if arg.children.at(0) in ([+], [-], [#sym.minus]) {
arg.children
} else {
([+],..arg.children)
}
} else {
([+], sym.square)
([+], arg)
}
assert(type(tuple) == array, message: "shall be array")

let pos = tuple.at(0)
let symbol = if tuple.len() >= 2 {
tuple.slice(1).join()
} else {
sym.square
}
let symbol = tuple.slice(1).join()

if pos == [+] {
let rendering = $#symbol$
uppers.push(rendering)
Expand Down

0 comments on commit 953fb24

Please sign in to comment.