Hello everyone,
I’m working on a personal project where I’m building an index and positioning a rectangle along the edge of the page. Here’s the code I’ve written so far:
#let fullindex() = context{
// page number and alignement based on oddity
let page_number = utils._page.get().first()
let page_alignment = utils.get_footer_alignemnt()
set page(...) // a6 format
...
// position of the rectangle based on alignment. Here "index" refer to rect along the page
let position = utils.get_rectangle_position("index", page_alignment)
place(constant.rectangle,dx : position.dx, dy : position.dy, page_alignment)
...
}
The issue arises when the index becomes too long and overflows onto a new page. In this case, I can’t figure out how to extend the rectangle to the new page and align it properly.
Here’s an example where rect should be on the right of the page
How can I ensure the rectangle continues on subsequent pages and remains aligned correctly?
For more insight you can check the project here (Warning it is quite big) :
https://typst.app/project/rKVgshBN8cbSlquzx4diaG
- Relevant files are :
- main.typ
- format/index_format.typ
Thanks in advance for your help!