I have a problem. I want to use Meander to produce advanced-layout RPG guidebooks.
To accomplish this, I use Meander to create a two-column layout where I can dynamically include images, tables, and other content.
So I created my own function.
It replicates a two-column layout across multiple pages and places content such as images or other elements on specified pages
#import "@preview/meander:0.4.2"
#let column(n-pages, last-page-height: 50%, placement: (), content) = {
meander.reflow({
// meander.opt.overflow.alert()
meander.opt.debug.post-thread()
for page in range(n-pages) {
for p in placement {
if p.page == page {
p.obj
}
}
if page != (n-pages - 1) {
meander.container(
width: 50% - 3mm,
margin: 6mm,
//style: (text-fill: teal)
)
meander.container(
//style: (text-fill: purple)
)
meander.pagebreak()
} else {
meander.container(
width: 50% - 3mm,
margin: 6mm,
height: last-page-height,
//style: (text-fill: teal)
)
meander.container(
height: last-page-height,
//style: (text-fill: purple)
)
}
}
meander.content[
#content
]
})
}
On test page it worked perfectly, but when I put my true text inside, it appeared that in one random pages the generation stops and all the text is writee at the bottom of this random page.
An example of usage.
#column(
3,
last-page-height: 61%,
placement: (
(
page: 1,
obj: meander.placed(
top + right,
boundary: meander.contour.margin(5mm),
box(width: 50% - 2.5mm, fill: purple)[
#lorem(100)
],
),
),
(
page: 1,
obj: meander.placed(
bottom + left,
boundary: meander.contour.margin(5mm),
box(width: 50% - 2.5mm, fill: green)[
#lorem(100)
],
),
),
(
page: 2,
obj: meander.placed(
top + right,
boundary: meander.contour.margin(5mm),
box(width: 50% - 2.5mm, fill: blue)[
#lorem(100)
],
),
),
),
)[
#for i in range(9) {
heading(level: 1)[titre 1]
lorem(40)
heading(level: 2)[titre 2]
lorem(50)
heading(level: 3)[titre 3]
lorem(20)
}
]
There’s an example of the bug.
I do not understand why the issue happened at this page and why sometimes the problem does not happen and sometime it happen.


