sitandr / typst-examples-book

Book of educational examples for Typst
https://sitandr.github.io/typst-examples-book/book
MIT License
158 stars 16 forks source link

Best practices for splitting large document #16

Open apraga opened 6 months ago

apraga commented 6 months ago

Location: no idea, hence this issue

Importance: everyone should split their work :)

Discussion from a conversation on discord, I'v learned that

  1. include is the current best way to include sub-files like chapter

  2. There are not preprocessing directives so using custom variables must be put in a template.typ

Snippet: main.typ

#include "ch01-00-intro.typ"
#include "ch01-01-part1.typ"

ch01-00-intro.typ

#import "template.typ": *
#lorem(100)

template.typ

#let pcite =cite.with(form: "prose") 

I feel that this should be expanded to best practices in general but this is the only thing I've found so far :)

sitandr commented 6 months ago

This is a good note, I will certainly write about include. However, I have no ideas what else should I write about "best practices" with include and import.

Maybe also something about project structure or file naming?

apraga commented 6 months ago

Project structure would be nice. I feel it’s important to separate page layout (“set” rule) in a global configuration file for the project and local files that should be imported for each chapter. What’s that I struggled with when setting up a project.