#How to define variable amongst subdocuments with #include ?

12 messages · Page 1 of 1 (latest)

vapid granite
#

Hi,
After splitting my document into different chapters and using #include for each one of them, is there a way to have "shared variables" for all chapters, like
#let pcite =cite.with(form: "prose") ?

I've played around with templates but could not make it work. Thanks !

slow hill
#

have a template.typ file with those variables in the root folder of your project, then #import "/template.typ": * in each file

#

note that a path starting with / is relative to the project root, not to your filesystem's root

vapid granite
#

Thanks for the super-quick answer. #include is not a preprocessing directive, so there is no better way ?
Also, is #include the best way to split a large document ?

slow hill
#

Also, is #include the best way to split a large document ?
yes I'd say so

vapid granite
#

Thanks, you rocks !

slow hill
#

no problem

#

just note though

#

you dont need to repeat global show and set rules on each file

#

they apply recursively on content which is placed in the main document tree

#

so once you place the output of include in your main document, its output will be subject to show and set rules in the main document