I made a template that has a footer I'd like to expose so I can set it in the main file. I have this code, but when I try to compile it, typst says "variables from outside the function are read-only and cannot be modified"
is there a way to do this?
// === template file
#let footer_text = ""
#let set_footer(txt) = {
footer_text = txt
}
#let template(doc) = [
#set page(
paper: "us-letter",
footer: [#set text(10pt);#h(1fr)#footer_text],
)
#doc
]
// === main file
#import "tools/formatting.typ": *
#set_footer("Math | 461 | Quiz 1 | 30/9/2024")
#show: template