"error: unknown variable" if variable is used inside #include
#4952
-
I get |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Each typst file exists in its own scope, and does not bring with it any definitions when included. I'd recommend creating a file that defines functions you intend to reuse: /// preamble.typ
#let pseudoheading(body) = {
set align(center)
set par(justify: false)
smallcaps(body)
} and import it from your file /// include.typ
#import "preamble.typ": pseudoheading
#pseudoheading[
Lorem ipsum dolor sit ametxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, consectetur adipiscing elit
] |
Beta Was this translation helpful? Give feedback.
-
It is also not possible to include |
Beta Was this translation helpful? Give feedback.
Each typst file exists in its own scope, and does not bring with it any definitions when included. I'd recommend creating a file that defines functions you intend to reuse:
and import it from your file