Sharing String Contents
Typst offers the capability of content reuse by allowing for file imports. It makes extensive use of functions to perform special manipulation of text.
Shared Function - Load Function from File
Reusable content can be defined in another file within a function. This function when called will yield the shared content.
// shared-function.typ
#let content() = {
[
= Content from another file
Shared appears here.
]
}
The sample.typ
will load the content from shared-function.typ
.
// sample.typ
#import("shared-function.typ"): *
#content()