#Resolve cyclic import
5 messages · Page 1 of 1 (latest)
I have made this work with.
main.typ
#import "template.typ": *
#let variable = (
...
)
#show: settings.with(
variable: variable
...
)
template.typ:
#let settings(
...
variable: none,
body,
) = {
...
}
This doesn't solve my use case, but thanks for answering anyway. I played around a bit more with import/include and it seems like having a third file is the only option.
Can you paste some MWE of yours?
Sorry, that I didn't get back to you. I managed to resolve my issue by using a state variable. With it I'm able to include the child.typ only if I compile the main.typ. This allows me to import main.typ into child.typ and use variables from main.
It is probably a bit cursed and I have to check if there are any issues with it once I use it in a real document.